Bien muestro cuando el jugador muere
Код:
if(GetPVarInt(playerid, "EventToken") == 0)
{
if(GetPVarInt(playerid, "IsInArena") == 0)
{
SetPVarInt(playerid, "Injured", 1);
SetPVarInt(playerid, "FirstSpawn", 2);
new Float:mX, Float:mY, Float:mZ;
GetPlayerPos(playerid, mX, mY, mZ);
SetPVarFloat(playerid, "MedicX", mX);
SetPVarFloat(playerid, "MedicY", mY);
SetPVarFloat(playerid, "MedicZ", mZ);
SetPVarInt(playerid, "MedicVW", GetPlayerVirtualWorld(playerid));
SetPVarInt(playerid, "MedicInt", GetPlayerInterior(playerid));
}
}
Esto es lo que guarda al morir
En OnPlayerSpawn yo uso una funciуn para cargar los datos del spawn.
llamada SetPlayerSpawn
Код:
if(IsPlayerConnected(playerid))
{
if(GetPVarInt(playerid, "FirstSpawn") == 2 && GetPVarInt(playerid, "Injured") == 1)
{
SendEMSQueue(playerid,1);
return 1;
}
if(GetPVarInt(playerid, "FirstSpawn") == 1 && GetPVarInt(playerid, "Hospital") != 0)
{
DeletePVar(playerid, "Hospital");
if(Info[playerid][pTypeSpawn] == 1)
{
ClearChatbox(playerid);
SendClientMessageEx(playerid, COLOR_LIGHTRED, "* Todas tus pertenencias ilegales han sido tomadas por la seguridad del hospital");
SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: Te llevaron a tu casa por la caracteristica Platinum activada.");
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(Info[playerid][pPhousekey] == i)
{
Streamer_UpdateEx(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
LoadObjects(playerid);
SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
GameTextForPlayer(playerid, "~w~Bienvenido a Casa", 5000, 1);
Info[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
Info[playerid][pVW] = i+6000;
SetPlayerVirtualWorld(playerid, i+6000);
}
}
return 1;
}
}
return 1;
}
Espero haberme explicado mejor. Esto pasa cuando ingreso al servidor por primera ves, me falto decir que esto me pasa en la mбquina (Host), en cambio en el localhost me carga perfecto. No se si es problema de lag o tambien hay algo mal en el cуdigo. Yo creo que tambien tiene que ver que no puede estar leyendo bien esta funciуn: "IsPlayerConnectedEx" entonces por eso pasa de largo todo el cуdigo.