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
#2

Код:
       if(sscanf(params,"ii",team,Weap, ammo)) return SendClientMessage(playerid,red,"Usage: /giveteamweapon [teamname USA, Eur, Arab, Rus, Aus, Merc] [weapon name] [ammo]");
use it like that:
PHP код:
       if(sscanf(params,"s[100]ii",team,Weapammo)) return SendClientMessage(playerid,red,"Usage: /giveteamweapon [teamname USA, Eur, Arab, Rus, Aus, Merc] [weapon name] [ammo]"); 
Reply
#3

Код:
CMD:giveteamweapon(playerid, params[])
{
   if(PlayerInfo[playerid][Level] >= 4)
    {
       new team[100],Weap, ammo, weaponname[50];
        if(sscanf(params,"s[100]ii",team,Weap, ammo)) 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");
        //---------USA------------------------
       if(strfind(team,"USA",true) != -1)
       {
           for(new i = 0; i < MAX_PLAYERS; i++)
           {
               if(gTeam[i] == TEAM_USA)
               {
                   GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i, 1057,0.0,0.0,0.0);
               }
           }
           new string[100];
       	   GetWeaponName(Weap, weaponname, sizeof(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(blue, string);
       }
        //--------Eurasia----------------
       if(strfind(team,"Eur",true) != -1)
       {
           for(new i = 0; i < MAX_PLAYERS; i++)
           {
               if(gTeam[i] == TEAM_EURASIA)
               {
                   GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i, 1057,0.0,0.0,0.0);
               }
           }
           new string[100];
          GetWeaponName(Weap, weaponname, sizeof(weaponname));
          format(string,sizeof(string),"Administrator %s has given team Erusia %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           SendClientMessageToAll(blue, string);
       }
       //-------Arabia---------
       if(strfind(team,"Arab",true) != -1)
       {
           for(new i = 0; i < MAX_PLAYERS; i++)
           {
               if(gTeam[i] == TEAM_ARAB)
               {
                   GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i, 1057,0.0,0.0,0.0);
               }
           }
           new string[100];
           GetWeaponName(Weap, weaponname, sizeof(weaponname));
           format(string,sizeof(string),"Administrator %s has given team Arab %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           SendClientMessageToAll(blue, string);
       }
       //----------Soviet-------
       if(strfind(team,"Rus",true) != -1 || strfind(params,"Russia",true) != -1)
       {
           for(new i = 0; i < MAX_PLAYERS; i++)
           {
               if(gTeam[i] == TEAM_SOVIET)
               {
                   GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i, 1057,0.0,0.0,0.0);
               }
           }
           new string[100];
           GetWeaponName(Weap, weaponname, sizeof(weaponname));
           format(string,sizeof(string),"Administrator %s has given team Soviet %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           SendClientMessageToAll(blue, string);
       }
       //-----------Australia---------
       if(strfind(team,"Aus",true) != -1)
       {
           for(new i = 0; i < MAX_PLAYERS; i++)
           {
               if(gTeam[i] == TEAM_AUS)
               {
                   GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i, 1057,0.0,0.0,0.0);
               }
           }
           new string[100];
           GetWeaponName(Weap, weaponname, sizeof(weaponname));
           format(string,sizeof(string),"Administrator %s has given team Autrailia %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           SendClientMessageToAll(blue, string);
       }
     if(strfind(team,"Merc",true) != -1)
       {
           for(new i = 0; i < MAX_PLAYERS; i++)
           {
               if(gTeam[i] == TEAM_MERC)
               {
                   GivePlayerWeapon(i,Weap,ammo) && PlayerPlaySound(i, 1057,0.0,0.0,0.0);
               }
           }
           new string[100];
           GetWeaponName(Weap, weaponname, sizeof(weaponname));
           format(string,sizeof(string),"Administrator %s has given Mercenary %s (%d) with %d Round of ammo",PlayerName2(playerid),weaponname,Weap,ammo);
           SendClientMessageToAll(blue, string);
       }
         }
    else return SendClientMessage(playerid, dred,"ERROR: You are not high enough level to use this command!");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)