28.06.2011, 01:37
Now this is the command:
this the sendfactionmessage
No errors now but when I do /f test
Nothing happends. Just nothing.
pawn Код:
COMMAND:f(playerid,params[])
{
new chat[100];
if(sscanf(params,"s[100]",chat)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /f [factionchat]");
if(PlayerInfo[playerid][pFrank] <1) return SendClientMessage(playerid,COLOR_GREY,"You're not in a faction.");
GetPlayerName(playerid,Name,sizeof(Name));
format(String, sizeof(String), "Faction Chat %s: %s",Name,chat);
SendFactionMessage(COLOR_PURPLE,String);
return 1;
}
pawn Код:
SendFactionMessage(color, text[])
{
foreach(Player, i)
{
new FactionS[60];
GetPlayerName(i, Name, sizeof Name);
format(file, sizeof file, SERVER_USER_FILE, Name);
format(FactionS,sizeof(FactionS), "%s", dini_Get(file, "Faction"));//Brackets.
if(strcmp(PlayerInfo[i][pFaction],FactionS, false))
{
SendClientMessage(i, color, text);
}
}
return 0;
}
Nothing happends. Just nothing.