save player color
#1

Removed
Reply
#2

By using GetPlayerColor and queries.
Reply
#3

this is a example for dini:

pawn Код:
new file[300];
format(file,sizeof(file),"Colors%s", name);
dini_IntSet(file, "Color", GetPlayerColor(playerid));
SendClientMessage(playerid, COLOR_YELLOW, "Color saved successfully");
that should work for saving, and for loading simply use:

pawn Код:
new file[300], Color;
format(file,sizeof(file),"Colors%s", name);
Color = dini_Int(file, "Color");
SetPlayerColor(playerid, Color);
SendClientMessage(playerid, COLOR_YELLOW, "Color Loaded successfully");
something like that should work
Reply
#4

Removed
Reply
#5

im not familiar with mysql, sorry, but search on ****** and im sure you find it
Reply
#6

You would have to insert the player's color as a value into your database and table the first time, then update it if it's already set. All this would be done with a query.
Reply
#7

Removed
Reply
#8

First yo need to add a new column in your database table called color then
Add this to query:

pawn Код:
mysql_query("INSERT `%s` INTO `color` WHERE User = %d", color, pname);
Just readjust this to fit in your query.

Reply
#9

Removed
Reply
#10

HEX_CODE will be saved into database.

COLOR_BLUE is a variable holding the value of the HEX CODE.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)