11.10.2013, 22:48
pawn Код:
CMD:rc(playerid,params[])
{
new string[128];
if(GetPVarInt(playerid, "Spawned") != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(pInfo[playerid][Regularlevel] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"Only Regular Players can use the Regular Player chat to talk.");
return 1;
}
if(!strlen(params))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rc (Message)");
return 1;
}
format(string,sizeof(string),"[REGULAR CHAT] %s(%d): %s",GetName(playerid),playerid,params);
SendClientMessageToAllRegulars(string);
return 1;
}
stock SendClientMessageToAllRegulars(const str[])
{
for (new i = 0, j = GetMaxPlayers(); i < j; i ++) if (IsPlayerConnected(i))
{
if (pInfo[i][Regularlevel] != 0)
{
SendClientMessage(i, 0x00FF00FF, str);
}
}
return 1;
}