Help Downgrade This Code Please
#1

Ok i just made these weapon commands off the top off my head,Can someone please show me how to make it smaller and add a timer to it so thay cant just spam it and have infinate ammo?

Код:
        if(!strcmp(cmdtext,"/m4",true)) if(gTeam[playerid] != CLASS_MERC)
        {
        GivePlayerWeapon(playerid, 31, 500);
        return 1;
        }
        if(!strcmp(cmdtext,"/mp5",true)) if(gTeam[playerid] != CLASS_MERC)
        {
        GivePlayerWeapon(playerid, 29, 500);
        return 1;
        }
        if(!strcmp(cmdtext,"/sniper",true)) if(gTeam[playerid] != CLASS_MERC)
        {
        GivePlayerWeapon(playerid, 34, 100);
        return 1;
        }
        if(!strcmp(cmdtext,"/rpg",true)) if(gTeam[playerid] != CLASS_MERC)
        {
        GivePlayerWeapon(playerid, 35, 50);
        return 1;
        }
        if(!strcmp(cmdtext,"/grenades",true)) if(gTeam[playerid] != CLASS_MERC)
        {
        GivePlayerWeapon(playerid, 16, 50);
        return 1;
        }
        if(!strcmp(cmdtext,"/gas",true)) if(gTeam[playerid] != CLASS_MERC)
        {
        GivePlayerWeapon(playerid, 17, 50);
        return 1;
        }
        if(!strcmp(cmdtext,"/shot",true)) if(gTeam[playerid] != CLASS_MERC)
        {
        GivePlayerWeapon(playerid, 27, 500);
        return 1;
        }
        if(!strcmp(cmdtext,"/knife",true)) if(gTeam[playerid] != CLASS_MERC)
        {
        GivePlayerWeapon(playerid, 4, 1);
        return 1;
        }
Thanks in advanced
Reply


Messages In This Thread
Help Downgrade This Code Please - by <Weponz> - 25.10.2010, 11:46
Re: Help Downgrade This Code Please - by rbN. - 25.10.2010, 11:49
Re: Help Downgrade This Code Please - by <Weponz> - 25.10.2010, 11:59
Re: Help Downgrade This Code Please - by Calgon - 25.10.2010, 12:01
Re: Help Downgrade This Code Please - by rbN. - 25.10.2010, 12:19
Re: Help Downgrade This Code Please - by <Weponz> - 25.10.2010, 12:31

Forum Jump:


Users browsing this thread: 1 Guest(s)