SA-MP Forums Archive
[Help] Adding in an auto-crack system, more space for text. - 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)
+--- Thread: [Help] Adding in an auto-crack system, more space for text. (/showthread.php?tid=283741)



[Help] Adding in an auto-crack system, more space for text.[NOT SOLVED] - Da' J' - 16.09.2011

As you see in the title, i need a working, WORKING, auto-crack system for my server. I need some instructions how to add it, codes etc.

And another, how to add more space for the text's of my server? Ex. /me, /do, talking etc.


Re: [Help] Adding in an auto-crack system, more space for text. - Da' J' - 16.09.2011

Uhh.. Auto-crack when a player has like 20 HP or less.


Re: [Help] Adding in an auto-crack system, more space for text. - Srdjan - 16.09.2011

He probably wants that animation crack_(something) to apply when someone has health lower then 20.


Re: [Help] Adding in an auto-crack system, more space for text. - Da' J' - 16.09.2011

Quote:
Originally Posted by Srkki
Посмотреть сообщение
He probably wants that animation crack_(something) to apply when someone has health lower then 20.
Yep, this. An automatic /crack after a player reaches 20 or lower HP. Also, would be cool to make the cracked player unabled to be kill'd.


Re: [Help] Adding in an auto-crack system, more space for text. - =WoR=Varth - 16.09.2011

I found and FS related this.
You can create a new callback "OnPlayerHealthChange" with timer or "OnPlayerUpdate". To make the player unable to be killer, I guess "TogglePlayerControllable" can be used.


Re: [Help] Adding in an auto-crack system, more space for text. - System64 - 16.09.2011

in OnPlayerUpdate
foreach blabalbalballba
if(GetPlayerHealth[i] == 20)
{
//animation for /crack
}


Re: [Help] Adding in an auto-crack system, more space for text. - =WoR=Varth - 16.09.2011

Quote:
Originally Posted by System64
Посмотреть сообщение
in OnPlayerUpdate
foreach blabalbalballba
if(GetPlayerHealth[i] == 20)
{
//animation for /crack
}
You do that with loop in OnPlayerUpdate?
You must be crazy.


Re: [Help] Adding in an auto-crack system, more space for text. - DiiP - 16.09.2011

GetPlayerHealth(playerid,health);
if(health <= 29)
{
ApplyAnimationEx(playerid, "CRACK", "crckdeth2", 4.0, 0, 1, 1, 1, 1);
return 1;
}


- Here you go sir, no bugs.


Re: [Help] Adding in an auto-crack system, more space for text. - =WoR=Varth - 16.09.2011

Quote:
Originally Posted by DiiP
Посмотреть сообщение
GetPlayerHealth(playerid,health);
if(health <= 29)
{
ApplyAnimationEx(playerid, "CRACK", "crckdeth2", 4.0, 0, 1, 1, 1, 1);
return 1;
}


- Here you go sir, no bugs.
Then player just have to click left button mouse and walk away.


Re: [Help] Adding in an auto-crack system, more space for text. - Anzipane! - 16.09.2011

Quote:
Originally Posted by DiiP
Посмотреть сообщение
GetPlayerHealth(playerid,health);
if(health <= 29)
{
ApplyAnimationEx(playerid, "CRACK", "crckdeth2", 4.0, 0, 1, 1, 1, 1);
return 1;
}


- Here you go sir, no bugs.
That isn't much efficient, it will reapply the animation ~60 times/second per player...
You should use an array to check if he has already done the animation.