Disable for admin onduty
#1

How can I disable this so the player dont drop guns when he dies if the player is on admin duty?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:pPosX, Float:pPosY, Float:pPosZ;
    GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
    for(new i_slot = 0, gun, ammo; i_slot != 12; i_slot++)
    {
        GetPlayerWeaponData(playerid, i_slot, gun, ammo);
        if(gun != 0 && ammo != 0) CreateDroppedGun(gun, ammo, pPosX+random(2)-random(2), pPosY+random(2)-random(2), pPosZ);
    }
Reply
#2

pawn Код:
if(!IsPlayerAdmin(playerid))
{
    for(new i_slot = 0, gun, ammo; i_slot != 12; i_slot++)
    {
        GetPlayerWeaponData(playerid, i_slot, gun, ammo);
        if(gun != 0 && ammo != 0) CreateDroppedGun(gun, ammo, pPosX+random(2)-random(2), pPosY+random(2)-random(2), pPosZ);
    }
}
you can replace isplayeradmin with a variable or something....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)