SA-MP Forums Archive
[GameMode] Simple MySQL R39-3 v1.0 - 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: Gamemode Scripts (https://sampforum.blast.hk/forumdisplay.php?fid=71)
+--- Thread: [GameMode] Simple MySQL R39-3 v1.0 (/showthread.php?tid=569686)

Pages: 1 2


Simple MySQL R39-3 v1.0 - JeaSon - 01.04.2015

Introduction
hello!

i made this becoz alot of people ask about this so i decided to make a new and simple one where everyone can beign a gamemode with there ideas well this gamemode is very simple with only 3 commands /stats /setlevel /setvip and it also saves kills + deaths


this gamemode have

v1.0
auto login
/stats
/setlevel
/setvip

v1.1
/mute
/unmute
/setkils
/setmoney
/setdeaths
/setscore
/blockcommand /blockcmd
/unblockcommand /unblockcmd


i hope you guys like it

gamemode
pastebin: http://pastebin.com/RX2PwsH7

SQL data: http://pastebin.com/Fr3GAhPa


change this to yours one
pawn Code:
//Let's define our mysql settings
#define host    "localhost" //This will be your mysql host. Default for xampp is localhost
#define user    "root" //This will be your mysql username. Default for xampp is root
#define db      "sami" //This is your database name. Remember we have created a database called server before.
#define pass    "" //This is your mysql password. In xampp, the password didn't set. So leave it empty.
if you found bugs report it here i will fix it and if i get time i will try to update it

credits
newbienoob for tutorial
BlueG for mysql plugin
***** for sscanf and whirlpool
me for creating this gamemode


Re: Simple MySQL R9-3 v1.0 - Alex Magaсa - 01.04.2015

Good job mate.! keep it up!


Re: Simple MySQL R9-3 v1.0 - Younes44 - 01.04.2015

Good Work dude


Re: Simple MySQL R9-3 v1.0 - Abagail - 01.04.2015

MySQL r9-3? You mean R39- or an outdated version of the plugin?


Re: Simple MySQL R9-3 v1.0 - JeaSon - 02.04.2015

Quote:
Originally Posted by Younes44
View Post
Good Work dude
thanks

Quote:
Originally Posted by Alex Magaсa
View Post
Good job mate.! keep it up!
thanks

Quote:
Originally Posted by Abagail
View Post
MySQL r9-3? You mean R39- or an outdated version of the plugin?
i mean R9 the latest plugin


Re: Simple MySQL R9-3 v1.0 - SpikY_ - 02.04.2015

Good job. Basic gamemode.
SpikY_ here :]


Re : Re: Simple MySQL R9-3 v1.0 - nicolaskettler - 02.04.2015

Quote:
Originally Posted by JeaSon
View Post
thanks



thanks



i mean R9 the latest plugin
Which plugin are you talking about ? The last BlueG's plugin is R39-2 i believe


Re: Re : Re: Simple MySQL R9-3 v1.0 - JeaSon - 02.04.2015

Quote:
Originally Posted by nicolaskettler
View Post
Which plugin are you talking about ? The last BlueG's plugin is R39-2 i believe
no its r39-3 check it on github

https://github.com/pBlueG/SA-MP-MySQ...ases/tag/R39-3


Re: Simple MySQL R9-3 v1.0 - MohanedZzZ - 02.04.2015

Good work JeaSon.


Re : Re: Re : Re: Simple MySQL R9-3 v1.0 - nicolaskettler - 02.04.2015

Quote:
Originally Posted by JeaSon
View Post
Yeah but you said R9-3


MohanedZzZ - JeaSon - 03.04.2015

Quote:
Originally Posted by MohanedZzZ
Посмотреть сообщение
Good work JeaSon.
thanks bro

v1.1
Код:
Added /mute 
Added /unmute
Added /setkills
Added /setdeaths
Added /setscore
Added /setmoney
Added /blockcommand /blockcmd
Added /unblockcmd /unblockcommand
block and unblock system by Threshold


Re: Simple MySQL R9-3 v1.0 - LazyB0y - 09.04.2015

Wow nice omg cool


Re: Simple MySQL R39-3 v1.0 - yvoms - 08.11.2015

What are the versions for sscanf2 and zcmd?
I'm trying to get this to work, however it gives me a minor error,

tested with sscanf 2.8.2, doesnt work unfortunately.
mysql r39-3?

[20:30:44] Error: Function not registered: 'SSCANF_Init'
[20:30:44] Error: Function not registered: 'SSCANF_IsConnected'
[20:30:44] Error: Function not registered: 'SSCANF_Join'
[20:30:44] Error: Function not registered: 'SSCANF_Leave'
[20:30:44] Error: Function not registered: 'sscanf'
[20:30:44] Script[gamemodes/lvcnr.amx]: Run time error 19: "File or function is not found"


Re: Simple MySQL R39-3 v1.0 - JeaSon - 09.11.2015

yes this gamemode uses 2.8.2 sscanf and mysql r39-3


- yvoms - 09.11.2015

