12.01.2011, 21:02
Hi. Im trying to make a /r(adio) command for players in a PD faction. This is my code:
But, when I type /r sometext, nothing shows up on my screen. I don't know about the other's screen, cause I didn't test it on other players and I can't atm.
pawn Код:
[COMMAND:r(playerid, params[])
{
new msg[128], copname[40], rchat[128];
if(PlayerInfo[playerid][pFaction] == 0) return SendClientMessage(playerid,COLOR_WHITE," You are not in a faction");
if(sscanf(params, "s[128]", rchat)) return SendClientMessage(playerid,COLOR_WHITE," Usage: /r [text]");
GetPlayerName(playerid, copname, sizeof(copname));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction])
{
format(msg, sizeof(msg), "%s (%i - %s): %s, over.", copname, PlayerInfo[playerid][pFRank], PlayerInfo[playerid][pFRankName], rchat);
SendClientMessage(i, COLOR_BLUE, msg);
return 1;
}
}
}