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 ) ;
}
if ( ! Strcmp (mCarro[pid][Dono], mCarro[pid][Dono] ) )
if(carro == Dono[1]){ if(mCarro[pid][Dono] == Dono{ msg(playerid, -1, "Voce esta em um carro pArticular); } else { msg(playerid, -1, "Tentando roubar neh Ladraozinho barato"); RemovePlayerFromVehicle(playerid); } }
public OnPlayerStateChange(playerid, newstate, oldstate){
new str[30];
new dn[MAX_PLAYER_NAME];
new dono = GetPlayerName(pid, dn, sizeof(dn));
if(newstate == PLAYER_STATE_DRIVER)
{
if(dono == mCarro[pid][Dono])
{
format(str, sizeof(str), "%s Seu carro esta pronto para se locomover", dn);
msg(pid, -1, str);
}
else
{
msg(playerid, -1, "Tentando roubar neh Ladraozinho barato");
RemovePlayerFromVehicle(playerid);
}
new NomeDoPlayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, NomeDoPlayer, sizeof(NomeDoPlayer));
if(!strcmp(NomeDoPlayer, mCarro[pid][dono], true))
{
//Aqui й o que acontece caso a comparaзгo entre as variбveis for verdadeira(caso ele for o dono)
}
else
{
RemovePlayerFromVehicle(playerid);
//Aqui o oposto(caso nгo for o dono);
}
PHP Code:
|