[GM] Basic MySQL GM

Započeo Joey_, Novembar 27, 2011, 20:23:43 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Citat: GeForce Vega poslato Januar 12, 2012, 01:43:31 PRE PODNE
Ovako, vidim pisete predobro itd, a ja se ne mogu spawnat, spawnam se al me kicka odmah sa servera. Provjerio sam kod, nema nikakve greške u njemu al opet me kickuje

Pisu zbog postova inace, barem vecina njih :)..

Ugl. provjeri pod: OnPlayerLogin, OnPlayerConnect, OnPlayerSpawn dal nesto 'ne blocka'.
Aequam memento rebus in arduis servare mentem.

Citat: LuKsA poslato Januar 12, 2012, 03:00:41 PRE PODNE
Citat: GeForce Vega poslato Januar 12, 2012, 01:43:31 PRE PODNE
Ovako, vidim pisete predobro itd, a ja se ne mogu spawnat, spawnam se al me kicka odmah sa servera. Provjerio sam kod, nema nikakve greške u njemu al opet me kickuje

Pisu zbog postova inace, barem vecina njih :)..

Ugl. provjeri pod: OnPlayerLogin, OnPlayerConnect, OnPlayerSpawn dal nesto 'ne blocka'.

Pogledao sam sve to odmah nakon sto sam vidjeo da me kicka...Ima kod loadanja iz MYSQL baze podatke one, ima Kick(playerid);

if(response)
{
tamo kod oko baze insert itd
}
else kick(playerid);
Mozda to?

Balkan Underground Ex. Head Administrator
Balkan Underground Ex. Elite Moderator


© Stefan_Misurovic, 2010. - 2014.



Izvinjavam se sto refresham staru temu,ali zanima me dali mog da koristim bazu sa Web Hosta ??
Imam unlimited baza i unlimited protoka.

Citat: AleX_ poslato Avgust 22, 2012, 19:59:47 POSLE PODNE
Moras imati i gamehost ako hoces preko webhosta
seres ko grlica

nemorate imat

Citat: Joey_ poslato Novembar 27, 2011, 20:23:43 POSLE PODNE
! Napomena !
Ovaj GM je namjenjen skripteri koji poznaju osnove MySQL-a. Ako ne znate osnove, a željeli biste ih naučiti, preporučam vam ovaj tutorial: [Tutorial] Making a MySQL system na engleskom ili [TUT] Pokretanje moda sa MYSQL-om na hrvatskom

procitaj tutove i vidit ces da nemora


Imam problem,znam da je tema starija al nmvz :D

Ubacio sam bazu na localhost preko xamppa,sve lepo radi,i sad pokrenem lepo samp_server.exe,udjem u igru,upisem lozinku za registraciju i odjednom mi samo ovo izbaci:



Direct Link: http://zaslike.com/files/04286h7ohh5w5icc1023.png

I samo treperi to i ubaguje sve.

Debug.txt:

[15:15:40] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "samp_server" | Username: "root" ...

[15:15:40] CMySQLHandler::Connect() - Connection was successful.

[15:15:40] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.

[15:27:16] >> mysql_format( Connection handle: 1 )

[15:27:16] CMySQLHandler::EscapeString(KOPRIVA); - Escaped 7 characters to KOPRIVA.

[15:27:16] >> mysql_query_callback( Connection handle: 1 )

[15:27:16] CMySQLHandler::Query("CheckUser") - Custom callback query with index 0 started (ExtraID: -1)

[15:27:16] CMySQLHandler::ProcessQueryThread(SELECT * FROM `users` WHERE `Username` = 'KOPRIVA' LIMIT 1) - Data is getting passed to CheckUser() - (Threadsafe: Yes)

[15:27:16] CheckUser(0,"SELECT * FROM `users` WHERE `Username` = 'KOPRIVA' LIMIT 1") - Called.

[15:27:16] >> mysql_store_result( Connection handle: 1 )

[15:27:16] CMySQLHandler::StoreResult() - Result was stored.

[15:27:16] >> mysql_num_rows( Connection handle: 1 )

[15:27:16] CMySQLHandler::NumRows() - Returned 0 row(s)

[15:27:16] >> mysql_free_result( Connection handle: 1 )

[15:27:16] CMySQLHandler::FreeResult() - Result was successfully free'd.

[15:27:23] >> mysql_format( Connection handle: 1 )

[15:27:23] CMySQLHandler::EscapeString(KOPRIVA); - Escaped 7 characters to KOPRIVA.

[15:27:23] CMySQLHandler::EscapeString(marko); - Escaped 5 characters to marko.

