CALLBACK: OnQueryFinish_(resultid, extraid, ConnectionHandle)
{
new
Rows, Field;
if(resultid != 0)
{
cache_get_data(Rows, Field);
}
switch(resultid)
{
case 1:
{
new
content[20];
if(Rows == 1)
{
cache_get_field_content(0, "SQLID", content); PlayerInfo[extraid][pSQLID] = strval(content);
cache_get_field_content(0, "Edad", content); PlayerInfo[extraid][pEdad] = strval(content);
cache_get_field_content(0, "Dinero", content); PlayerInfo[extraid][pDinero] = strval(content);
cache_get_field_content(0, "Registrado", content); PlayerInfo[extraid][pRegistrado] = strval(content);
cache_get_field_content(0, "Skin", content); PlayerInfo[extraid][pSkin] = strval(content);
cache_get_field_content(0, "Negocio", content); PlayerInfo[extraid][pNegocio] = strval(content);
cache_get_field_content(0, "Casa", content); PlayerInfo[extraid][pCasa] = strval(content);
cache_get_field_content(0, "Sexo", content); PlayerInfo[extraid][pSexo] = strval(content);
cache_get_field_content(0, "Nivel", content); PlayerInfo[extraid][pNivel] = strval(content);
cache_get_field_content(0, "Vida", content); PlayerInfo[extraid][pVida] = floatstr(content);
cache_get_field_content(0, "Chaleco", content); PlayerInfo[extraid][pChaleco] = floatstr(content);
cache_get_field_content(0, "PosX", content); PlayerInfo[extraid][pPosX] = floatstr(content);
cache_get_field_content(0, "PosY", content); PlayerInfo[extraid][pPosY] = floatstr(content);
cache_get_field_content(0, "PosZ", content); PlayerInfo[extraid][pPosZ] = floatstr(content);
SetSpawnInfo(extraid, 0, PlayerInfo[extraid][pSkin], PlayerInfo[extraid][pPosX], PlayerInfo[extraid][pPosY], PlayerInfo[extraid][pPosZ], 1.0, -1, -1, -1, -1, -1, -1);
SetPlayerScore(extraid, PlayerInfo[extraid][pNivel]), SetPlayerArmour(extraid, PlayerInfo[extraid][pChaleco]), SetPlayerInterior(extraid, PlayerInfo[extraid][pInterior]);
SetPlayerHealth(extraid, PlayerInfo[extraid][pVida]), GivePlayerMoney(extraid, PlayerInfo[extraid][pDinero]), SetPlayerVirtualWorld(extraid, PlayerInfo[extraid][pVirtualWorld]);
SpawnPlayer(extraid), SpawnJugador[extraid] = 1;
}
else if(!Rows)
{
}
}
case 2:
{
if(Rows)
{
cache_get_field_content(0, "Contraseсa", PlayerInfo[extraid][pPassword]);
new
string[186];
format(string, 186, ""#CBLANCO"Bienvenido(a) "#CVERDE"%s.\n\n"#CBLANCO"Tu cuenta estб registrada en nuestra base de datos, Ingrese su contraseсa:", NombreJugador(extraid));
ShowPlayerDialog(extraid, DIALOG_INGRESO, DIALOG_STYLE_PASSWORD, ""#CAZUL"Login", string, "Ingresar","Cancelar");
PlayAudioStreamForPlayer(extraid, "https://dl.dropboxusercontent.com/s/ogdhx4lf6f1b9j7/IntroSpanishRol.mp3"), LimpiarConsola(extraid, 30);
}
else if(!Rows)
{
new
string[186];
format(string, 186, ""#CBLANCO"Bienvenido(a) "#CVERDE"%s.\n\n"#CBLANCO"Tu cuenta no esta registrada en nuestra base de datos, Ingresa una contraseсa:", NombreJugador(extraid));
ShowPlayerDialog(extraid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, ""CAZUL"Registro", string, "Registrar","Cancelar");
LimpiarConsola(extraid, 30);
}
}
case 3:
{
cache_get_data(Rows, Field, TuberiaMYSQL);
if(Rows)
{
for(new i; i < Rows; i++)
{
new
content[20], Query[80];
format(Query, sizeof(Query), "SELECT nSQLID FROM ev_negocios ORDER BY nSQLID DESC");
mysql_function_query(TuberiaMYSQL, Query, true, "OnQueryFinish_", "i", 0);
cache_get_field_content(i, "nSQLID", content); NegocioInfo[i][nSQLID] = strval(content);
cache_get_field_content(i, "nNombre", NegocioInfo[i][nNombre]);
cache_get_field_content(i, "nPosX", content); NegocioInfo[i][nPosX] = floatstr(content);
cache_get_field_content(i, "nPosY", content); NegocioInfo[i][nPosY] = floatstr(content);
cache_get_field_content(i, "nPosZ", content); NegocioInfo[i][nPosZ] = floatstr(content);
cache_get_field_content(i, "nIntX", content); NegocioInfo[i][nIntX] = floatstr(content);
cache_get_field_content(i, "nIntY", content); NegocioInfo[i][nIntY] = floatstr(content);
cache_get_field_content(i, "nIntZ", content); NegocioInfo[i][nIntZ] = floatstr(content);
cache_get_field_content(i, "nInterior", content); NegocioInfo[i][nInterior] = strval(content);
cache_get_field_content(i, "nIntExt", content); NegocioInfo[i][nIntExt] = strval(content);
cache_get_field_content(i, "nVirtualWorld", content); NegocioInfo[i][nVirtualWorld] = strval(content);
cache_get_field_content(i, "nEstado", content); NegocioInfo[i][nEstado] = strval(content);
cache_get_field_content(i, "nPropietario", NegocioInfo[i][nPropietario]);
cache_get_field_content(i, "nPrecio", content); NegocioInfo[i][nPrecio] = strval(content);
cache_get_field_content(i, "nPrecioEntrada", content); NegocioInfo[i][nPrecioEntrada] = strval(content);
cache_get_field_content(i, "nPuerta", content); NegocioInfo[i][nPuerta] = strval(content);
cache_get_field_content(i, "nCambios", content); NegocioInfo[i][nCambios] = strval(content);
cache_get_field_content(i, "nDinero", content); NegocioInfo[i][nDinero] = strval(content);
cache_get_field_content(i, "nNivel", content); NegocioInfo[i][nNivel] = strval(content);
NegocioInfo[i][nPickup] = CreatePickup(1272, 1, NegocioInfo[i][nPosX], NegocioInfo[i][nPosY], NegocioInfo[i][nPosZ]);
NegocioInfo[i][nTexto] = CreateDynamic3DTextLabel("", COLOR_BLANCO, NegocioInfo[i][nPosX], NegocioInfo[i][nPosY], NegocioInfo[i][nPosZ], 5.0);
ActualizarTextoNegocio(i), TotalNegocios = Rows;
}
printf("*- Se han cargado un total de %d negocios.", Rows);
}
else if(!Rows)
{
print("*- No se ha cargado ningъn negocio.");
}
}
case 4:
{
cache_get_data(Rows, Field, TuberiaMYSQL);
if(Rows)
{
for(new i; i < Rows; i++)
{
new
content[20], Query[80];
format(Query, sizeof(Query), "SELECT cSQLID FROM ev_casas ORDER BY cSQLID DESC");
mysql_function_query(TuberiaMYSQL, Query, true, "OnQueryFinish", "i", 0);
cache_get_field_content(i, "cSQLID", content);CasaInfo[i][cSQLID] = strval(content);
cache_get_field_content(i, "cPosX", content);CasaInfo[i][cPosX] = floatstr(content);
cache_get_field_content(i, "cPosY", content);CasaInfo[i][cPosY] = floatstr(content);
cache_get_field_content(i, "cPosZ", content);CasaInfo[i][cPosZ] = floatstr(content);
cache_get_field_content(i, "cIntX", content);CasaInfo[i][cIntX] = floatstr(content);
cache_get_field_content(i, "cIntY", content);CasaInfo[i][cIntY] = floatstr(content);
cache_get_field_content(i, "cIntZ", content);CasaInfo[i][cIntZ] = floatstr(content);
cache_get_field_content(i, "Precio", content);CasaInfo[i][cPrecio] = strval(content);
cache_get_field_content(i, "cInterior", content);CasaInfo[i][cInterior] = strval(content);
cache_get_field_content(i, "cVirtualWorld", content);CasaInfo[i][cVirtualWorld] = strval(content);
cache_get_field_content(i, "cPuerta", content);CasaInfo[i][cPuerta] = strval(content);
cache_get_field_content(i, "cPropietario", CasaInfo[i][cPropietario]);
cache_get_field_content(i, "cDescripcion", CasaInfo[i][cDescripcion]);
cache_get_field_content(i, "cEstado", content);CasaInfo[i][cEstado] = strval(content);
cache_get_field_content(i, "cMirX", content);CasaInfo[i][cMirX] = floatstr(content);
cache_get_field_content(i, "cMirY", content);CasaInfo[i][cMirY] = floatstr(content);
cache_get_field_content(i, "cMirZ", content);CasaInfo[i][cMirZ] = floatstr(content);
cache_get_field_content(i, "cMirA", content);CasaInfo[i][cMirA] = floatstr(content);
if(CasaInfo[i][cEstado] == 0)
{
CasaInfo[i][cPickup] = CreateDynamicPickup(1273, 1, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]);
}
else if(CasaInfo[i][cEstado] == 1)
{
CasaInfo[i][cPickup] = CreateDynamicPickup(19522, 1, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]);
}
TotalCasas = Rows;
}
printf("*- Se han cargado un total de %d propiedades.", Rows);
}
else if(!Rows)
{
print("*- No se ha cargado ninguna propiedad.");
}
}
}
return 1;
}
|
Deberнas aprender algo por lo menos y no estar sacando script de otros gamemode sin saber algo no se..
https://sampforum.blast.hk/showthread.php?tid=262796 |
echo Executing Server Config... lanmode 0 rcon_password olakase123 maxplayers 50 port 7777 hostname SA-MP 0.3 Server gamemode0 bare 1 filterscripts announce 0 chatlogging 0 plugins mysql.dll crashdetect.dll streamer.dll Whirlpool.dll sscanf.dll weburl www.sa-mp.com onfoot_rate 40 incar_rate 40 weapon_rate 40 stream_distance 300.0 stream_rate 1000 maxnpc 0 logtimeformat [%H:%M:%S] language English
` ---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [20:30:31] filterscripts = "" (string) [20:30:31] [20:30:31] Server Plugins [20:30:31] -------------- [20:30:31] Loading plugin: crashdetect.dll [20:30:31] CrashDetect v4.15.1 is OK. [20:30:31] Loaded. [20:30:31] Loading plugin: mysql.dll [20:30:31] > MySQL plugin R7 successfully loaded. [20:30:31] Loaded. [20:30:31] Loading plugin: streamer.dll [20:30:31] *** Streamer Plugin v2.6.1 by Incognito loaded *** [20:30:31] Loaded. [20:30:31] Loading plugin: Whirlpool.dll [20:30:31] [20:30:31] ================== [20:30:31] [20:30:31] Whirlpool loaded [20:30:31] [20:30:31] ================== [20:30:31] [20:30:31] Loaded. [20:30:31] Loading plugin: sscanf.dll [20:30:31] [20:30:31] =============================== [20:30:31] sscanf plugin loaded. [20:30:31] Version: 2.8.1 [20:30:31] © 2012 Alex "******" Cole [20:30:31] =============================== [20:30:31] Loaded. [20:30:31] Loaded 5 plugins. [20:30:31] [20:30:31] Filterscripts [20:30:31] --------------- [20:30:31] Loaded 0 filterscripts. [20:30:31] OnGameo [20:30:31] onfoot_rate = 40 (int, read-only) [20:30:31] incar_rate = 40 (int, read-only) [20:30:31] weapon_rate = 40 (int, read-only) [20:30:31] Iniciando conexiуn MySQL: (Servidor: 'localhost', Usuario: 'root', Clave: '', Base de Datos: 'Plufase') [20:30:31] Conexiуn a la base de datos realizada correctamente. [20:30:31] [20:30:31] [20:30:31] ------------------------------------------- [20:30:31] **Initiating Gamemode [20:30:31] * Loading AMX... [20:30:31] * Welcome to Puflase Roleplay [20:30:31] ------------------------------------------- [20:30:31] [20:30:31] [20:30:31] Number of vehicle models: 0 [20:30:31] *- No se ha cargado ningъn negocio. [20:30:31] *- Se han cargado un total de 1 propiedades. [20:31:02] [connection] 127.0.0.1:51282 requests connection cookie. [20:31:03] [connection] incoming connection: 127.0.0.1:51282 id: 0 [20:31:03] [join] Iara_Anderson has joined the server (0:127.0.0.1)
|
Tienes algun mysql_log.txt en la carpeta del server? Si lo tienes mustralo, si no pon mysql_debug(1); en OnGameModeInit, prende el server y debe crear el mysql_log
|
[21:14:04] >> mysql_connect(localhost, root, professu, ******) on port 3306 [21:14:04] CMySQLHandler::CMySQLHandler() - constructor called. [21:14:04] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "professu" | Username: "root" [21:14:04] CMySQLHandler::Connect() - Connection was successful. [21:14:04] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [21:14:04] >> mysql_ping( Connection handle: 1 ) [21:14:04] CMySQLHandler::Ping() - Connection is still alive. [21:14:04] >> mysql_query_callback( Connection handle: 1 ) [21:14:04] >> mysql_query_callback( Connection handle: 1 ) [21:14:04] Passing query SELECT * FROM ev_negocios | ii [21:14:04] ProcessQueryThread(OnQueryFinish_) - Query was successful. (SELECT * FROM negocios) [21:14:04] ProcessQueryThread(OnQueryFinish_) - Data caching enabled. [21:14:04] CMySQLHandler::StoreResult() - Result was stored. [21:14:04] CMySQLHandler::FreeResult() - Result was successfully free'd. [21:14:04] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick() [21:14:04] OnQueryFinish_(ii) - Threaded function called. [21:14:04] >> cache_get_data( Connection handle: 1 ) [21:14:04] >> cache_get_data( Connection handle: 1 ) [21:14:04] ProcessTick() - The cache has been cleared. [21:14:04] Passing query SELECT * FROM ev_casas | ii [21:14:04] ProcessQueryThread(OnQueryFinish_) - Query was successful. (SELECT * FROM ev_casas) [21:14:04] ProcessQueryThread(OnQueryFinish_) - Data caching enabled. [21:14:04] CMySQLHandler::StoreResult() - Result was stored. [21:14:04] CMySQLHandler::FreeResult() - Result was successfully free'd. [21:14:04] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick() [21:14:04] OnQueryFinish_(ii) - Threaded function called. [21:14:04] >> cache_get_data( Connection handle: 1 ) [21:14:04] >> cache_get_data( Connection handle: 1 ) [21:14:04] >> mysql_query_callback( Connection handle: 1 ) [21:14:04] ProcessTick() - The cache has been cleared. [21:14:04] Passing query SELECT cSQLID FROM ev_casas ORDER BY cSQLID DESC | i [21:14:04] ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT cSQLID FROM casas ORDER BY cSQLID DESC) [21:14:04] ProcessQueryThread(OnQueryFinish) - Data caching enabled. [21:14:04] CMySQLHandler::StoreResult() - Result was stored. [21:14:04] CMySQLHandler::FreeResult() - Result was successfully free'd. [21:14:04] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()