Making this code shorter
#9

Try something like this:

PHP код:
new weapon[6][] = {{25},{27},{29},{30},{31},{33},{34}};
CheckWeaps(playerid) {
    for(new 
07i++);  {
        if(
PlayerHasWeapon(playeridweapon[i])) return true;
    }
    return 
false;
}
if(
CheckWeaps(playerid)) {
    
// your code here

This will make it easier if you wish to add more weapons along the way.
Reply


Messages In This Thread
Making this code shorter - by GoldenLion - 11.07.2016, 17:01
Re: Making this code shorter - by Mencent - 11.07.2016, 17:05
Re: Making this code shorter - by GoldenLion - 11.07.2016, 17:10
Re: Making this code shorter - by Vince - 11.07.2016, 17:11
Re: Making this code shorter - by Nero_3D - 11.07.2016, 17:11
Re: Making this code shorter - by OneDay - 11.07.2016, 17:45
Re: Making this code shorter - by Mencent - 11.07.2016, 17:58
Re: Making this code shorter - by MayaEU - 11.07.2016, 17:58
Re: Making this code shorter - by DarkSkull - 11.07.2016, 18:36
Re: Making this code shorter - by Stinged - 11.07.2016, 19:09

Forum Jump:


Users browsing this thread: 2 Guest(s)