-RESOLVED- - 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: -RESOLVED- (
/showthread.php?tid=154135)
-RESOLVED- -
Lynn - 12.06.2010
-RESOLVED-
Re: [HELP] Code Not working. No clue why. -
Chris. - 12.06.2010
Hi,
Try this instead:
pawn Код:
forward DeathSystem();
public DeathSystem()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new Float:health;
GetPlayerHealth(i, health);
if(health < 10)
{
if(IsPlayerInAnyVehicle(i))
{
RemovePlayerFromVehicle(i);
}
TogglePlayerControllable(i, 0);
ApplyAnimation( i, "INT_HOUSE", "BED_Loop_R", 4.0, 1, 0, 0, 0, 0 );
ApplyAnimation( i, "INT_HOUSE", "BED_Loop_R", 4.0, 1, 0, 0, 0, 0 );
PulseSystem[i] = 1;
}
}
}
return 1;
}
I have edited where you had:
pawn Код:
new Float:health;
if(GetPlayerHealth(i, health) < 10)
{...
to:
pawn Код:
new Float:health;
GetPlayerHealth(i, health);
if(health < 10)
{...
I believe that should work now. I also removed the extra code under IsPlayerInAnyVehicle because that should still be called regardless underneath.
Re: [HELP] Code Not working. No clue why. -
Lynn - 12.06.2010
Nope. Don't work.
I had it like that, and then edited, and still wont work.
Re: [HELP] Code Not working. No clue why. -
DJDhan - 12.06.2010
Chris's code should work. What is the problem?
Re: [HELP] Code Not working. No clue why. -
yeswecanchange09 - 12.06.2010
How is DeathSystem being called? Have you added a timer for it?
Re: [HELP] Code Not working. No clue why. -
Lynn - 12.06.2010
When I set my HP to 10 or 9, Nothing happens.
Re: [HELP] Code Not working. No clue why. -
DJDhan - 12.06.2010
Quote:
Originally Posted by yeswecanchange09
How is DeathSystem being called? Have you added a timer for it?
|
You're right.
You should have a timer to call the function.
Код:
OnGameModeInit()
{
SetTimer("DeathSystem",2000,1);
return 1;
}
Re: [HELP] Code Not working. No clue why. -
Lynn - 12.06.2010
lol, That's it, I did this same thing before, so I knew my code was right(Before I posted)
But forgot I have to use a timer xD
Re: -RESOLVED- -
KnooL - 12.06.2010
Don't edit your post with 'resolved' it might be usefull for other people who have the same problem.
Re: -RESOLVED- -
Lynn - 13.06.2010
So they can look down at the replies. Which quoted this post.