Need help - 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: Need help (
/showthread.php?tid=366362)
Need help -
Crazyboobs - 06.08.2012
I need a help with MySQL.I don't know how to convert my script to MySQL
I need an example, how to convert this script to MySQL script.
pawn Код:
dUserSetINT(PlayerName2(playerid)).("level",0);
dUserSetINT(PlayerName2(playerid)).("LastOn",0);
dUserSetINT(PlayerName2(playerid)).("money",0);
dUserSetINT(PlayerName2(playerid)).("kills",0);
dUserSetINT(PlayerName2(playerid)).("deaths",0);
Re: Need help -
LetsOWN[PL] - 06.08.2012
Hello.
mm, I do not know this syntax.
Nvm, first at all you've to create MySQL base. Do you have one?
If no, then create it, there are threads about it on this forums, just use "SEARCH" option.
If yes, then you can do something like this:
pawn Код:
format(query, sizeof(query), "UPDATE table_name SET column_name = value WHERE PlayerName = %s", PlayerName2(playerid));
. This is an example ofc, it won't work in this way I wrote, you need to configure this for yourself.
Greetz,
LetsOWN
Re: Need help -
Crazyboobs - 06.08.2012
I just want to convert this to mysql
pawn Код:
dUserSetINT(PlayerName2(playerid)).("level",0);
So it would be easy for me to convert everything.
Re: Need help -
LetsOWN[PL] - 06.08.2012
So as above.
If you have created & connected to MySQL db, you can perform queries which will add values into columns/tables.
If you need help with MySQL database, head over here:
https://sampwiki.blast.hk/wiki/MySQL
If you'll have basic knowlege of MySQL (or if you have already), then you can create query to mysql base from
pawn Код:
[dUserSetINT(PlayerName2(playerid)).("level",0);
And it should look somehow like this
pawn Код:
format(query, sizeof(query), "Update table_name Set level = %d Where PlayerName = %s", level, PlayerName2(playerid));
or somethink like this. I dunno how You have wroten your script, so from this level it is all what I can say to you.
Maybe someone other here will guide you better.
Greetz,
LetsOWN
Re: Need help -
Crazyboobs - 06.08.2012
I am using ladmin system, i want to convert the script to mysql.
Can anyone help me?