Help please I am not sure - 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: Help please I am not sure (
/showthread.php?tid=259614)
Help please I am not sure -
peterRook - 05.06.2011
So ye im gettin tag mismatch but im not sure whny
Quote:
#include <a_samp>
#define COLOR_RED 0xFF0000FF
public OnPlayerUpdate(playerid)
{
new float:Phealth;
GetPlayerHealth(playerid, Phealth);
if(Phealth<20)
{
ApplyAnimation(playerid,"CRACK","crckidle1",4.1,1, 0,0,0,1);
SendClientMessage(playerid, COLOR_RED, "You are dieing, You need a medic Please wait for a medic");
}
}
|
Quote:
C:\Users\pedro\Desktop\test.pwn(6) : warning 213: tag mismatch
C:\Users\pedro\Desktop\test.pwn(7) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
|
help please
Re: Help please I am not sure -
Stigg - 05.06.2011
Try:
pawn Код:
Phealth = GetPlayerHealth(playerid);
Instead of:
pawn Код:
GetPlayerHealth(playerid, Phealth);
See if that helps.
Re: Help please I am not sure -
Burridge - 05.06.2011
All this is, is because new float: isn't a capital F. It should be new Float:
pawn Код:
#include <a_samp>
#define COLOR_RED 0xFF0000FF
public OnPlayerUpdate(playerid){
new Float:Phealth;
GetPlayerHealth(playerid, Phealth);
if(Phealth < 20){
ApplyAnimation(playerid,"CRACK","crckidle1",4.1,1, 0,0,0,1);
SendClientMessage(playerid, COLOR_RED, "You are dieing, You need a medic Please wait for a medic");
}
}
Also, wouldn't it be better to use a timer, instead of OnPlayerUpdate for this? I mean the amount of times it gets called, it would cause lag if you get a lot of players.
Stigg: No. GetPlayerHealth has 2 parameters.
https://sampwiki.blast.hk/wiki/GetPlayerHealth
Re: Help please I am not sure -
peterRook - 05.06.2011
WEll ma not that good at timers?