14.03.2014, 13:04
Hello everyone !
I've tried to make a /radio command for the faction LSPD, but I have a little problem. After usign the command it show to me Server Unkown Cmd... and I can't understand where it's the problem...Code
pawn Код:
CMD:radio(playerid,params[])
{
new name[MAX_PLAYER_NAME],string[128],rank[128];
if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pFaction] == 2)
{
if(isnull(params)) return SendClientMessage(playerid,COLOR_GREY,"Syntax: (/r)adio [Text]");
else
{
if(PlayerInfo[playerid][pMute] == 0)
{
rank = GetPlayerFactionRank(playerid);
GetPlayerName(playerid,name,sizeof(name));
for(new i=0; i<=MAX_PLAYERS;i++)
{
if(PlayerInfo[i][pFaction] == 1 || PlayerInfo[i][pFaction] == 2)
{
format(string,sizeof(string),"(Radio) {ffffff}%s{9999ff} {ffffff}%s{9999ff}: %s",rank,name,params);
SendClientMessage(i,0x9999FFFF,string);
}
}
}
else{SendClientMessage(playerid,COLOR_RED,"[Mute]: You are muted and you can't speak !");}
}
}
else{SendClientMessage(playerid,COLOR_GREY,"You aren't authorized to talk on this frequency !");}
return 1;
}
pawn Код:
stock GetPlayerFactionRank(playerid)
{
new rank[128];
if(PlayerInfo[playerid][pFaction] == 0){rank = "Civil";}
if(PlayerInfo[playerid][pFaction] == 1)
{
if(PlayerInfo[playerid][pRank] == 1){rank = "Patrol Officer";}
if(PlayerInfo[playerid][pRank] == 2){rank = "Police Officer";}
if(PlayerInfo[playerid][pRank] == 3){rank = "Sergeant";}
if(PlayerInfo[playerid][pRank] == 4){rank = "Lieutant";}
if(PlayerInfo[playerid][pRank] == 5){rank = "Police Captain";}
if(PlayerInfo[playerid][pRank] == 6){rank = "Deputy Inspector";}
if(PlayerInfo[playerid][pRank] == 7){rank = "Colonel";}
if(PlayerInfo[playerid][pRank] == 8){rank = "Commander";}
if(PlayerInfo[playerid][pRank] == 9){rank = "Deputy Chief";}
if(PlayerInfo[playerid][pRank] == 10){rank = "Police Chief";}
}
return rank;
}
Sorry for some gramatical english mistakes