SA-MP Forums Archive
Need Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Help (/showthread.php?tid=167560)



Need Help - xinix000 - 12.08.2010

How to make when people have sawnoff shotgun will always SetPlayerHealth(playerid, 0);

Thk For All ans


Re: Need Help - Dime - 12.08.2010

I think this will work..
Put this in OnPlayerUpdate
Quote:

if(GetPlayerWeapon(playerid) == 26) {
SetPlayerHealth(playerid,0);
return 0;
}




Re: Need Help - lSCARl - 12.08.2010

this would be better

under like on game mode init or on player spawn
Код:
new weap, ammo;
  for(new i; i < MAX_PLAYERS; i++)
  {
    if(!IsPlayerConnected(i)) continue;
    GetPlayerWeaponData(i, 7, weap, ammo);
    if(weap == 26 && ammo != 0)
    {
      SetPlayerHealth(playerid, 0);
      continue;
    }
  }
  return 1;
}



Re: Need Help - xinix000 - 12.08.2010

Thank it can use ^^