07.12.2014, 10:35
Make them all invisible, with the option to keep their color chat and return it later
sorry my bad english
sorry my bad english
GetPlayerColor(playerid) & ~0xFF
GetPlayerColor(playerid) | 0xFF
Please can complete code
I want players hidden map (Marker) |
//example, blue
SetPlayerColor(playerid,0x0000FF00);
SetPlayerColor(playerid,(savedColor & ~0xFF));
when they connect, set their color like so:
pawn Код:
it's RGBA Red Green Blue Alpha also, if you hppen to save the color in the players account file, you could get that color and bitwise AND it with the negation of 255(0xFF) to keep it for the chat and still be invincible on the map. like this, 0x0000FFFF (blue,visible) will become 0x0000FF00 (blue, invincible) pawn Код:
|
if (strcmp("/inv", cmdtext, true, 10) == 0)
{
SetPlayerColor(playerid, GetPlayerColor(playerid) & ~0xFF);
return 1;
}
if (strcmp("/uninv", cmdtext, true, 10) == 0)
{
SetPlayerColor(playerid, GetPlayerColor(playerid) | 0xFF);
return 1;
}
will work ?
PHP код:
|
will only work if SetPlayerColor was used before any of these cmd's
cuz GetPlayerColor will get the color set by SetPlayerColor. so it should work i also suggest that you refrain from using string comparison in this day and age... try YCMD |