SA-MP Forums Archive
OnPlayerColorUpdate (Argument Type Mismatch (argument 2)) - 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: OnPlayerColorUpdate (Argument Type Mismatch (argument 2)) (/showthread.php?tid=546650)



OnPlayerColorUpdate (Argument Type Mismatch (argument 2)) - ThaCrypte - 16.11.2014

Код:
new color[32], faction;
	    faction = PlayerInfo[playerid][pFaction];
	    format(color, sizeof(color), "0x%s", FactionInfo[faction][fColor]);
	    SetPlayerColor(playerid, color);
This doesn't appear to be working, and I'm kinda new to saving colors dynamically. I get the Argument Type Mismatch error; and I think it's because of the string but I don't know how to save it otherwise.

Could someone help me out?


Re: OnPlayerColorUpdate (Argument Type Mismatch (argument 2)) - Pottus - 16.11.2014

Color is an integer not a string.


Re: OnPlayerColorUpdate (Argument Type Mismatch (argument 2)) - ThaCrypte - 16.11.2014

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Color is an integer not a string.
I'm using hexadecimals, are you saying I should use normal decimals?


Re: OnPlayerColorUpdate (Argument Type Mismatch (argument 2)) - ThaCrypte - 16.11.2014

Sorry for the double posting, but I decided to use the decimal notation as mentioned here;
https://sampwiki.blast.hk/wiki/SetPlayerColor

But when I converted the hex to decimal and write /setfactioncolor, this happens:


id 0 is completely gone from the list unless you click on it; but still. (id 0, me, is in a faction);