Jump to content
  • 0

pomoc Ukladanie pozície Dini Interior Bug


DavoSk

Dotaz

Ahoj mám problém z ukladaním pozície z dini vysvetlím.

Ak som na ulici,mimo interioru ukladanie pozície mi funguje bez problémou, ale ak vojdem do nejakého interieru a disconnectnem sa vnom napríklad v Cluckin Bellu a zasa sa pripojím budem sice v tom istom interieri ako som sa odpojil ale: 1. nevidno checkpoint 2. neni tam npc

3 ak vinde z interieru ocitnem sa na úplne inom mieste ako som doňho vošiel. Mám aj ukladanie GetPlayerInterior aj GetPlayerVirtualWorld

float mam na x y z. Dakujem za pomoc :),mam aj najnovšiu verziu Dini

Mám to takto:

 

public OnPlayerDisconnect(playerid, reason)

{

new file[128], pname[MAX_PLAYER_NAME];

new Float:x, Float:y, Float:z;

GetPlayerName(playerid, pname, sizeof(pname));

format(file, sizeof(file), "\\data\\%s.ini", pname);//leader the name of your folder in scriptfiles

if(!dini_Exists(file))

dini_Create(file);

dini_IntSet(file, "vworld", GetPlayerVirtualWorld(playerid));

dini_IntSet(file, "inter", GetPlayerInterior(playerid));

dini_IntSet(file, "money", GetPlayerMoney(playerid));

dini_IntSet(file, "skin", GetPlayerSkin(playerid));

GetPlayerPos(playerid, x, y, z);

dini_FloatSet(file, "posX", x);

dini_FloatSet(file, "posY", y);

dini_FloatSet(file, "posZ", z);

return 1;

}

 

public OnPlayerSpawn(playerid)

{

new Float:x, Float:y, Float:z;

new file[128], pname[MAX_PLAYER_NAME];

GetPlayerName(playerid, pname, sizeof(pname));

format(file, sizeof(file), "\\data\\%s.ini", pname);

if(dini_Exists(file))

{

SetPlayerVirtualWorld(playerid, dini_Int(file, "vworld"));

SetPlayerInterior(playerid, dini_Int(file, "inter"));

GivePlayerMoney(playerid, dini_Int(file, "money"));

SetPlayerSkin(playerid, dini_Int(file, "skin"));

x = dini_Float(file, "posX");

y = dini_Float(file, "posY");

z = dini_Float(file, "posZ");

SetPlayerPos(playerid, x, y, z);

}

if(!dini_Exists(file))

{

SetPlayerPos(playerid, 704.0370, -1673.5077, 3.4375);

}

return 1;

}

Link to comment
Share on other sites

0 odpovědí na tuto otázku

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...