SA-MP Forums Archive
Gun Saving - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gun Saving (/showthread.php?tid=467930)



Gun Saving - Sweez - 05.10.2013

Hello guys, i have an question. How can i make that when an player from my server leaves, his guns are saving ?


Re: Gun Saving - LoLeC - 05.10.2013

here is example for dini

OnPlayerDisconnect

Код:
new weap0, ammo0, weap1, ammo1, weap2, ammo2, weap3, ammo3,
weap4, ammo4, weap5, ammo5, weap6, ammo6, weap7, ammo7;
GetPlayerWeaponData(playerid,0,weap0,ammo0);
GetPlayerWeaponData(playerid,1,weap1,ammo1);
GetPlayerWeaponData(playerid,2,weap2,ammo2);
GetPlayerWeaponData(playerid,3,weap3,ammo3);
GetPlayerWeaponData(playerid,4,weap4,ammo4);
GetPlayerWeaponData(playerid,5,weap5,ammo5);
GetPlayerWeaponData(playerid,6,weap6,ammo6);
GetPlayerWeaponData(playerid,7,weap7,ammo7);
dini_IntSet(file, "Weapon0",weap0);
dini_IntSet(file, "Ammo0",ammo0);
dini_IntSet(file, "Weapon1",weap1);
dini_IntSet(file, "Ammo1",ammo1);
dini_IntSet(file, "Weapon2",weap2);
dini_IntSet(file, "Ammo2",ammo2);
dini_IntSet(file, "Weapon3",weap3);
dini_IntSet(file, "Ammo3",ammo3);
dini_IntSet(file, "Weapon4",weap4);
dini_IntSet(file, "Ammo4",ammo4);
dini_IntSet(file, "Weapon5",weap5);
dini_IntSet(file, "Ammo5",ammo5);
dini_IntSet(file, "Weapon6",weap6);
dini_IntSet(file, "Ammo6",ammo6);
dini_IntSet(file, "Weapon7",weap7);
dini_IntSet(file, "Ammo7",ammo7);
Login

Код:
GivePlayerWeapon(playerid,dini_Int(file,"Weapon0"),dini_Int(file,"Ammo0"));
GivePlayerWeapon(playerid,dini_Int(file,"Weapon1"),dini_Int(file,"Ammo1"));
GivePlayerWeapon(playerid,dini_Int(file,"Weapon2"),dini_Int(file,"Ammo2"));
GivePlayerWeapon(playerid,dini_Int(file,"Weapon3"),dini_Int(file,"Ammo3"));
GivePlayerWeapon(playerid,dini_Int(file,"Weapon4"),dini_Int(file,"Ammo4"));
GivePlayerWeapon(playerid,dini_Int(file,"Weapon5"),dini_Int(file,"Ammo5"));
GivePlayerWeapon(playerid,dini_Int(file,"Weapon6"),dini_Int(file,"Ammo6"));
GivePlayerWeapon(playerid,dini_Int(file,"Weapon7"),dini_Int(file,"Ammo7"));