SA-MP Forums Archive
help Invisible players - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help Invisible players (/showthread.php?tid=549531)



help Invisible players - _Application_ - 07.12.2014

Make them all invisible, with the option to keep their color chat and return it later


sorry my bad english


Re: help Invisible players - Vince - 07.12.2014

Invisible:
pawn Код:
GetPlayerColor(playerid) & ~0xFF
Visible:
pawn Код:
GetPlayerColor(playerid) | 0xFF



Re: help Invisible players - _Application_ - 07.12.2014

Quote:
Originally Posted by Vince
Посмотреть сообщение
Invisible:
pawn Код:
GetPlayerColor(playerid) & ~0xFF
Visible:
pawn Код:
GetPlayerColor(playerid) | 0xFF
Please can complete code
I want players hidden map (Marker)


Re: help Invisible players - CutX - 07.12.2014

Quote:
Originally Posted by _Application_
Посмотреть сообщение
Please can complete code
I want players hidden map (Marker)
when they connect, set their color like so:
pawn Код:
//example, blue
SetPlayerColor(playerid,0x0000FF00);
this will make them invincible on the map, but blue in the chat

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 Код:
SetPlayerColor(playerid,(savedColor & ~0xFF));
"savedColor" represents the variable holding the saved color from the account file


Re: help Invisible players - _Application_ - 07.12.2014

Quote:
Originally Posted by CutX
Посмотреть сообщение
when they connect, set their color like so:
pawn Код:
//example, blue
SetPlayerColor(playerid,0x0000FF00);
this will make them invincible on the map, but blue in the chat

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 Код:
SetPlayerColor(playerid,(savedColor & ~0xFF));
"savedColor" represents the variable holding the saved color from the account file
will work ?
PHP код:
    if (strcmp("/inv"cmdtexttrue10) == 0)
    {
        
SetPlayerColor(playeridGetPlayerColor(playerid) & ~0xFF);
        return 
1;
    }
    
    if (
strcmp("/uninv"cmdtexttrue10) == 0)
    {
        
SetPlayerColor(playeridGetPlayerColor(playerid) | 0xFF);
        return 
1;
    } 
this not work , I chat written in black

Please make me the code works


Re: help Invisible players - CutX - 07.12.2014

Quote:
Originally Posted by _Application_
Посмотреть сообщение
will work ?
PHP код:
    if (strcmp("/inv"cmdtexttrue10) == 0)
    {
        
SetPlayerColor(playeridGetPlayerColor(playerid) & ~0xFF);
        return 
1;
    }
    
    if (
strcmp("/uninv"cmdtexttrue10) == 0)
    {
        
SetPlayerColor(playeridGetPlayerColor(playerid) | 0xFF);
        return 
1;
    } 
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


Re: help Invisible players - _Application_ - 07.12.2014

Quote:
Originally Posted by CutX
Посмотреть сообщение
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
I do not know how to fix the code please make me the same


I can not understand you, I'm not good in English



Re: help Invisible players - _Application_ - 07.12.2014

helpp?