[15:27:23] >> mysql_query_callback( Connection handle: 1 )

[15:27:23] CMySQLHandler::Query("RegisterUser") - Custom callback query with index 0 started (ExtraID: -1)

[15:27:24] CMySQLHandler::ProcessQueryThread(INSERT INTO `users` (`Username`, `Password`, `Cash`) VALUES ('KOPRIVA', md5('marko'), 0)) - Data is getting passed to RegisterUser() - (Threadsafe: Yes)

[15:27:24] RegisterUser(0,"INSERT INTO `users` (`Username`, `Password`, `Cash`) VALUES ('KOPRIVA', md5('marko'), 0)") - Called.

[15:27:29] >> mysql_format( Connection handle: 1 )

[15:27:29] CMySQLHandler::EscapeString(KOPRIVA); - Escaped 7 characters to KOPRIVA.

[15:27:29] >> mysql_query_callback( Connection handle: 1 )

[15:27:29] CMySQLHandler::Query("SaveUser") - Custom callback query with index 0 started (ExtraID: -1)

[15:27:29] CMySQLHandler::ProcessQueryThread() - Error will be triggered to OnQueryError()

[15:28:02] >> mysql_format( Connection handle: 1 )

[15:28:02] CMySQLHandler::EscapeString(KOPRIVA); - Escaped 7 characters to KOPRIVA.

[15:28:02] >> mysql_query_callback( Connection handle: 1 )

[15:28:02] CMySQLHandler::Query("CheckUser") - Custom callback query with index 0 started (ExtraID: -1)

[15:28:02] CMySQLHandler::ProcessQueryThread(SELECT * FROM `users` WHERE `Username` = 'KOPRIVA' LIMIT 1) - Data is getting passed to CheckUser() - (Threadsafe: Yes)

[15:28:02] CheckUser(0,"SELECT * FROM `users` WHERE `Username` = 'KOPRIVA' LIMIT 1") - Called.

[15:28:02] >> mysql_store_result( Connection handle: 1 )

[15:28:02] CMySQLHandler::StoreResult() - Result was stored.

[15:28:02] >> mysql_num_rows( Connection handle: 1 )

[15:28:02] CMySQLHandler::NumRows() - Returned 1 row(s)

[15:28:02] >> mysql_free_result( Connection handle: 1 )

[15:28:02] CMySQLHandler::FreeResult() - Result was successfully free'd.

[15:28:09] >> mysql_format( Connection handle: 1 )

[15:28:09] CMySQLHandler::EscapeString(KOPRIVA); - Escaped 7 characters to KOPRIVA.

[15:28:09] CMySQLHandler::EscapeString(marko); - Escaped 5 characters to marko.

[15:28:09] >> mysql_query_callback( Connection handle: 1 )

[15:28:09] CMySQLHandler::Query("LoginUser") - Custom callback query with index 0 started (ExtraID: -1)

[15:28:09] CMySQLHandler::ProcessQueryThread(SELECT * FROM `users` WHERE `Username` = 'KOPRIVA' AND `Password` = md5('marko') LIMIT 1) - Data is getting passed to LoginUser() - (Threadsafe: Yes)

[15:28:09] LoginUser(0,"SELECT * FROM `users` WHERE `Username` = 'KOPRIVA' AND `Password` = md5('marko') LIMIT 1") - Called.

[15:28:09] >> mysql_store_result( Connection handle: 1 )

[15:28:09] CMySQLHandler::StoreResult() - Result was stored.

[15:28:09] >> mysql_num_rows( Connection handle: 1 )

[15:28:09] CMySQLHandler::NumRows() - Returned 1 row(s)

[15:28:09] >> mysql_fetch_row_format( Connection handle: 1 )

[15:28:09] CMySQLHandler::FetchRow() - Return: 3|KOPRIVA|c28aa76990994587b0e907683792297c|0

[15:28:09] >> mysql_free_result( Connection handle: 1 )

[15:28:09] CMySQLHandler::FreeResult() - Result was successfully free'd.

Izvinjavam se na svim glupostima i ako sam nekome napisao nesto lose, neko drugi je koristio moj profil!
__________________________________________
https://bk.gta.world - GTA World Balkan - RAGEMP

Dodaj si ovaj callback u skriptu i reci mi sto ce ti ispisat u konzolu:
public OnQueryError(errorid, error[], resultid, extraid, callback[], query[], connectionHandle)
{
printf("mySQL Error: ID: %d | Error: %s | Query: %s", erroid, error, query);
return 1;
}

Last nick: Paradox