14.05.2011, 07:21
(
Последний раз редактировалось marrcko; 14.05.2011 в 10:06.
)
Hi everybody,
save don't get load
any help?
P.S. but PW has been checked well...
save don't get load
![Sad](images/smilies/sad.gif)
pawn Код:
public LoadData(playerid)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
INI_ParseFile(file, "load_user_data_%s", .bExtra = true, .extra = playerid);
return 1;
}
forward load_user_data_basic(playerid, name[], value[]);
forward load_user_data_gauja(playerid, name[], value[]);
public load_user_data_basic(playerid, name[], value[])
{
new suma,skin,taskai,interior, Float:x,Float:y,Float:z, gun[12],ammo[12];
INI_Int( "Password",kodas);
INI_Float("pos_X",z);
INI_Float("pos_Y",y);
INI_Float("pos_Z",z);
SetPlayerPos(playerid,x,y,z);
INI_Int("Interior",interior);
SetPlayerInterior(playerid,interior);
INI_Int("XP",taskai);
SetPlayerScore(playerid,taskai);
INI_Int("Level",PlayerInfo[playerid][pLevel]);
INI_Int("Money", suma);
GivePlayerMoneyA(playerid,suma);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Skin",skin);
SetPlayerSkin(playerid,skin);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("Accent",PlayerInfo[playerid][akcentas]);
INI_Int("Leader",gplayerDB[playerid][glead]);
INI_Int("GangId",gplayerDB[playerid][gangid]);
INI_Bool("Tier1",PlayerInfo[playerid][pTier1]);
INI_Bool("Tier2",PlayerInfo[playerid][pTier2]);
INI_Bool("Tier3",PlayerInfo[playerid][pTier3]);
INI_Bool("Moto",PlayerInfo[playerid][pMoto]);
INI_Int("Ginklas0",gun[0]);INI_Int("Ammo0",ammo[0]);
INI_Int("Ginklas1",gun[1]);INI_Int("Ammo1",ammo[1]);
INI_Int("Ginklas2",gun[2]);INI_Int("Ammo2",ammo[2]);
INI_Int("Ginklas3",gun[3]);INI_Int("Ammo3",ammo[3]);
INI_Int("Ginklas4",gun[4]);INI_Int("Ammo4",ammo[4]);
INI_Int("Ginklas5",gun[5]);INI_Int("Ammo5",ammo[5]);
INI_Int("Ginklas6",gun[6]);INI_Int("Ammo6",ammo[6]);
INI_Int("Ginklas7",gun[7]);INI_Int("Ammo7",ammo[7]);
INI_Int("Ginklas8",gun[8]);INI_Int("Ammo8",ammo[8]);
INI_Int("Ginklas9",gun[9]);INI_Int("Ammo9",ammo[9]);
INI_Int("Ginklas10",gun[10]);INI_Int("Ammo10",ammo[10]);
INI_Int("Ginklas11",gun[11]);INI_Int("Ammo11",ammo[11]);
for(new i; i<12;i++)
{
GivePlayerWeapon(playerid,gun[i],ammo[i]);
}
return 1;
}
pawn Код:
if (dialogid == 2)
{
new name[MAX_PLAYER_NAME], file[56];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "enter your password", "login", "quit");
LoadData(playerid);
if(udb_hash(inputtext) != kodas)
{
SendClientMessage(playerid,RAUDONA, "Password is incorrect.");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "enter your password", "login", "quit");
}
else
{
gPlayerLogged[playerid] = 1;
PlayerInfo[playerid][pNew] = 2;
SendClientMessage(playerid,ZALSVA, "[SYSTEM]: succesfully login!");
}
}