25.10.2010, 11:46
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?
Thanks in advanced
Код:
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; }