SA-MP Forums Archive
Death system - 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: Death system (/showthread.php?tid=276587)



Death system - kingchandio - 14.08.2011

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")



Re: Death system - Darnell - 14.08.2011

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;
}



Re: Death system - kingchandio - 14.08.2011

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


Re: Death system - Markx - 14.08.2011

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.


Re: Death system - -RaZoR- - 14.08.2011

Why do u guys copy ideass?!!!!!


Re: Death system - kingchandio - 14.08.2011

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


Re: Death system - kingchandio - 14.08.2011

My text is spaming how to put text that you are injured


Re: Death system - -RaZoR- - 15.08.2011

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......


Re: Death system - cessil - 15.08.2011

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