SA-MP Forums Archive
[HELP]In Making a Color system that Uses Y_Ini - 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]In Making a Color system that Uses Y_Ini (/showthread.php?tid=334400)



[HELP]In Making a Color system that Uses Y_Ini - Phyrunx - 14.04.2012

i need help in making a Colour system that uses Y_ini and Saves the Skins
And when the guy rejoins he get the same Players name Colour?

i know how to make a Colour system but i dont know how to make it saves the Color and load it On Re connect
the Colour saving should be automatic when a player uses /mycolor and chooses a the colour it automaticly saves the file in .ini Document and when player rejoin He set's his colour according to the one found in the.ini File


Re: [HELP]In Making a Color system that Uses Y_Ini - Phyrunx - 15.04.2012

Bump! Anyone please help?


Re: [HELP]In Making a Color system that Uses Y_Ini - NeTuddMeg - 15.04.2012

I can't understand the Y_INI, but you need to use this, I think.

Code:
new playercolor; //variable for store the player's color
INI_WriteHex(filename[], "color", GetPlayerColor(playerid)); //to write the color.. You need to use SetPlayerColor, before get the players color with this function
INI_Hex("color", playercolor); //to read the color from file
SetPlayerColor(playerid, playercolor); //to set the player's color back.
I think, its work.


Re: [HELP]In Making a Color system that Uses Y_Ini - Joe Staff - 15.04.2012

Hexadecimals become integers when assigned to a variable


pawn Code:
new variable = 0xFF0000FF
printf("variable = %d",variable);
will print
Code:
variable = 4278190335
So you can just set it to a variable and save it as an integer


Re: [HELP]In Making a Color system that Uses Y_Ini - Phyrunx - 15.04.2012

Thnx To Both of you Now i can Make it repped You both