save - 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: save (
/showthread.php?tid=69485)
save -
thuron - 18.03.2009
hello,
i've got a saving system, but now i want to save my health.
ive got this but i get a target mismatch on this line:
Код:
dini_IntSet(udb_encode(playername), "health", health);
on top if my script i have:
and in onplayerdisconnect i have this:
Код:
health = GetPlayerHealth(playerid, health);
together with the error line i gave you.
in my onplayercommandtext on /register i have:
Код:
health = GetPlayerHealth(playerid, health);
and
Код:
dini_IntSet(udb_encode(playername), "health", 100);
and those DO work, but the other one doesn't .... how can i fix this
Re: save -
Badger(new) - 20.03.2009
try
Код:
dini_IntSet(udb_encode(playername), "health", strval(health));
see if that works.
Re: save -
Kinetic - 20.03.2009
Health is not a string therefor strval wont work. You need to use floatstr.
pawn Код:
dini_IntSet(udb_encode(playername), "health", floatstr(health));