how would i...
#1

ok i have an area where you can sell weapons, but...

how would i check if the player does not have any weapons and say:

You do not have any weapons to sell!
Reply
#2

GetWeaponData(playerid,&slot,&ammo)
Reply
#3

I'm not sure exactly what you are doing... Are you doing it like CrazyBob's where you have a weapon stockpile, and each time you sell any weapon it goes down by 1? Or are you trying to sell one player's weapons to another player?

Could you post some of your code?
Reply
#4

Код:
stock DoesPlayerHaveAnyWeapons_OMG_thats_a_long_name_for_a_Freakn_function(playerid)
{
   new ammo,weapon;
   for(new slot=0; slot<12; slot++) // Assuming that there are only 12 weapon slots (cuz now I don't remember the real count)
   {
     GetPlayerWeaponData(playerid,slot,ammo,weapon);
     if(ammo || weapon) return true; //ZOMFG >_> we found one.
   }
   return false; // Nope.. he's clean.
}
Should work.
Reply
#5

Quote:
Originally Posted by KANiS6111
Код:
stock DoesPlayerHaveAnyWeapons_OMG_thats_a_long_name_for_a_Freakn_function(playerid)
I lol'd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)