SA-MP Forums Archive
Need help with menu. - 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: Need help with menu. (/showthread.php?tid=138812)



Need help with menu. - Mystique - 03.04.2010

So I made a menu for cluckingbell but when I buy something it is supposed to give more health. However, this one sets the players health to 10, how can I fix it?

Код:
new Float:health;
new currenthealth;
currenthealth = GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, currenthealth + 10);



Re: Need help with menu. - [MK]Soprano - 03.04.2010

This must work

new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health+25);


Re: Need help with menu. - Mystique - 03.04.2010

Quote:
Originally Posted by [MK
Soprano ]
This must work

new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health+25);

Код:
C:\Users\Broman\Desktop\gta\samp03asvr_win32\filterscripts\Roleplay1.pwn(9128) : error 017: undefined symbol "health"
C:\Users\Broman\Desktop\gta\samp03asvr_win32\filterscripts\Roleplay1.pwn(9142) : error 017: undefined symbol "health"
C:\Users\Broman\Desktop\gta\samp03asvr_win32\filterscripts\Roleplay1.pwn(9157) : error 017: undefined symbol "health"



Re: Need help with menu. - Last_Stand_Guardian - 03.04.2010

Have you written
pawn Код:
new Float:health
? :O

Are
pawn Код:
GetPlayerHealth
and
pawn Код:
SetPlayerHealth
in the same section in the script? :O

It doesn't seem so --> make
pawn Код:
new Float:health
a global variable (Top of the script) ^^ xD


Re: Need help with menu. - aircombat - 03.04.2010

use this :
Код:
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid,health+10);