13.04.2012, 21:04
Galera eu tenho o sistema ladmin4v2 traduzido
so que tem um probrema quando eu fecho o servidor
ou quando o player saiu do jogo por caiu a conexao
ele nao salva, ele salva so quando ele sai do jogo com /q normal
aqui esta
meu stock save player
ele acontece o mesmo que acontece neste topico
https://sampforum.blast.hk/showthread.php?tid=303660
se alguem poder me ajuda ficarei grato e ajuderei com reputaзгo
so que tem um probrema quando eu fecho o servidor
ou quando o player saiu do jogo por caiu a conexao
ele nao salva, ele salva so quando ele sai do jogo com /q normal
aqui esta
meu stock save player
pawn Код:
SavePlayer(playerid)
{
dUserSetINT(PlayerName2(playerid)).("money",GetPlayerMoney(playerid));
dUserSetINT(PlayerName2(playerid)).("score",GetPlayerScore(playerid));
dUserSetINT(PlayerName2(playerid)).("estrelas",GetPlayerWantedLevel(playerid));
dUserSetINT(PlayerName2(playerid)).("kills",PlayerInfo[playerid][Kills]);
dUserSetINT(PlayerName2(playerid)).("deaths",PlayerInfo[playerid][Deaths]);
dUserSetINT(PlayerName2(playerid)).("gc",Ativado[playerid]);
new h, m, s;
TotalGameTime(playerid, h, m, s);
dUserSetINT(PlayerName2(playerid)).("hours", h);
dUserSetINT(PlayerName2(playerid)).("minutes", m);
dUserSetINT(PlayerName2(playerid)).("seconds", s);
new Float:x,Float:y,Float:z, interior;
GetPlayerPos(playerid,x,y,z); interior = GetPlayerInterior(playerid);
dUserSetINT(PlayerName2(playerid)).("x1",floatround(x));
dUserSetINT(PlayerName2(playerid)).("y1",floatround(y));
dUserSetINT(PlayerName2(playerid)).("z1",floatround(z));
dUserSetINT(PlayerName2(playerid)).("interior1",interior);
new weap1, ammo1, weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5, weap6, ammo6;
GetPlayerWeaponData(playerid,2,weap1,ammo1);// hand gun
GetPlayerWeaponData(playerid,3,weap2,ammo2);//shotgun
GetPlayerWeaponData(playerid,4,weap3,ammo3);// SMG
GetPlayerWeaponData(playerid,5,weap4,ammo4);// AK47 / M4
GetPlayerWeaponData(playerid,6,weap5,ammo5);// rifle
GetPlayerWeaponData(playerid,7,weap6,ammo6);// rocket launcher
dUserSetINT(PlayerName2(playerid)).("weap1",weap1); dUserSetINT(PlayerName2(playerid)).("weap1ammo",ammo1);
dUserSetINT(PlayerName2(playerid)).("weap2",weap2); dUserSetINT(PlayerName2(playerid)).("weap2ammo",ammo2);
dUserSetINT(PlayerName2(playerid)).("weap3",weap3); dUserSetINT(PlayerName2(playerid)).("weap3ammo",ammo3);
dUserSetINT(PlayerName2(playerid)).("weap4",weap4); dUserSetINT(PlayerName2(playerid)).("weap4ammo",ammo4);
dUserSetINT(PlayerName2(playerid)).("weap5",weap5); dUserSetINT(PlayerName2(playerid)).("weap5ammo",ammo5);
dUserSetINT(PlayerName2(playerid)).("weap6",weap6); dUserSetINT(PlayerName2(playerid)).("weap6ammo",ammo6);
new Float:health; GetPlayerHealth(playerid, Float:health);
new Float:armour; GetPlayerArmour(playerid, Float:armour);
new year,month,day; getdate(year, month, day);
new strdate[20]; format(strdate, sizeof(strdate), "%d.%d.%d",day,month,year);
new file[256]; format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) );
dUserSetINT(PlayerName2(playerid)).("health",floatround(health));
dUserSetINT(PlayerName2(playerid)).("armour",floatround(armour));
dini_Set(file,"LastOn",strdate);
dUserSetINT(PlayerName2(playerid)).("loggedin",0);
dUserSetINT(PlayerName2(playerid)).("TimesOnServer",(dUserINT(PlayerName2(playerid)).("TimesOnServer"))+1);
}
https://sampforum.blast.hk/showthread.php?tid=303660
se alguem poder me ajuda ficarei grato e ajuderei com reputaзгo