22.08.2010, 14:52
(
Последний раз редактировалось BuLLeT[LTU]; 23.08.2010 в 08:28.
)
Hello. This is anti drive by (it's working correctly with SA-MP 0.3b).
Do not forget to reset PlayerWeapon and PlayerAmmo variables on OnPlayerDisconnect or OnPlayerConnect.
pawn Код:
new PlayerWeapon[MAX_PLAYERS][13];
new PlayerAmmo[MAX_PLAYERS][13];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
for (new i = 0; i<13; i++)
{
GetPlayerWeaponData(playerid, i, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
}
ResetPlayerWeapons(playerid);
}
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
{
for(new i=0;i<13;i++)
{
GivePlayerWeapon(playerid,PlayerWeapon[playerid][i],PlayerAmmo[playerid][i]);
}
}
return 1;
}