10.12.2015, 11:21
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]");
Usage: /giveteamweapon [teamname USA, Eur, Arab, Rus, Aus, Merc] [weapon name] [ammo]");
PHP код:
CMD:giveteamweapon(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 4)
{
new team[100],Weap, ammo, weaponname[50];
if(sscanf(params,"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");
if(sscanf(params,"s[100]d",team)) return SendClientMessage(playerid, dred,"USAGE: /giveteamweapon [teamname USA, Eur, Arab, Rus, Aus, Merc]");
//---------USA------------------------
if(strfind(params,"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(params,"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(params,"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(params,"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(params,"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(params,"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;
}