15.12.2013, 22:45
pawn Код:
if(strcmp(cmd, "/ah", true) == 0 || strcmp(cmd, "/helperadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: (/ah ou /helperadmin [helpers/admins chat]");
return true;
}
format(string, sizeof(string), "*%d Admin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
SendHelperMessage(0xFFF8F8AA, string);
}
format(string, sizeof(string), "*%d Helper %s: %s", PlayerInfo[playerid][pHelper], sendername, result);
if (PlayerInfo[playerid][pHelper] >= 1)
{
SendHelperMessage(0x63C3F6AA, string);
}
printf("Helper %s: %s", sendername, result);
}
return true;
}