02.04.2011, 17:07
Use this to get players color then set it back on /saved.
pawn Код:
#include <a_samp>
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
new Color[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/sos", true) == 0) {
new pName [MAX_PLAYER_NAME], string[128];
Color[playerid]=GetPlayerColor(playerid);
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s has called a distress signal! There icon has turnend red, please save them!", pName);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(playerid, COLOR_YELLOW, "Enter /saved when you have been rescued!");
SetPlayerColor(playerid, 0xFF0000AA);
return 1;
}
if(strcmp(cmdtext, "/saved", true) == 0) {
new pName [MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s has been rescued! And no longer needs saving!", pName);
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerColor(playerid, Color[playerid]);
return 1;
}
return 0;
}