for(new n = 0; n < sizeof(InformacionNegocio_); n ++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.5, InformacionNegocio_[n][nPosX], InformacionNegocio_[n][nPosY], InformacionNegocio_[n][nPosZ]))
{
if(!InformacionNegocio_[n][nPuerta]) return GameTextForPlayer(playerid, "~r~Cerrado", 500, 1);
if(InformacionJugador_[playerid][pAdmin] != 0 || InformacionNegocio_[n][nSQLID] != InformacionJugador_[playerid][pNegocio][0] && InformacionNegocio_[n][nSQLID] != InformacionJugador_[playerid][pNegocio][1] && InformacionNegocio_[n][nSQLID] != InformacionJugador_[playerid][pNegocio][2] && InformacionNegocio_[n][nSQLID] != InformacionJugador_[playerid][pNegocio][3])
{
if(GetPlayerMoney(playerid) < InformacionNegocio_[n][nPrecioEntrada]) return SendClientMessage(playerid, COLOR_ROJO, "* No tienes dinero suficiente para ingresar a este negocio.");
QuitarDineroPlayer_(playerid, InformacionNegocio_[n][nPrecioEntrada]);
}
new Query[126];
if(InformacionNegocio_[n][nDinero] < 50000)
{
InformacionNegocio_[n][nDinero] += InformacionNegocio_[n][nPrecioEntrada];
format(Query, sizeof(Query), "UPDATE ev_negocios SET nDinero = %d WHERE nSQLID = %d", InformacionNegocio_[n][nDinero], InformacionNegocio_[n][nSQLID]);
mysql_function_query(MySQL, Query, true, "OnQueryFinish_", "ii", 0, playerid);
}
CargarObjetos(playerid), InformacionJugador_[playerid][pEnNegocio] = n;
_SetPlayerPosEx(playerid, InformacionNegocio_[n][nIntX], InformacionNegocio_[n][nIntY], InformacionNegocio_[n][nIntZ], 0, InformacionNegocio_[n][nInterior], InformacionNegocio_[n][nSQLID]);
format(Query, sizeof(Query), "UPDATE ev_cuentas SET EnNegocio = %d WHERE Nombre = '%s'", InformacionNegocio_[n][nSQLID], NombreJugador(playerid));
mysql_function_query(MySQL, Query, true, "OnQueryFinish_", "ii", 0, playerid);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, InformacionNegocio_[n][nIntX], InformacionNegocio_[n][nIntY], InformacionNegocio_[n][nIntZ]) && InformacionNegocio_[n][nInterior] == GetPlayerInterior(playerid) && InformacionNegocio_[n][nSQLID] == GetPlayerVirtualWorld(playerid))
{
if(!InformacionNegocio_[n][nPuerta]) return GameTextForPlayer(playerid, "~r~Cerrado", 500, 1);
CargarObjetos(playerid), InformacionJugador_[playerid][pEnNegocio] = -1;
new Query[90];
format(Query, sizeof(Query), "UPDATE ev_cuentas SET EnNegocio = -1 WHERE Nombre = '%s'", NombreJugador(playerid));
mysql_function_query(MySQL, Query, true, "OnQueryFinish_", "ii", 0, playerid);
_SetPlayerPosEx(playerid, InformacionNegocio_[n][nPosX], InformacionNegocio_[n][nPosY],InformacionNegocio_[n][nPosZ], 0, 0, 0);
InformacionJugador_[playerid][pInterior] = 0, InformacionJugador_[playerid][pVirtualWorld] = 0;
return 1;
}
}
|
Estas guardando el world en el que se encuenta el jugador?? puede ser que al momento de conectarte el jugador aparesca en el world 0 y por eso no pasa nada
|
else if(IsPlayerInRangeOfPoint(playerid, 2.0, InformacionNegocio_[n][nIntX], InformacionNegocio_[n][nIntY], InformacionNegocio_[n][nIntZ]) && InformacionNegocio_[n][nInterior] == GetPlayerInterior(playerid) && InformacionNegocio_[n][nSQLID] == GetPlayerVirtualWorld(playerid)
|
Te explico, a la hora de que el jugador entre a un interior y desconecte, deberнa de guardar la ID & que estб dentro de un interior, para asн cuando conecte, este pueda salir tranquilamente.
|
|
Код:
else if(IsPlayerInRangeOfPoint(playerid, 2.0, InformacionNegocio_[n][nIntX], InformacionNegocio_[n][nIntY], InformacionNegocio_[n][nIntZ]) && InformacionNegocio_[n][nInterior] == GetPlayerInterior(playerid) && InformacionNegocio_[n][nSQLID] == GetPlayerVirtualWorld(playerid) |