18.12.2015, 21:36
Estou com um problema no salvamento do meus dados.. quando reconecta o player nasce com a skin 0 na posiзгo 0 do GTA (x=0,y=0,z=0,a=0)
Meu codigo
Meu codigo
Quote:
stock SalvarPlayer(playerid) { GetPlayerName(playerid, Nome, sizeof(Nome)); GetPlayerPos(playerid,CoordX[playerid],CoordY[playerid],CoordZ[playerid]); GetPlayerFacingAngle(playerid,CoordA[playerid]); format(String, sizeof(String), CONTAS, Nome); DOF2_SetInt(String, "Dinheiro", GetPlayerMoney(playerid)); DOF2_SetInt(String, "Skin", GetPlayerSkin(playerid)); DOF2_SetInt(String, "Procurado", GetPlayerWantedLevel(playerid)); DOF2_SetInt(String, "CoordInt", GetPlayerInterior(playerid)); DOF2_SetFloat(String, "CoordX", CoordX[playerid]); DOF2_SetFloat(String, "CoordY", CoordY[playerid]); DOF2_SetFloat(String, "CoordZ", CoordZ[playerid]); DOF2_SetFloat(String, "CoordA", CoordA[playerid]); DOF2_SetInt(String, "Segundos", PlayerInfo[playerid][pSegundos]); DOF2_SetInt(String, "Score", PlayerInfo[playerid][pScore]); DOF2::SaveFile(); return true; } stock CarregarPlayer(playerid) { GetPlayerName(playerid, Nome, sizeof(Nome)); format(String, sizeof(String), CONTAS, Nome); GivePlayerMoney(playerid, DOF2_GetInt(String, "Dinheiro")); SetPlayerWantedLevel(playerid, DOF2_GetInt(String, "Procurado")); SetPlayerSkin(playerid, DOF2_GetInt(String, "Skin")); PlayerInfo[playerid][pSegundos] = DOF2_GetInt(String, "Segundos"); SetPlayerScore(playerid, DOF2_GetInt(String,"Score")); SetPlayerPos(playerid, DOF2_GetFloat(String, "CoordX"), DOF2_GetFloat(String, "CoordY"), DOF2_GetFloat(String, "CoordZ")); SetPlayerFacingAngle(playerid, DOF2_GetFloat(String, "CoordA")); SetPlayerInterior(playerid, DOF2_GetInt(String, "CoordInt")); DOF2::SaveFile(); return true; } public OnPlayerRequestClass(playerid, classid) { SetSpawnInfo( playerid, 0, DOF2_GetInt(String, "Skin"), DOF2_GetFloat(String, "CoordX"), DOF2_GetFloat(String, "CoordY"), DOF2_GetFloat(String, "CoordZ"), DOF2_GetFloat(String, "CoordA"), 0, 0, 0, 0, 0, 0 ); SpawnPlayer(playerid); return 1; } public OnPlayerRequestSpawn(playerid) { Kick(playerid); return 0; } |