Could you make repack?
Like rar your the gamemode with all required files in it ao its ready to go, i'd like to see what this brings.

Send me the link in a pm if u could.

Nevermind got it to work with debugging


Re: Simple MySQL R39-3 v1.0 - Banditul18 - 27.12.2015

How to resolve this error?
Код:
[20:00:28] [DEBUG] mysql_connect - host: "127.0.0.1", user: "port_2531", database: "port_2531", password: "****", port: 3306, autoreconnect: true, pool_size: 2
[20:00:28] [DEBUG] CMySQLHandle::Create - creating new connection..
[20:00:28] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[20:00:28] [DEBUG] CMySQLHandle::Create - connection created (id: 1)
[20:00:28] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[20:00:28] [DEBUG] CMySQLConnection::Connect - connection was successful
[20:00:28] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[20:00:28] [DEBUG] mysql_errno - connection: 1
[20:00:28] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[20:00:28] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[20:00:28] [DEBUG] CMySQLConnection::Connect - connection was successful
[20:00:28] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[20:00:28] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[20:00:28] [DEBUG] CMySQLConnection::Connect - connection was successful
[20:00:28] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[20:00:28] [DEBUG] CMySQLConnection::Connect - connection was successful
[20:00:28] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[20:01:28] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `IP`, `Password`, `ID` FROM `players` WHERE `Username` = '%e' LIMIT 1"
[20:01:28] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `IP`, `Password`, `ID` FROM `players` WHERE `Username` = ", callback: "OnAccountCheck", format: "i"
[20:01:28] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution
[20:01:28] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.274 milliseconds
[20:01:28] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[20:01:28] [DEBUG] Calling callback "OnAccountCheck"..
[20:01:28] [DEBUG] cache_get_data - connection: 1
[20:01:28] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[20:01:31] [DEBUG] mysql_format - connection: 1, len: 300, format: "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `VIP`,`Kills`,`Deaths`,`Score`, `Money`) VALUES ('%e', '%s', '%s',..."
[20:01:31] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `V", callback: "OnAccountRegister", format: "i"
[20:01:31] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - starting query execution
[20:01:32] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - query was successfully executed within 39.767 milliseconds
[20:01:32] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[20:01:32] [DEBUG] Calling callback "OnAccountRegister"..
[20:01:32] [DEBUG] cache_insert_id - connection: 1
[20:01:32] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[20:02:30] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `IP`, `Password`, `ID` FROM `players` WHERE `Username` = '%e' LIMIT 1"
[20:02:30] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `IP`, `Password`, `ID` FROM `players` WHERE `Username` = ", callback: "OnAccountCheck", format: "i"
[20:02:30] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution
[20:02:30] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.607 milliseconds
[20:02:30] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[20:02:30] [DEBUG] Calling callback "OnAccountCheck"..
[20:02:30] [DEBUG] cache_get_data - connection: 1
[20:02:30] [DEBUG] cache_get_field_content - row: 0, field_name: "IP", connection: 1, max_len: 16
[20:02:30] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "IP", data: "109.98.164.64"
[20:02:30] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[20:02:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Admin", connection: 1
[20:02:33] [WARNING] cache_get_field_content_int - no active cache
[20:02:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "VIP", connection: 1
[20:02:33] [WARNING] cache_get_field_content_int - no active cache
[20:02:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Money", connection: 1
[20:02:33] [WARNING] cache_get_field_content_int - no active cache
[20:02:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Kills", connection: 1
[20:02:33] [WARNING] cache_get_field_content_int - no active cache
[20:02:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Deaths", connection: 1
[20:02:33] [WARNING] cache_get_field_content_int - no active cache
[20:02:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Score", connection: 1
[20:02:33] [WARNING] cache_get_field_content_int - no active cache
[20:03:19] [DEBUG] mysql_format - connection: 1, len: 100, format: "UPDATE `players` SET `IP`='%s', `Admin`=%d, `VIP`=%d, `Kills`=%d, `Deaths`=%d, `Score`=%d, `Money`=%d WHERE `ID`=%d"
[20:03:19] [ERROR] mysql_format - destination size is too small
[20:03:19] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `IP`='109.98.164.64', `Admin`=0, `VIP`=0, `", callback: "(null)", format: "(null)"
[20:03:19] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[20:03:19] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
[20:03:19] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
On register works perfectly, but when relog.....


Re: Simple MySQL R39-3 v1.0 - Loinal - 22.09.2016

It save only level not score and money and kills


Re: Simple MySQL R39-3 v1.0 - Slawiii - 23.09.2016

Quote:
Originally Posted by Loinal
Посмотреть сообщение
It save only level not score and money and kills
its working fine for me!
i think you aren't installed the database correctly.


- Loinal - 24.11.2016

I installed it but the score , money dont save

Add me at skype to look at my code i cant share it here

nournasser1234

I don't know what's the problem

Can you fix your script?


Re: Simple MySQL R39-3 v1.0 - Tenka - 05.12.2016

Can you put mysql_log(LOG_ALL); and post mysql_log.txt please