pawn Код:
if(strcmp(cmd, "/givecolor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1) // Check if admin.
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setplayercolor [playerid] [color]");
SendClientMessage(playerid, COLOR_GRAD1, "Available colors: Red, Pink, Orange, Yellow, Cyan, Green, Blue, Black, White, Marker");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new x_job[128];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setplayercolor [playerid] [color]");
SendClientMessage(playerid, COLOR_GRAD1, "Available colors: Red, Pink, Orange, Yellow, Cyan, Green, Blue, Black, White, Marker");
return 1;
}
if(strcmp(x_job,"red",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_RED);
else if(strcmp(x_job,"pink",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_PINK);
else if(strcmp(x_job,"orange",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_ORANGE);
else if(strcmp(x_job,"yellow",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_YELLOW);
else if(strcmp(x_job,"cyan",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_CYAN);
else if(strcmp(x_job,"green",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_GREEN);
else if(strcmp(x_job,"blue",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_BLUE);
else if(strcmp(x_job,"black",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_BLACK);
else if(strcmp(x_job,"white",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_WHITE);
else if(strcmp(x_job,"marker",true) == 0) SetPlayerColor(giveplayerid, SCOLOR_MARKER);
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "! %s has set %s's name color.", sendername, giveplayer);
SendClientMessage(giveplayerid, COLOR_GRAD1, " Your name color has been set by an admin.");
ABroadCast(COLOR_LIGHTRED, string, 1);
return 1;
}
return 1;
}
SendClientMessage(playerid, COLOR_WHITE, "You are not authorized to use this command.");
return 1;
}
format(string, sizeof(string), " %d is not an active player !", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
return 0;
}