stock SalvarPlayer(playerid) { if(DOF2_FileExists(ReturnFileUser(playerid))) { DOF2_SetInt(ReturnFileUser(playerid),"Level",GetPlayerScore(playerid)); DOF2_SetInt(ReturnFileUser(playerid),"Dinheiro",GetPlayerMoney(playerid)); DOF2_SetInt(ReturnFileUser(playerid),"Admin Level",PlayerDados[playerid][pAdmin]); DOF2_SetInt(ReturnFileUser(playerid),"Skin",GetPlayerSkin(playerid)); DOF2_SetInt(ReturnFileUser(playerid),"VIP", PlayerDados[playerid][pVIP]); DOF2_SetInt(ReturnFileUser(playerid),"Emprego", PlayerDados[playerid][pEmprego]); DOF2_SetInt(ReturnFileUser(playerid),"Organizaзгo", PlayerDados[playerid][pOrganizacao]); DOF2_SetInt(ReturnFileUser(playerid),"Cargo", PlayerDados[playerid][pCargo]); DOF2_SaveFile(); } } stock CarregarPlayer(playerid) { if(DOF2_FileExists(ReturnFileUser(playerid))) { SetPlayerScore(playerid, DOF2_GetInt(ReturnFileUser(playerid), "Level")); SetPlayerMoney(playerid, DOF2_GetInt(ReturnFileUser(playerid), "Dinheiro")); PlayerDados[playerid][pAdmin] = DOF2_GetInt(ReturnFileUser(playerid),"Admin Level"); SetPlayerSkin(playerid, DOF2_GetInt(ReturnFileUser(playerid),"Skin")); PlayerDados[playerid][pVIP] = DOF2_GetInt(ReturnFileUser(playerid),"VIP"); PlayerDados[playerid][pEmprego] = DOF2_GetInt(ReturnFileUser(playerid),"Emprego"); PlayerDados[playerid][pOrganizacao] = DOF2_GetInt(ReturnFileUser(playerid),"Organizaзгo"); PlayerDados[playerid][pCargo] = DOF2_GetInt(ReturnFileUser(playerid),"Cargo"); } }
new Float:x,Float:y,Float:z; GetPlayerPos(playerid, x ,y ,z) DOF2_SetInt(ReturnFileUser(playerid),"x", x); DOF2_SetInt(ReturnFileUser(playerid),"y", y); DOF2_SetInt(ReturnFileUser(playerid),"z", z);
new Float:x,Float:y,Float:z; x = DOF2_GetInt(ReturnFileUser(playerid),"x"); y = DOF2_GetInt(ReturnFileUser(playerid),"y"); z = DOF2_GetInt(ReturnFileUser(playerid),"z"); SetPlayerPos(playerid,x,y,z);
adiciona isto
para salvar Код:
new Float:x,Float:y,Float:z; GetPlayerPos(playerid, x ,y ,z) DOF2_SetInt(ReturnFileUser(playerid),"x", x); DOF2_SetInt(ReturnFileUser(playerid),"y", y); DOF2_SetInt(ReturnFileUser(playerid),"z", z); Код:
new Float:x,Float:y,Float:z; x = DOF2_GetInt(ReturnFileUser(playerid),"x"); y = DOF2_GetInt(ReturnFileUser(playerid),"y"); z = DOF2_GetInt(ReturnFileUser(playerid),"z"); SetPlayerPos(playerid,x,y,z); |
stock CarregarPlayer(playerid) { if(DOF2_FileExists(ReturnFileUser(playerid))) { SetPlayerScore(playerid, DOF2_GetInt(ReturnFileUser(playerid), "Level")); SetPlayerMoney(playerid, DOF2_GetInt(ReturnFileUser(playerid), "Dinheiro")); PlayerDados[playerid][pAdmin] = DOF2_GetInt(ReturnFileUser(playerid),"Admin Level"); SetPlayerSkin(playerid, DOF2_GetInt(ReturnFileUser(playerid),"Skin")); PlayerDados[playerid][pVIP] = DOF2_GetInt(ReturnFileUser(playerid),"VIP"); PlayerDados[playerid][pEmprego] = DOF2_GetInt(ReturnFileUser(playerid),"Emprego"); PlayerDados[playerid][pOrganizacao] = DOF2_GetInt(ReturnFileUser(playerid),"Organizaзгo"); PlayerDados[playerid][pCargo] = DOF2_GetInt(ReturnFileUser(playerid),"Cargo"); PosX = DOF2_GetInt(ReturnFileUser(playerid),"PosX"); PosY = DOF2_GetInt(ReturnFileUser(playerid),"PosY"); PosZ = DOF2_GetInt(ReturnFileUser(playerid),"PosZ"); SetPlayerPos(playerid,PosX,PosY,PosZ); } }
Basicamente vocк salva as coordenadas quando deslogar, e carrega quando logar.
Dк uma olhada neste meu filterscript. |
Ele nгo quer salvar a data da ъltima conexгo do jogador... Ele quer salvar as coordenadas e quando o jogador se conectar, enviar ele de voltar para o lugar em que ele se desconectou.
|