15.02.2009, 09:06
Hi guys, im making a script to check what weapon a player has.
public TestWeapons(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if (IsPlayerConnected(i))
{
new pWeapon = GetPlayerWeapon(i);
if (Weapon == 8 || Weapon == 9 || Weapon == 16 || Weapon == 17 || Weapon == 21 || Weapon == 35 || Weapon == 36 || Weapon == 37 || Weapon == 38 || Weapon == 42) {
// Do something here
}
}
}
return 1;
}
But as you see, i have a lot if weapon == -number-... so can anybody help me make this job easy?
Thanks.
public TestWeapons(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if (IsPlayerConnected(i))
{
new pWeapon = GetPlayerWeapon(i);
if (Weapon == 8 || Weapon == 9 || Weapon == 16 || Weapon == 17 || Weapon == 21 || Weapon == 35 || Weapon == 36 || Weapon == 37 || Weapon == 38 || Weapon == 42) {
// Do something here
}
}
}
return 1;
}
But as you see, i have a lot if weapon == -number-... so can anybody help me make this job easy?
Thanks.