CLEO Help GetPlayerColor

CLEO related
Status
Not open for further replies.

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
So I've tried to make a code in order to see player's color, for example, if a player is in a faction and has a different name color, i could see what that color is.
Here's the code:
Code:
{$CLEO .cs}               
thread "PlayerColor"
0000:


repeat
wait 0
until SAMP.Available()

0B34: "playercolor" @playercolor

14@ = 0

while true
wait 0
END

:playercolor
SAMP.IsCommandTyped(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
    if SAMP.IsPlayerConnected(21@)
    then
        if 11@ = SAMP.GetActorHandleByPlayerID(21@)
        then
            if 12@ = SAMP.GetPlayerColor(11@)
            then
                chatmsg "{ff00ff}Player color is %x" -1 12@
            end
        end
    end
end
SAMP.CmdRet()
It doesn't really work.
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
delete part which you get handle

Code:
{$CLEO .cs}               
thread "PlayerColor"
0000:


repeat
wait 0
until SAMP.Available()

0B34: "playercolor" @playercolor

14@ = 0

while true
wait 0
END

:playercolor
SAMP.IsCommandTyped(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
    if SAMP.IsPlayerConnected(21@)
    then
        if 12@ = SAMP.GetPlayerColor(21@)
        then
            chatmsg "{ff00ff}Player color is %x" -1 12@
        end
    end
end
SAMP.CmdRet()
Still doesn't work. It doesn't give any error, it just simply doesn't do or say anything
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Code:
{$CLEO .cs}               
thread "PlayerColor"
0000:


repeat
wait 0
until SAMP.Available()

0B34: "playercolor" @playercolor

14@ = 0

while true
wait 0
END

:playercolor
SAMP.IsCommandTyped(20@)
if
0AD4: 20@ = scan_string 20@ format "%d" 21@
then
    if SAMP.IsPlayerConnected(21@)
    then
        12@ = SAMP.GetPlayerColor(21@)
        chatmsg "{ff00ff}Player color is %x" -1 12@
    end
end
SAMP.CmdRet()
Ok so, now it works. While I was looking at the code, I realised that there is no need for "if 12@ = SAMP.GetPlayerColor(21@)" because if the player is connected then it will get the colour and it will just say the colour. Now it works perfectly. Thanks for help though.
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Zi ce vrei sa faci
Complicat... uhm.. Sa fie un dialog ca si lista si sa fie:
Players Online: (header)
Police Departament: (numar de politisti on)
Taxi: (taximetristi on)
Paramedic Departament: (paramedici on)
School Instructors: (instructori on)

Daca selectezi una dintre ele, sa arate fiecare nume, tot intr-un dialog sau cv
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
Status
Not open for further replies.
Top