help command
#1

i want admin cant give weapon minigun +rocket launcher

command:

PHP код:
CMD:giveallweapon(playerid,params[]) {
    if(
PlayerInfo[playerid][Level] >= 5) {
        new 
tmp[128], tmp2[128], IndexammoweapWeapName[32], string[128]; tmp strtok(params,Index), tmp2 strtok(params,Index);
        if(
isnull(tmp) ) return SendClientMessage(playeridred"USAGE: /giveallweapon [weapon id/weapon name] [ammo]");
        if(
isnull(tmp2) || !IsNumeric(tmp2) || strval(tmp2) <= || strval(tmp2) > 99999ammo 500;
        if(!
IsNumeric(tmp)) weap GetWeaponIDFromName(tmp); else weap strval(tmp);
          if(!
IsValidWeapon(weap)) return SendClientMessage(playerid,red,"ERROR: Invalid weapon ID");
          
CMDMessageToAdmins(playerid,"GIVEALLWEAPON");
        for(new 
0MAX_PLAYERSi++) {
            if(
IsPlayerConnected(i)) {
                
PlayerPlaySound(i,1057,0.0,0.0,0.0);
                
GivePlayerWeapon(i,weap,ammo);
            }
        }
        
GetWeaponName(weapWeapNamesizeof(WeapName) );
        
format(string,sizeof(string),"Administrator \"%s\" has given all players a %s (%d) with %d rounds of ammo"pName(playerid), WeapNameweapammo);
        return 
SendClientMessageToAll(bluestring);
    } else return 
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");

Reply


Messages In This Thread
help command - by s3ek - 15.03.2015, 00:12
Re: help command - by Smileys - 15.03.2015, 00:19
Re: help command - by iFiras - 15.03.2015, 00:23
Re: help command - by s3ek - 15.03.2015, 00:42
Re: help command - by Smileys - 15.03.2015, 00:51

Forum Jump:


Users browsing this thread: 3 Guest(s)