29.04.2014, 19:08
hola perdoname por no ver tu respuesta hace dias q no me conecto.. este es mi codigo de guardado de posicion..
Te dejo el FS por las dudas...
https://www.mediafire.com/?2xvcv9ud7w7divm
Quote:
#include <YSIy_ini> #define PATH "/Users/%s.ini" #define COL_WHITE "{FFFFFF}" #define COL_RED "{F81414}" #define COL_GREEN "{00FF22}" #define COL_LIGHTBLUE "{00CED1}" FloatPos_x, FloatPos_y, FloatPos_z forward LoadUser_data(playerid,name[],value[]); public LoadUser_data(playerid,name[],value[]) { INI_Float("Pos_x",PlayerInfo[playerid][pPos_x]); INI_Float("Pos_y",PlayerInfo[playerid][pPos_y]); INI_Float("Pos_z",PlayerInfo[playerid][pPos_z]); return 1; } stock UserPath(playerid) { new string[128],playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playernam e)); format(string,sizeof(string),PATH,playername); return string; } stock udb_hash(buf[]) { new length=strlen(buf); new s1 = 1; new s2 = 0; new n; for (n=0; n<length; n++) { s1 = (s1 + buf[n]) % 65521; s2 = (s2 + s1) % 65521; } return (s2 << 16) + s1; } PlayerInfo[ playerid ][ pPos_x ] = 0.0; // asн PlayerInfo[ playerid ][ pPos_y ] = 0.0; // asн PlayerInfo[ playerid ][ pPos_z ] = 0.0; // asн if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); } return 1; } if(IsPlayerConnected(playerid)) { SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]); // aquн carga las variables e setea la posiciуn del jugador. } new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); new Float, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); PlayerInfo[playerid][pPos_x] = x; PlayerInfo[playerid][pPos_y] = y; PlayerInfo[playerid][pPos_z] = z; INI_WriteFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]); INI_WriteFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]); INI_WriteFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]); INI_Close(File); |
Te dejo el FS por las dudas...
https://www.mediafire.com/?2xvcv9ud7w7divm