29.12.2012, 09:43
I would recomment you since you are using sscanf, to switch to ZCMD because it's faster and better than strcmp.
Last, the lenght of "/le" is not 10, but 3.
Last, the lenght of "/le" is not 10, but 3.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/le", true))
{
new
text[100]
;
if(sscanf(cmdtext, "s[100]",text)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /le [text]");
if(!IsLeader(playerid)) return SendClientMessage(playerid, COLOR_YELLOW, "You are not a leader!");
new
string[128],
leader[ MAX_PLAYER_NAME ],
orgname[118]// it should be lower
;
GetPlayerName(playerid, leader, sizeof(leader));
orgname = GetOrgName(PlayerOrg[playerid]);
format(string,sizeof(string), "%s leader %s: %s", orgname, leader, text);
SendClientMessageToLeaders(0xB6BAFFFF,string); // Make sure that function is called.
print(string);// Debug
return 1;
}
return 0;
}

