WooZie[GT] pawn Code: public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { SetPlayerArmedWeapon(playerid, 0); } return 1; } Assim o motorista nгo poderб atirar, em qualquer veнculo. (Que й o que acho que vocк estava tentando fazer.) |
new Armas[MAX_PLAYERS][13];
new Ammo[MAX_PLAYERS][13];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2 || newstate == 3)
{
SetPVarInt(playerid, "Veiculo", GetPlayerVehicleID(playerid));
for(new i = 0; i < 13; i ++)
{
GetPlayerWeaponData(playerid, i, Armas[playerid][i], Ammo[playerid][i]);
}
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, 0xFFFF00FF, "Suas armas foram retiradas, para evitar Drive-By. Ao sair do veiculo, elas serгo devolvidas.");
}
if(oldstate == 2 || oldstate == 3)
{
if(GetVehicleModel(GetPVarInt(playerid, "Veiculo")))
{
for(new i = 0; i < 13; i ++)
{
GivePlayerWeapon(playerid, Armas[playerid][i], Ammo[playerid][i]);
}
DeletePVar(playerid, "Veiculo");
SendClientMessage(playerid, 0xFFFF00FF, "Suas armas foram reentregues.");
}
}
return 1;
}