SA-MP Forums Archive
Not Giving Saved Weapons - 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: Not Giving Saved Weapons (/showthread.php?tid=407171)



Not Giving Saved Weapons - nmader - 12.01.2013

Basically in my saving system for weapons and such the weapons are saving just fine; however when I return IG to get them I cannot, they are simply not loading, here is the code that I have under OnPlayerSpawn:

Код:
GivePlayerWeapon(playerid, Player[playerid][Weapon1], Player[playerid][Ammo1]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon2], Player[playerid][Ammo2]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon3], Player[playerid][Ammo3]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon4], Player[playerid][Ammo4]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon5], Player[playerid][Ammo5]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon6], Player[playerid][Ammo6]);
	GivePlayerWeapon(playerid, Player[playerid][Weapon7], Player[playerid][Ammo7]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon8], Player[playerid][Ammo8]);
	GivePlayerWeapon(playerid, Player[playerid][Weapon9], Player[playerid][Ammo9]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon10], Player[playerid][Ammo10]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon11], Player[playerid][Ammo11]);
    GivePlayerWeapon(playerid, Player[playerid][Weapon12], Player[playerid][Ammo12]);
I am truly stumped, especially being I know it is saving properly!


Re: Not Giving Saved Weapons - Infinity90 - 12.01.2013

When you disconnect have you viewed your account that it says: WeaponX = WeaponID | AmmoX = Ammo ?


Re: Not Giving Saved Weapons - nmader - 12.01.2013

Quote:
Originally Posted by Infinity90
Посмотреть сообщение
When you disconnect have you viewed your account that it says: WeaponX = WeaponID | AmmoX = Ammo ?
Yes, I have. That is how I know that it is saving properly and that it is merely the loading portion.


Re: Not Giving Saved Weapons - Infinity90 - 12.01.2013

Where is this code located (Under what callback ?)


Re: Not Giving Saved Weapons - nmader - 12.01.2013

Quote:
Originally Posted by Infinity90
Посмотреть сообщение
Where is this code located (Under what callback ?)
For giving the weapons I have it under the OnPlayerSpawn callback.


Re: Not Giving Saved Weapons - Infinity90 - 12.01.2013

The code above looks fine, try putting it at the top of OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
//here
Maybe something is obstructing it to move on (skipping parts)


Re: Not Giving Saved Weapons - nmader - 12.01.2013

Quote:
Originally Posted by Infinity90
Посмотреть сообщение
The code above looks fine, try putting it at the top of OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
//here
Maybe something is obstructing it to move on (skipping parts)
It's on the top as is. :/


Re: Not Giving Saved Weapons - Infinity90 - 12.01.2013

I guess you can post your enum for the Weapon1 etc
Other then that I don't know. :/


Re: Not Giving Saved Weapons - nmader - 13.01.2013

I have narrowed down the situation, the situation being that the weapons are not being loaded properly.

I know this being I had made a Print command for if a weapon was found, to find it was not found within the system, even though the save file is saying it was. I am most likely missing a line within the saving system in order for it to load the stats the are on that line into the enumeration.