07.06.2013, 13:12
If not holding a melee weapon
07.06.2013, 13:17
What about using && ?
Something like this -
Not sure if it would work but I guess it can be done somehow - However , Kinda better.
Something like this -
PHP код:
if(GetPlayerWeapon(playerid) != 10 && GetPlayerWeapon(playerid) != 11)
07.06.2013, 13:18
Yeah could've done that but I love doing identation and stuff :d
07.06.2013, 13:22
Don't know if that works, make a array of all melee weapons and then a loop.
pawn Код:
for(new w = 0; w < 46; w++) // LOOPS 1 > 45
{
if(GetPlayerWeapon(playerid) != w)
// AND SOME OTHER SHIT HERE, lulz.
}
07.06.2013, 13:30
Thats a much faster way but mine works too, just tested it
07.06.2013, 13:42
A switch statement would work even faster as you only need to call GetPlayerWeapon once. And also much less code.
(Not saying that less code is always better, but in this case it definitely is.)
(Not saying that less code is always better, but in this case it definitely is.)
pawn Код:
switch(GetPlayerWeapon(playerid))
{
case 0..18,36,37,39,40..46: { /* melee */ }
default: { /* not melee */ }
}
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)