if(strcmp(x_nr,"red",true) == 0)
{
format(string, sizeof(string), "0xD40000AA");
strmid(PlayerInfo[playerid][pWispCol], string, 0, strlen(string), 255);
PlayerInfo[playerid][pWispCols] = 1;
format(string,sizeof(string),"Your whisper color was setted to RED.");
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
format(string, sizeof(string), "%s(ID: %d) whispers: %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, PlayerInfo[giveplayerid][pWispCol], string);
format(string, sizeof(string), "Whisper sent to %s(ID: %d): %s", giveplayer, giveplayerid, (result));
SendClientMessage(playerid, PlayerInfo[playerid][pWispCol], string);
Originally Posted by Babul
PlayerInfo[giveplayerid][pWispCol] needs to be an integer, not a string.
the hex notation 0xd4 represents d*16+4 = 13*16=208 +4=212, its like an integer, more handy to use for colors |
x = 0xD40000AA;
// ...
SendClientMessage(playerid,x,"red message");
Originally Posted by Amit B
hmm, I think that your code should get some errors.
Anyway, there is a better way to do that: pawn Код:
|
if(strcmp(x_nr,"red",true) == 0) { PlayerInfo[playerid][pWispCol]=0xd40000aa; // PlayerInfo[playerid][pWispCols] = 1; //idk what this is needed for, so i just commented it out format(string,sizeof(string),"Your whisper color was setted to RED."); SendClientMessage(playerid, PlayerInfo[playerid][pWispCol], string); return 1; }
Originally Posted by Babul
Код:
if(strcmp(x_nr,"red",true) == 0) { PlayerInfo[playerid][pWispCol]=0xd40000aa; // PlayerInfo[playerid][pWispCols] = 1; //idk what this is needed for, so i just commented it out format(string,sizeof(string),"Your whisper color was setted to RED."); SendClientMessage(playerid, PlayerInfo[playerid][pWispCol], string); return 1; } |
Originally Posted by Babul
just make sure that your saving routine handles the color like an integer (score, money, any numeric value), not like a string. it should work then ^^
|