#include <a_samp>#include <dini> public OnPlayerSpawn(playerid){ new n[24],f[64]; GetPlayerName(playerid,n,24); format(f,64,\"Mentések/%s.ini\",n); if(dini_Exists(f)) { SetPlayerSkin(playerid,dini_Int(f,\"Skin\")); SetPlayerPos(playerid,dini_Float(f,\"Xpos\"),dini_Float(f,\"Ypos\"),dini_Float(f,\"Zpos\")); } return 1;}public OnPlayerDisconnect(playerid,reason){ new n[24],f[64],Float:X,Float:Y,Float:Z; GetPlayerName(playerid,n,24); format(f,64,\"Mentések/%s.ini\",n); dini_Create(f); dini_IntSet(f,\"Skin\",GetPlayerSkin(playerid)); GetPlayerPos(playerid,X,Y,Z); dini_FloatSet(f,\"Xpos\",X); dini_FloatSet(f,\"Ypos\",Y); dini_FloatSet(f,\"Zpos\",Z); return 1;}
És ha a játékos nem akarja menteni/betölteni?
#define MAX_PLAYER_NAME 24[/quote]
ahogy létrehoztad az n-t 24 karakterrel,oda MAX_PLAYER_NAME-t kell írni.vagyis:new n[MAX_PLAYER_NAME];
Rossz :/ OnPlayerSpawn alatt is. Nem hoz létre semmilyen filet. Errort nem ír, szerverbe is betettem.
#include <a_samp>#include <dini>new bool:ElsoBelepes[MAX_PLAYERS];public OnPlayerConnect(playerid){ ElsoBelepes[playerid] = true; return 1;} public OnPlayerSpawn(playerid){ if(ElsoBelepes[playerid]) { new n[24],f[64]; GetPlayerName(playerid,n,24); format(f,64,\"Mentések/%s.ini\",n); if(dini_Exists(f)) { SetPlayerSkin(playerid,dini_Int(f,\"Skin\")); SetPlayerPos(playerid,dini_Float(f,\"Xpos\"),dini_Float(f,\"Ypos\"),dini_Float(f,\"Zpos\")); } ElsoBelepes[playerid] = false; } return 1;}public OnPlayerDisconnect(playerid,reason){ new n[24],f[64],Float:X,Float:Y,Float:Z; GetPlayerName(playerid,n,24); format(f,64,\"Mentések/%s.ini\",n); dini_Create(f); dini_IntSet(f,\"Skin\",GetPlayerSkin(playerid)); GetPlayerPos(playerid,X,Y,Z); dini_FloatSet(f,\"Xpos\",X); dini_FloatSet(f,\"Ypos\",Y); dini_FloatSet(f,\"Zpos\",Z); return 1;}