Weapon Loading - 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: Weapon Loading (
/showthread.php?tid=404974)
Weapon Loading -
StuartD - 05.01.2013
Our weapon saving system works; However when the player relogs, the weapons don't load; I have checked the script and found its not giving them back their weapons; So I came about trying to fix;
This is what i have;
pawn Код:
PlayerInfo[playerid][pWeapon][0] = dini_Int(file, "wSlot0");
PlayerInfo[playerid][pWeaponAmmo][0] = dini_Int(file, "wSlot0Ammo");
// Me Trying To Fix ((Error Line - 1742))
GiveZaiatWeapon(playerid, pWeapon[0], pWeaponAmmo[0]);
pawn Код:
C:\Users\~\Desktop\BCRP29R641.pwn(1724) : error 028: invalid subscript (not an array or too many subscripts): "pWeapon"
C:\Users\~\Desktop\BCRP29R641.pwn(1724) : warning 215: expression has no effect
C:\Users\~\Desktop\BCRP29R641.pwn(1724) : error 001: expected token: ";", but found "]"
C:\Users\~\Desktop\BCRP29R641.pwn(1724) : error 029: invalid expression, assumed zero
C:\Users\~\Desktop\BCRP29R641.pwn(1724) : fatal error 107: too many error messages on one line
Any Ideas? If you need to see any more just yell :O
Re: Weapon Loading -
Grim_ - 05.01.2013
If you're loading the data into one array, you should use that array to give them the weapon! This isn't the case in your code.
Re: Weapon Loading -
StuartD - 05.01.2013
Erm... I have no Idea what you mean by that? Erm... Im a newbie :3 Erm...
Re: Weapon Loading -
Grim_ - 05.01.2013
You load the data into this array:
pawn Код:
PlayerInfo[playerid][pWeapon][0] = dini_Int(file, "wSlot0");
So, doesn't it make sense that you should give the player the weapon based off the information loaded (which is in that array)?
pawn Код:
GiveZaiatWeapon(playerid, PlayerInfo[playerid][pWeapon][0], PlayerInfo[playerid][pWeaponAmmo][0]);
Re: Weapon Loading -
StuartD - 05.01.2013
Quote:
Originally Posted by Grim_
You load the data into this array:
pawn Код:
PlayerInfo[playerid][pWeapon][0] = dini_Int(file, "wSlot0");
So, doesn't it make sense that you should give the player the weapon based off the information loaded (which is in that array)?
pawn Код:
GiveZaiatWeapon(playerid, PlayerInfo[playerid][pWeapon][0], PlayerInfo[playerid][pWeaponAmmo][0]);
|
Ty. I will try and get back to you