Help with weapon bug
#1

Hello, well I got a problem on my server, that sometimes players weapons, after they relog wont save. I think I found out how this works and the problem is between the weapon saving system and skin selection(I Use Ladmin as my admin system).

Here is an example why I think it's caused

Код:
AddPlayerClass(106,1429.8060,-1843.7299,13.5469,359.0000,0,0,0,0,0,0);
That's how all my skin selection skins look like, so if a player has weapons and he logs in to his account and continues to scroll around the skin selection he will most likely lose his weapons because all of the skins are setted to 0 weapons, but if the player will chose a skin and then /login without scrolling anymore in the skin selection he will have his weapons.

This is the ladmin weapon saving system:

Код:
new weap0,ammo0,weap1, ammo1, weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5, weap6, ammo6;
	GetPlayerWeaponData(playerid,1,weap0,ammo0);// melee
	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)).("weap0",weap0); dUserSetINT(PlayerName2(playerid)).("weap0ammo",ammo0);
   	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);
If anybody could help me solve this problem I would be really thankful, if somebody wont understand the problem or I didn't explain well, ill try explain again.

p.s. I am pretty naby in scripting, never messed around myself with saving systems :P
Reply
#2

save the ladmin script somewhere else so you have it original.
then edit the remaining script as many as you can untill its fixed.
I think if you know where the poblem is, then you are real close to the dix

Edit: i meant fix lol XD
Reply
#3

This doesn't help me, knowing the problem doesn't give me scripting knowledge to fix it, I have no idea what should I actually change.
Reply
#4

it seems that the playerstats arent loaded so also not saved at login at screen selection. ( i just read your forum with bugreports)

Tellme..what happens if you just spawn and dont login ? does the ladmin script lets you die ?

PS: a simple way to fix this is forcing a player to login at connect.
this can be done by a login dialog that shows up at screen selection.
If you dont like the dialog then there might be other ways to force the player to login before scrolling first.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)