[Include] C-MySQL. (Advanced MySQL Account Configuration)
#21

pawn Код:
#define SetPlayerUserName(%0, %1) CMySQL_Set(%0, ACCOUNT_TABLE, "Username", "Username", %1);
Reply
#22

this is awesome, im goona use it!

pawn Код:
CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","Deaths",GetPVarInt(playerid,"Deaths"));
        CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","Kills",GetPVarInt(playerid,"Kills"));
        CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","AdminLvl",GetPVarInt(playerid,"AdminLvl"));
        CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","Color",GetPVarInt(playerid,"Color"));
        CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","Skin",GetPVarInt(playerid,"Skin"));
um... what the hell is the Field (Username is for).. when im creating the database, i added the table (users), and there i add all the stats like deaths, kills, but what is the field?

:/
Reply
#23

Quote:
Originally Posted by cj101
Посмотреть сообщение
this is awesome, im goona use it!

pawn Код:
CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","Deaths",GetPVarInt(playerid,"Deaths"));
        CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","Kills",GetPVarInt(playerid,"Kills"));
        CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","AdminLvl",GetPVarInt(playerid,"AdminLvl"));
        CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","Color",GetPVarInt(playerid,"Color"));
        CMySQL_SetInt(name,ACCOUNT_TABLE,"Username","Skin",GetPVarInt(playerid,"Skin"));
um... what the hell is the Field (Username is for).. when im creating the database, i added the table (users), and there i add all the stats like deaths, kills, but what is the field?

:/
Notice the query inside the function, it updates the value, when someone's 'Username' field is the first parameter, which in your case is name.
Reply
#24

Nice Job.
Reply
#25

Quote:
Originally Posted by StrickenKid
Посмотреть сообщение
Nice Job.
Quote:
Originally Posted by Carlton
Посмотреть сообщение
pawn Код:
#define SetPlayerUserName(%0, %1) CMySQL_Set(%0, ACCOUNT_TABLE, "Username", "Username", %1);
i Luv YouD:@@!!#
Reply
#26

One more thing:

Код:
[03:05:12] MySQL Error (0): Could not execute query. Unknown column 'Name' in 'where clause'.
[03:05:12] MySQL Error (0): Function: 'mysql_store_result' called when no prior query executed.. Unknown column 'Name' in 'where clause'.
Код:
[12:27:14] [join] CJ101 has joined the server (0:xxx)
[12:27:21] MySQL Error (0): Could not execute query. Field 'IPAddress' doesn't have a default value.
[12:27:21] MySQL Error (0): Could not execute query. Unknown column 'CJ101' in 'where clause'.
[12:28:53] [part] CJ101 has left the server (0:1)
Reply
#27

Excellent work! I hope you don't mind if I take a look at how you script your MySql stuff, I'm a noob at this area :P
Reply
#28

Quote:
Originally Posted by cj101
Посмотреть сообщение
One more thing:

Код:
[03:05:12] MySQL Error (0): Could not execute query. Unknown column 'Name' in 'where clause'.
[03:05:12] MySQL Error (0): Function: 'mysql_store_result' called when no prior query executed.. Unknown column 'Name' in 'where clause'.
Код:
[12:27:14] [join] CJ101 has joined the server (0:xxx)
[12:27:21] MySQL Error (0): Could not execute query. Field 'IPAddress' doesn't have a default value.
[12:27:21] MySQL Error (0): Could not execute query. Unknown column 'CJ101' in 'where clause'.
[12:28:53] [part] CJ101 has left the server (0:1)
In your MySQL database at the fields IPAddress & Name.
Reply
#29

Script updated, several functions added:

pawn Код:
native CMySQL_SetUserName(name[], AccountTable[], UserFieldName[], Value[]);
native CMySQL_SetBool(Username[], Table[], Field[], FieldValue[], bool:Value);
Reply
#30

Cool! Really nice work
Reply
#31

btw, your links are dead
Reply
#32

Did u even realised he is banned?
Reply
#33

LOL Can someone mirror it please? Realcop?
Reply
#34

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
LOL Can someone mirror it please? Realcop?
Here : http://www.solidfiles.com/d/08f5fdc6e9/
Reply
#35

Very nice and easy to use this include

Thanks, maybe I will use it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)