Will this work? - 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: Will this work? (
/showthread.php?tid=189423)
Will this work? -
[H]265 - 11.11.2010
pawn Код:
#define TakeHealth(%1,%2,%3) \
new \
Float:Health; \
GetPlayerHealth ( %1 , Health ); \
GivePlayerHealth ( %1 , Health - %3 );
I didn't test yet, but did i make this good?
Re: Will this work? -
Kwarde - 11.11.2010
If you wanna know it, try it out!
And I don't think it's gonna work, try this :P
pawn Код:
#define TakeHealth(%1,%2) \
new \
Float:Health; \
GetPlayerHealth ( %1 , Health ); \
GivePlayerHealth ( %1 , Health - %2 );
You didn't use the '%2' -.- - so I removed '%3' and replaced the othjer '%3' for '%2'
Re: Will this work? -
[H]265 - 11.11.2010
ok i find problem this code shoud be like this
pawn Код:
#define TakeHealth(%0,%1) \
do \
{ \
new \
Float:health; \
GetPlayerHealth ( %0 , health ) ; \
SetPlayerHealth ( %0 , health - %1 ) ; \
} \
while(FALSE)