Help please I am not sure
#1

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
Reply
#2

Try:
pawn Код:
Phealth = GetPlayerHealth(playerid);
Instead of:
pawn Код:
GetPlayerHealth(playerid, Phealth);
See if that helps.
Reply
#3

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
Reply
#4

WEll ma not that good at timers?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)