Checking if a player has a certain weapon in hand.
#3

Quote:
Originally Posted by Battallboi
Посмотреть сообщение
Put this at the end of the gamemode.

Код:
   stock gCheckPlayerWeapon(playerid, _weaponid)
   {
      const MAX_WEAPONS_SLOTS = 13;
      static ammo, weaponid;
      for (new i; i != MAX_WEAPONS_SLOTS; i++)
   {
      if (GetPlayerWeaponData(playerid, i, weaponid, ammo) == 0)
      return 0;
      if (weaponid == _weaponid)
      return 1;
   }
   return 0;
   }
And put this one in the OnPlayerSpawn public.
Код:
if(gCheckPlayerWeapon(playerid, putweaponidhere)) //put the id of the weapon that you desire
{
//attach shotgun code
}
Doesn't work, I spawn the weapon and it doesn't place gun on my back
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)