26.09.2019, 21:59
Como verificar se o player e dono do carro ou removelo??
tentei dessa forma mais nao ta funcionando ele remove ate o dono
tentei dessa forma mais nao ta funcionando ele remove ate o dono
pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate){
new carro = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if (mCarro[pid][Dono] == GetPlayerVehicleID(playerid))
{
new str[30];
new owner[MAX_PLAYER_NAME];
GetPlayerName(mCarro[pid][Dono], owner, sizeof(owner));
format(str, sizeof(str), "Este(a) \"%s\" pertence a %s.", GetVehicleNameFromID(GetPlayerVehicleID(playerid)), owner);
msg(pid , -1, str) ;
}
else{
new str[30];
new owner[MAX_PLAYER_NAME];
GetPlayerName(mCarro[pid][Dono], owner, sizeof(owner));
format (str, sizeof (str), "Veнculo de %s somente ele(a) pode dirigi-lo!" , mCarro[pid][Dono]);
SendClientMessage (pid, -1 , str) ;
PlayerPlaySound (pid , 1147 , 0.0 , 0.0 , 0.0) ;
RemovePlayerFromVehicle ( pid ) ;
}