Armour is always saved as 1 - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Armour is always saved as 1 (
/showthread.php?tid=257184)
Armour is always saved as 1 -
Osviux - 24.05.2011
I added this to the save command:
Код:
new Float:armours;
dini_IntSet(file,"Armour",GetPlayerArmour(playerid,armours));
But for some reason the armour is always saved as 1.
It looks like this in the .ini file:
Does anyone know whats wrong?
Re: Armour is always saved as 1 -
dud - 24.05.2011
for float you need dini_FloatSet not dini_IntSet
this will work
Quote:
new Float:armours;
dini_FloatSet(file,"Armour",GetPlayerArmour(player id,armours));
|
Re: Armour is always saved as 1 -
Jeffry - 24.05.2011
@dud: Yes, but the function has to be outside the dini_FloatSet
pawn Код:
new Float:armours;
GetPlayerArmour(playerid,armours)
dini_FloatSet(file,"Armour",armours);
Cheers.
Re: Armour is always saved as 1 -
Elka_Blazer - 24.05.2011
Well , You can set it as integer.
pawn Код:
new Float:HP;
GetPlayerHealth(playerid,HP);
new round = floatround(HP);