Death system
#1

Can you help me to fix this it has some errors i want to set if player health reaches x then it will apply animation and then start losing health and die but in this time player can do /service ems and /accept death i have example code.

pawn Код:
forward health(playerid);
public health(playerid)
{
if(GetPlayerHealth(playerid,health) <= 1)
{
new Float:health;
SetPlayerHealth(playerid,1.00);
TogglePlayerControllable(playerid,false);
GameTextForPlayer(playerid,"Type /accept to accept your Death");
}
}

public OnPlayerConnect(playerid,blablabla)
{
SetTimerEx("health",1000,true,"i",playerid);
}

pubic onplayercommandtext(playerid, blablabla)
{
if(strcmp("/accept",cmdtext,true) == 0)
{
SetPlayerHealth(playerid,0);
SendClientMessage(playerid,0xAA3333AA,"You died because you accepted your death");
SetPlayerPos(YOUR CO _ ORDS);
}
}
return 1;
I am also getting this error please fix too
pawn Код:
public function lacks forward declaration (symbol "health")
Reply
#2

Try this one.
pawn Код:
public OnPlayerUpdate(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid,health);
    if(health < 30.0) {
        TogglePlayerControllable(playerid,0);
        ApplyAnimation(playerid,"CRACK","crckdeth2",4.0,0,0,0,1,1,1);
    }
    return 1;
}


pubic OnPlayerCommandText(playerid, blablabla)
{
    if(strcmp("/accept",cmdtext,true) == 0) {
        SetPlayerHealth(playerid,0);
        SendClientMessage(playerid,0xAA3333AA,"You died because you accepted your death");
        SetPlayerPos(YOUR CO _ ORDS);
    }
    return 1;
}
Reply
#3

thanks its working but how about set health fulll it in while this animation and start losing health?
Reply
#4

The code above will just make your server lag as hell. Its better to check it with a timer onplayerupdate, and not direcly put it there.
Reply
#5

Why do u guys copy ideass?!!!!!
Reply
#6

Humans have same brain so i can think same idea so its mine.
Reply
#7

My text is spaming how to put text that you are injured
Reply
#8

Quote:
Originally Posted by kingchandio
Посмотреть сообщение
Humans have same brain so i can think same idea so its mine.
I copy ur script ok...Humans have same brain i also made same script like u and ur server mine....

LOL...Dont give a retarded reply.......U can have ur own idea......
Reply
#9

you have health as a function and a variable which you can't have
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)