SetPlayerColor()
#1

When retrieving colors from MySQL and setting it on login how do I store it properly and call it properly?
Reply
#2

Why from MySQL?
Put it in a simple Include and It'll be much easier, and what do you mean by LOGIN?
Reply
#3

I'm saving the playercolors to MySQL, and no I'm not going to make any stupid include. I'm just wondering how I can set them properly without it always returning 0. If I do a printf it gives me the correct colorcode, but when SetPlayerColor() it sets 0. For some reason.
Reply
#4

Show the part where it converts the MySQL var to a string.
Reply
#5

I'm saving it as a string, that's probably not right?
pawn Код:
mysql_fetch_field("color", PlayerData[playerid][pColor]);
Reply
#6

pawn Код:
mysql_fetch_field("color", PlayerData[playerid][pColor]);
I don't know how did you exactly saves it, with a ORIGINAL color?

EXAMPLE:

0x00D900C8
Reply
#7

And how to you converted GetPlayerColor to PlayerData[playerid][pColor]?
Reply
#8

Quote:
Originally Posted by DVDK
Посмотреть сообщение
And how to you converted GetPlayerColor to PlayerData[playerid][pColor]?
That's not the problem.... MySQL gives me the correct color (0x2641FEAA), and so does the printf() it's SetPlayerColor() that's the problem.
Reply
#9

Try this:
pawn Код:
mysql_fetch_field("color", PlayerData[playerid][pColor]);
pawn Код:
SetPlayerColor(playerid, PlayerData[playerid][pColor]);
Reply
#10

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
Try this:
pawn Код:
mysql_fetch_field("%s", PlayerData[playerid][pColor]);
pawn Код:
SetPlayerColor(playerid, PlayerData[playerid][pColor]);
Eh, do you even know how MySQL works?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)