19.05.2017, 21:37
Quote:
Ok, so look at this code:
Код:
function SaveAccountStats(playerid) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); PlayerInfo[playerid][Skin] = GetPlayerSkin(playerid); PlayerInfo[playerid][Cartera] = GetPlayerMoney(playerid); new Float:x, 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_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]); INI_WriteInt(File,"Faccion",PlayerInfo[playerid][Faccion]); INI_WriteInt(File,"Rango",PlayerInfo[playerid][Rango]); INI_WriteInt(File,"Payday",PlayerInfo[playerid][Payday]); INI_WriteInt(File,"Respeto",PlayerInfo[playerid][Respeto]); INI_WriteInt(File,"Nivel",PlayerInfo[playerid][Nivel]); 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_WriteInt(File,"Accent",PlayerInfo[playerid][pAccent]); INI_WriteInt(File,"Sexo",PlayerInfo[playerid][Sexo]); INI_WriteInt(File,"Edad",PlayerInfo[playerid][Edad]); INI_WriteInt(File,"Skin",PlayerInfo[playerid][Skin]); INI_WriteInt(File,"Cartera",PlayerInfo[playerid][Cartera]); INI_Close(File); new INI:Archivo = INI_Open(UserCars(playerid)); INI_SetTag(Archivo,"Vehicles"); INI_WriteInt(Archivo,"Vehicle1",PlayerCars[playerid][pVehicle1]); INI_WriteInt(Archivo,"Vehicle1Model",PlayerCars[playerid][pVehicle1Model]); INI_WriteFloat(Archivo,"Vehicle1X",PlayerCars[playerid][pVehicle1X]); INI_WriteFloat(Archivo,"Vehicle1Y",PlayerCars[playerid][pVehicle1Y]); INI_WriteFloat(Archivo,"Vehicle1Z",PlayerCars[playerid][pVehicle1Z]); INI_WriteFloat(Archivo,"Vehicle1C",PlayerCars[playerid][pVehicle1C]); INI_WriteInt(Archivo,"Vehicle1Color1",PlayerCars[playerid][pVehicle1Color1]); INI_WriteInt(Archivo,"Vehicle1Color2",PlayerCars[playerid][pVehicle1Color2]); INI_WriteInt(Archivo,"Vehicle1Value",PlayerCars[playerid][pVehicle1Value]); INI_WriteString(Archivo,"Vehicle1Plate",PlayerCars[playerid][pVehicle1Plate]); INI_WriteInt(Archivo,"Vehicle1Lock",PlayerCars[playerid][pVehicle1Lock]); INI_WriteInt(Archivo,"Vehicle2",PlayerCars[playerid][pVehicle2]); INI_WriteInt(Archivo,"Vehicle2Model",PlayerCars[playerid][pVehicle2Model]); INI_WriteFloat(Archivo,"Vehicle2X",PlayerCars[playerid][pVehicle2X]); INI_WriteFloat(Archivo,"Vehicle2Y",PlayerCars[playerid][pVehicle2Y]); INI_WriteFloat(Archivo,"Vehicle2Z",PlayerCars[playerid][pVehicle2Z]); INI_WriteFloat(Archivo,"Vehicle2C",PlayerCars[playerid][pVehicle2C]); INI_WriteInt(Archivo,"Vehicle2Color1",PlayerCars[playerid][pVehicle2Color1]); INI_WriteInt(Archivo,"Vehicle2Color2",PlayerCars[playerid][pVehicle2Color2]); INI_WriteInt(Archivo,"Vehicle2Value",PlayerCars[playerid][pVehicle2Value]); INI_WriteString(Archivo,"Vehicle2Plate",PlayerCars[playerid][pVehicle2Plate]); INI_WriteInt(Archivo,"Vehicle2Lock",PlayerCars[playerid][pVehicle2Lock]); INI_WriteInt(Archivo,"Vehicle3",PlayerCars[playerid][pVehicle3]); INI_WriteInt(Archivo,"Vehicle3Model",PlayerCars[playerid][pVehicle3Model]); INI_WriteFloat(Archivo,"Vehicle3X",PlayerCars[playerid][pVehicle3X]); INI_WriteFloat(Archivo,"Vehicle3Y",PlayerCars[playerid][pVehicle3Y]); INI_WriteFloat(Archivo,"Vehicle3Z",PlayerCars[playerid][pVehicle3Z]); INI_WriteFloat(Archivo,"Vehicle3C",PlayerCars[playerid][pVehicle3C]); INI_WriteInt(Archivo,"Vehicle3Color1",PlayerCars[playerid][pVehicle3Color1]); INI_WriteInt(Archivo,"Vehicle3Color2",PlayerCars[playerid][pVehicle3Color2]); INI_WriteInt(Archivo,"Vehicle3Value",PlayerCars[playerid][pVehicle3Value]); INI_WriteString(Archivo,"Vehicle3Plate",PlayerCars[playerid][pVehicle3Plate]); INI_WriteInt(Archivo,"Vehicle3Lock",PlayerCars[playerid][pVehicle3Lock]); INI_Close(Archivo); return 1; } Код:
UserPath(playerid) Код:
UserCars(playerid) Код:
public LoadUser_data(playerid,name[],value[]) Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); Код:
UserCars(playerid) Have I lost you? Now to correct this you should add Код:
if(fexist(UserPath(playerid))) { new string[128]; format(string, sizeof(string), "{FFFFFF}Welcome {00CF00}%s{FFFFFF}. \nEnter your password below:",RPName(playerid)); INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); INI_ParseFile(UserCars(playerid), "LoadCars_%s", .bExtra = true, .extra = playerid); //I added this ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Server - Login",string,"Login","Exit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Server - Register","Enter a new password to create a new account:","Register","Exit"); } } Код:
forward LoadUser_data(playerid,name[],value[]); public LoadUser_data(playerid,name[],value[]) { INI_Int("Password",PlayerInfo[playerid][pPass]); INI_Int("Admin",PlayerInfo[playerid][pAdmin]); INI_Int("Faccion",PlayerInfo[playerid][Faccion]); INI_Int("Rango",PlayerInfo[playerid][Rango]); INI_Int("Payday",PlayerInfo[playerid][Payday]); INI_Int("Respeto",PlayerInfo[playerid][Respeto]); INI_Int("Nivel",PlayerInfo[playerid][Nivel]); INI_Float("Pos_x",PlayerInfo[playerid][pPos_x]); INI_Float("Pos_y",PlayerInfo[playerid][pPos_y]); INI_Float("Pos_z",PlayerInfo[playerid][pPos_z]); INI_Int("Accent",PlayerInfo[playerid][pAccent]); INI_Int("Sexo",PlayerInfo[playerid][Sexo]); INI_Int("Edad",PlayerInfo[playerid][Edad]); INI_Int("Skin",PlayerInfo[playerid][Skin]); INI_Int("Cartera",PlayerInfo[playerid][Cartera]); return 1; } forward LoadCars_Vehicles(playerid, name[], value[]); public LoadCars_Vehicles(playerid, name[], value[]) { INI_Int("Vehicle1",PlayerCars[playerid][pVehicle1]); INI_Int("Vehicle1Model",PlayerCars[playerid][pVehicle1Model]); INI_Float("Vehicle1X",PlayerCars[playerid][pVehicle1X]); INI_Float("Vehicle1Y",PlayerCars[playerid][pVehicle1Y]); INI_Float("Vehicle1Z",PlayerCars[playerid][pVehicle1Z]); INI_Float("Vehicle1C",PlayerCars[playerid][pVehicle1C]); INI_Int("Vehicle1Color1",PlayerCars[playerid][pVehicle1Color1]); INI_Int("Vehicle1Color2",PlayerCars[playerid][pVehicle1Color2]); INI_Int("Vehicle1Value",PlayerCars[playerid][pVehicle1Value]); INI_ParseFile("Vehicle1Plate",PlayerCars[playerid][pVehicle1Plate]); INI_Int("Vehicle1Lock",PlayerCars[playerid][pVehicle1Lock]); INI_Int("Vehicle2",PlayerCars[playerid][pVehicle2]); INI_Int("Vehicle2Model",PlayerCars[playerid][pVehicle2Model]); INI_Float("Vehicle2X",PlayerCars[playerid][pVehicle2X]); INI_Float("Vehicle2Y",PlayerCars[playerid][pVehicle2Y]); INI_Float("Vehicle2Z",PlayerCars[playerid][pVehicle2Z]); INI_Float("Vehicle2C",PlayerCars[playerid][pVehicle2C]); INI_Int("Vehicle2Color1",PlayerCars[playerid][pVehicle2Color1]); INI_Int("Vehicle2Color2",PlayerCars[playerid][pVehicle2Color2]); INI_Int("Vehicle2Value",PlayerCars[playerid][pVehicle2Value]); INI_ParseFile("Vehicle2Plate",PlayerCars[playerid][pVehicle2Plate]); INI_Int("Vehicle2Lock",PlayerCars[playerid][pVehicle2Lock]); INI_Int("Vehicle3",PlayerCars[playerid][pVehicle3]); INI_Int("Vehicle3Model",PlayerCars[playerid][pVehicle3Model]); INI_Float("Vehicle3X",PlayerCars[playerid][pVehicle3X]); INI_Float("Vehicle3Y",PlayerCars[playerid][pVehicle3Y]); INI_Float("Vehicle3Z",PlayerCars[playerid][pVehicle3Z]); INI_Float("Vehicle3C",PlayerCars[playerid][pVehicle3C]); INI_Int("Vehicle3Color1",PlayerCars[playerid][pVehicle3Color1]); INI_Int("Vehicle3Color2",PlayerCars[playerid][pVehicle3Color2]); INI_Int("Vehicle3Value",PlayerCars[playerid][pVehicle3Value]); INI_ParseFile("Vehicle3Plate",PlayerCars[playerid][pVehicle3Plate]); INI_Int("Vehicle3Lock",PlayerCars[playerid][pVehicle3Lock]); return 1; } |