04/12/2023 00:44
Código PHP:
public OnPlayerDisconnect(playerid, reason)
{
if(Veh[playerid] != INVALID_VEHICLE_ID) {
DestroyVehicle(Veh[playerid]);
Veh[playerid] = INVALID_VEHICLE_ID;
}
return 1;
}
CMD:car(playerid, params[])
{
new String[200], Cor1, Cor2, FloatTongueosX, FloatTongueosY,FloatTongueosZ, Float:Rot;
if(sscanf(params, "s[90]dd", pveh, Cor1, Cor2))
return SendClientMessage(playerid, 0xFF0000AA, "| ERRO | {FFFFFF}Tente Usar /car [Nome] [Cor 1] [Cor 2]");
new vehicle = PegarNomeDoVeiculo(pveh);
if(vehicle < 400 || vehicle > 611)
return SendClientMessage(playerid, 0xFF0000AA, "| Erro | {FFFFFF}Veiculo Nao Encontrado !");
if(Veh[playerid] != INVALID_VEHICLE_ID) {
DestroyVehicle(Veh[playerid]);
}
GetPlayerPos(playerid, PosX, PosY, PosZ);
GetPlayerFacingAngle(playerid, Rot);
Veh[playerid] = CreateVehicle(vehicle, PosX, PosY, PosZ, Rot, Cor1, Cor2, GetPlayerVirtualWorld(playerid));
SetVehicleVirtualWorld(Veh[playerid], GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, Veh[playerid], 0);
format(String, sizeof(String), "{FF0000}Razer {FFFFFF}Pilots Veiculo Criado Com Sucesso! [ Veiculo: {0x80FF00AA}%s ]", NomeDosVeiculos[vehicle - 400]);
SendClientMessage(playerid, 0xFFFF80AA, String);
return 1;
}