Health
#1

What is wrong whit this ? , i want to freeze and send a message to players with 5 or - , why is not working ?

forward DamagedPlayer(playerid);
public DamagedPlayer(playerid)
{
new Float:health;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerHealth(playerid, health);
if(health == 5)
{
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_WHITE, "[Medic]: Nu mai ai Viata, Contacteaza un Medic(/call 911).");
}
return 1;
}
Reply
#2

pawn Код:
forward DamagedPlayer(playerid);
public DamagedPlayer(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(health < 6)
    {
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "[Medic]: Nu mai ai Viata, Contacteaza un Medic(/call 911).");
    }
    return 1;
}
Reply
#3

same is not working uhh
Reply
#4

Can you be more explicit? Errors when compile...?
Reply
#5

works you need to put it under public othertimer thx rep for trying to help me
Reply
#6

You have set the function, that's okay, but you forgot the callback which you are gonna use to call this callback:
You can use a timer , or you can use OnPlayerUpdate callback:
pawn Код:
public OnPlayerUpdate(playerid)
{
        new Float:health;
    GetPlayerHealth(playerid, health);
    if(health < 6)
    {
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, COLOR_WHITE, "[Medic]: Nu mai ai Viata, Contacteaza un Medic(/call 911).");
    }
    return 1;
OnPlayerUpdate is called every second, when player's stats are updated.

EDIT: nvm, late.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)