new Float:PosX;
new Float:PosY;
new Float:PosZ;
new Float:PosA;
new pVW;
new arquivo[40];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, 40,"Contas/%sInfos.ini",name);
if(DOF2_FileExists(arquivo)){
PosX = DOF2_GetFloat(arquivo, "PosX");
PosY = DOF2_GetFloat(arquivo, "PosY");
PosZ = DOF2_GetFloat(arquivo, "PosZ");
PosA = DOF2_GetFloat(arquivo, "PosA");
pVW = DOF2_GetInt(arquivo, "VirtualWorld");
SetPlayerPos(playerid, PosX,PosY,PosZ);
SetPlayerFacingAngle(playerid, PosA);
SetPlayerVirtualWorld(playerid,pVW);
}
else
{
DOF2_CreateFile(arquivo);
SetPlayerPos(playerid,1154.0786,-1768.2622,16.5938);
}
return 1;
}
new arquivo[40];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, 40,"Contas/%sInfos.ini",name);
GetPlayerPos(playerid, PosX,PosY,PosZ);
GetPlayerFacingAngle(playerid, PosA);
GetPlayerVirtualWorld(pVW);
if(DOF2_FileExists(arquivo)){
DOF2_SetFloat(arquivo,"PosX",PosX);
DOF2_SetFloat(arquivo,"PosY",PosY);
DOF2_SetFloat(arquivo,"PosZ",PosZ);
DOF2_SetFloat(arquivo,"PosA",PosA);
DOF2_SetInt(arquivo, "VirtualWorld", pVW);
DOF2_SaveFile();
}
return 1;
}
new arquivo[40];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, 40,"Contas/%sInfos.ini",name);
GetPlayerPos(playerid, PosX,PosY,PosZ);
GetPlayerFacingAngle(playerid, PosA);
if(DOF2_FileExists(arquivo)){
DOF2_SetFloat(arquivo,"PosX",PosX);
DOF2_SetFloat(arquivo,"PosY",PosY);
DOF2_SetFloat(arquivo,"PosZ",PosZ);
DOF2_SetFloat(arquivo,"PosA",PosA);
DOF2_SetInt(arquivo, "VirtualWorld",GetPlayerVirtualWorld(playerid));
DOF2_SaveFile();
}
return 1;
}
Tente :
PHP код:
|
new arquivo[40], name[MAX_PLAYER_NAME], MundoPlayer[MAX_PLAYERS];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, 40,"Contas/%sInfos.ini",name);
GetPlayerPos(playerid, PosX,PosY,PosZ);
GetPlayerFacingAngle(playerid, PosA);
MundoPlayer[playerid] = GetPlayerVirtualWorld(playerid);
if(DOF2_FileExists(arquivo)){
DOF2_SetFloat(arquivo,"PosX",PosX);
DOF2_SetFloat(arquivo,"PosY",PosY);
DOF2_SetFloat(arquivo,"PosZ",PosZ);
DOF2_SetFloat(arquivo,"PosA",PosA);
DOF2_SetInt(arquivo, "VirtualWorld", MundoPlayer[playerid]);
new arquivo[40];
new interior[MAX_PLAYER];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, 40,"Contas/%sInfos.ini",name);
GetPlayerPos(playerid, PosX,PosY,PosZ);
GetPlayerFacingAngle(playerid, PosA);
interior[playerid] = GetPlayerVirtualWorld(playerid);
if(DOF2_FileExists(arquivo)){
DOF2_SetFloat(arquivo,"PosX",PosX);
DOF2_SetFloat(arquivo,"PosY",PosY);
DOF2_SetFloat(arquivo,"PosZ",PosZ);
DOF2_SetFloat(arquivo,"PosA",PosA);
DOF2_SetInt(arquivo, "VirtualWorld",interior[playerid]);
DOF2_SaveFile();
}
return 1;
}
new Float:PosX;
new Float:PosY;
new Float:PosZ;
new Float:PosA;
new pVW;
new Float:PosX,
Float:PosY,
Float:PosZ,
Float:PosA,
pVW
;
Tenta assim
PHP код:
|
Veja agora :
PHP код:
e nгo precisa de declarar este monte de new PHP код:
PHP код:
|
Vocк verificou se o VirtualWorld que o player estб nгo й mesmo 0 ?, estou achando que seu player esta no VirtualWorld 0.
|
CMD:getmundo(playerid, params[])
{
#pragma unused params
new MundoPlayer, string[40];
MundoPlayer = GetPlayerVirtualWorld(playerid);
format(string, sizeof(string), "Mundo Virtual ID [ %d ]", MundoPlayer);
SendClientMessage(playerid, -1, string);
return 1;
}
public OnPlayerSpawn(playerid) {
new arquivo[40], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, sizeof(arquivo), "Contas/%sInfos.ini", name);
if(DOF2_FileExists(arquivo)) {
SetPlayerPos(playerid, DOF2_GetFloat(arquivo, "PosX"), DOF2_GetFloat(arquivo, "PosY"), DOF2_GetFloat(arquivo, "PosZ"));
SetPlayerFacingAngle(playerid, DOF2_GetFloat(arquivo, "PosA"));
SetPlayerVirtualWorld(playerid, DOF2_GetInt(arquivo, "VirtualWorld"));
} else {
DOF2_CreateFile(arquivo);
SetPlayerPos(playerid, 1154.0786, -1768.2622, 16.5938);
}
return 1;
}
public OnPlayerDisconnect(playerid) {
new arquivo[40], name[MAX_PLAYER_NAME], Float:PosX, Float:PosY, Float:PosZ, Float:PosA;
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, sizeof(arquivo), "Contas/%sInfos.ini", name);
GetPlayerPos(playerid, PosX, PosY, PosZ);
GetPlayerFacingAngle(playerid, PosA);
if(DOF2_FileExists(arquivo)) {
DOF2_SetFloat(arquivo, "PosX", PosX);
DOF2_SetFloat(arquivo, "PosY", PosY);
DOF2_SetFloat(arquivo, "PosZ", PosZ);
DOF2_SetFloat(arquivo, "PosA", PosA);
DOF2_SetInt(arquivo, "VirtualWorld", GetPlayerVirtualWorld(playerid));
DOF2_SaveFile();
}
return 1;
}
Vocк esta no mundo zero mesmo, por isso esta salvando id do mundo zero.
faзa um teste para verificar um exemplo usando zcmd PHP код:
|
new Float:PosX[MAX_PLAYERS],
Float:PosY[MAX_PLAYERS],
Float:PosZ[MAX_PLAYERS],
Float:PosA[MAX_PLAYERS],
MundoPlayer[MAX_PLAYERS],
pInterior[MAX_PLAYERS];
// == //
new arquivo[40];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, 40,"Contas/%sInfos.ini",name);
if(DOF2_FileExists(arquivo)){
PosX[playerid] = DOF2_GetFloat(arquivo, "PosX");
PosY[playerid] = DOF2_GetFloat(arquivo, "PosY");
PosZ[playerid] = DOF2_GetFloat(arquivo, "PosZ");
PosA[playerid] = DOF2_GetFloat(arquivo, "PosA");
MundoPlayer[playerid] = DOF2_GetInt(arquivo, "VirtualWorld");
SetPlayerPos(playerid, PosX[playerid],PosY[playerid],PosZ[playerid]);
SetPlayerFacingAngle(playerid, PosA[playerid]);
SetPlayerVirtualWorld(playerid,MundoPlayer[playerid]);
SetPlayerInterior(playerid, pInterior[playerid]);
}
else
{
DOF2_CreateFile(arquivo);
SetPlayerPos(playerid,1154.0786,-1768.2622,16.5938);
}
// == //
return 1;
}
//---//
new arquivo[40];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(arquivo, 40,"Contas/%sInfos.ini",name);
GetPlayerPos(playerid, PosX[playerid],PosY[playerid],PosZ[playerid]);
GetPlayerFacingAngle(playerid, PosA[playerid]);
MundoPlayer[playerid] = GetPlayerVirtualWorld(playerid);
pInterior[playerid] = GetPlayerInterior(playerid);
if(DOF2_FileExists(arquivo)){
DOF2_SetFloat(arquivo,"PosX",PosX[playerid]);
DOF2_SetFloat(arquivo,"PosY",PosY[playerid]);
DOF2_SetFloat(arquivo,"PosZ",PosZ[playerid]);
DOF2_SetFloat(arquivo,"PosA",PosA[playerid]);
DOF2_SetInt(arquivo, "VirtualWorld", MundoPlayer[playerid]);
DOF2_SetInt(arquivo, "Interior", pInterior[playerid]);
DOF2_SaveFile();
}
//---//
return 1;
}
Agora nгo tem para onde correr se estiver marcando VirtualWorld como 0 й porque ele estб no VirtualWorld 0 !
PHP код:
|