23/06/2022 23:40
(Esta mensagem foi modificada pela última vez a: 24/06/2022 01:49 por xbruno1000x.)
(22/06/2022 23:45)MarcosBrazz Escreveu: Altere para:Show de bola, funcionou perfeitamente, muito obrigado de verdade irmão! Tmj
Coloque fora de callbacks:Código:if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER && !VehicleAsDriver(GetPlayerVehicleID(playerid)))
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+0.5);
return SendClientMessage(playerid, COR_ERRO, "| INFO | O Seu veículo não tem motorista!");
}
OBS: É recomendado a utilização do foreach para esse tipo de loop.Código:stock VehicleAsDriver(vehicleid){
new stats = 0;
for(new i; i < MAX_PLAYERS; i++){
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
stats = 1;
break;
}
}
return stats;
}