little help :D
#1

i have made this command ..its compiled.. but not working.. when i m typing /giveteamweapon usa 24 100// its just replying me this
Usage: /giveteamweapon [teamname USA, Eur, Arab, Rus, Aus, Merc] [weapon name] [ammo]");
PHP код:
CMD:giveteamweapon(playeridparams[])
{
   if(
PlayerInfo[playerid][Level] >= 4)
    {
       new 
team[100],Weapammoweaponname[50];
        if(
sscanf(params,"ii",team,Weapammo)) return SendClientMessage(playerid,red,"Usage: /giveteamweapon [teamname USA, Eur, Arab, Rus, Aus, Merc] [weapon name] [ammo]");
        if(
Weap == 36) return SendClientMessage(playerid,red,"You are not allowed to give these weapons");
        
CMDMessageToAdmins(playerid,"GIVETEAMWEAPON");
       if(
sscanf(params,"s[100]d",team)) return SendClientMessage(playeriddred,"USAGE: /giveteamweapon [teamname USA, Eur, Arab, Rus, Aus, Merc]");
       
//---------USA------------------------
       
if(strfind(params,"USA",true) != -1)
       {
           for(new 
0MAX_PLAYERSi++)
           {
               if(
gTeam[i] == TEAM_USA)
               {
                   
GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i1057,0.0,0.0,0.0);
               }
           }
           new 
string[100];
               
GetWeaponName(Weapweaponnamesizeof(weaponname));
           
format(string,sizeof(string),"Administrator %s has given team %s (%s) (%d) with %d Round of ammo",PlayerName2(playerid),team,weaponname,Weap,ammo);
           
SendClientMessageToAll(bluestring);
       }
       
//---------------------------------
       //--------Eurasia----------------
       
if(strfind(params,"Eur",true) != -1
       {
           for(new 
0MAX_PLAYERSi++)
           {
               if(
gTeam[i] == TEAM_EURASIA)
               {
                   
GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i1057,0.0,0.0,0.0);
               }
           }
           new 
string[100];
          
GetWeaponName(Weapweaponnamesizeof(weaponname));
          
format(string,sizeof(string),"Administrator %s has given team Erusia %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           
SendClientMessageToAll(bluestring);
       }
       
//-------Arabia---------
       
if(strfind(params,"Arab",true) != -1)
       {
           for(new 
0MAX_PLAYERSi++)
           {
               if(
gTeam[i] == TEAM_ARAB)
               {
                   
GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i1057,0.0,0.0,0.0);
               }
           }
           new 
string[100];
           
GetWeaponName(Weapweaponnamesizeof(weaponname));
           
format(string,sizeof(string),"Administrator %s has given team Arab %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           
SendClientMessageToAll(bluestring);
       }
       
//----------Soviet-------
       
if(strfind(params,"Rus",true) != -|| strfind(params,"Russia",true) != -1)
       {
           for(new 
0MAX_PLAYERSi++)
           {
               if(
gTeam[i] == TEAM_SOVIET)
               {
                   
GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i1057,0.0,0.0,0.0);
               }
           }
           new 
string[100];
           
GetWeaponName(Weapweaponnamesizeof(weaponname));
           
format(string,sizeof(string),"Administrator %s has given team Soviet %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           
SendClientMessageToAll(bluestring);
       }
       
//-----------Australia---------
       
if(strfind(params,"Aus",true) != -1)
       {
           for(new 
0MAX_PLAYERSi++)
           {
               if(
gTeam[i] == TEAM_AUS)
               {
                   
GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i1057,0.0,0.0,0.0);
               }
           }
           new 
string[100];
           
GetWeaponName(Weapweaponnamesizeof(weaponname));
           
format(string,sizeof(string),"Administrator %s has given team Autrailia %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           
SendClientMessageToAll(bluestring);
       }
     if(
strfind(params,"Merc",true) != -1)
       {
           for(new 
0MAX_PLAYERSi++)
           {
               if(
gTeam[i] == TEAM_MERC)
               {
                   
GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i1057,0.0,0.0,0.0);
               }
           }
           new 
string[100];
           
GetWeaponName(Weapweaponnamesizeof(weaponname));
           
format(string,sizeof(string),"Administrator %s has given Mercenary %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           
SendClientMessageToAll(bluestring);
       }
         }
    else return 
SendClientMessage(playeriddred,"ERROR: You are not high enough level to use this command!");
    return 
1;

Reply


Messages In This Thread
little help :D - by sanamalik400 - 10.12.2015, 11:21
Re: little help :D - by jlalt - 10.12.2015, 11:29
Re: little help :D - by MBilal - 10.12.2015, 11:35

Forum Jump:


Users browsing this thread: 1 Guest(s)