SA-MP Forums Archive
please help meee!!!!!! - 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: please help meee!!!!!! (/showthread.php?tid=216333)



please help meee!!!!!! - tujituji1 - 25.01.2011

Hi all!!!

sorry if i posted in other direction, i dont know english very well.

I need help for my rp server!!!

When player has little health (for example: 15 or 10) he became cuted and he cant move. how can i do this for my server? (sorry for my bad english and thank you very much for help me).
tujituji1 is online now Report Post Edit/Delete Message


Re: please help meee!!!!!! - wups - 25.01.2011

Search the script for GetPlayerHealth.


Re: please help meee!!!!!! - jordy.kiesebrink - 27.01.2011

Hello..

What do you want? I don't understand what kind of script you wanna make

As far as i can understand.
you need a little FS or something when a player have 10 or 15 hp than he will be frozen (he can't move anymore)
is this what u need??

Kind Regards!
Jordy.Kiesebrink
[In-Game] [JJ]Jordy


Re: please help meee!!!!!! - tujituji1 - 17.02.2011

yes!!!!!!!!!!!1


Re: please help meee!!!!!! - AK47317 - 17.02.2011

he became cuted and froze? what the hell is that spose to mean?


Re: please help meee!!!!!! - jordy.kiesebrink - 17.02.2011

its been maded for you already


Re: please help meee!!!!!! - Sascha - 17.02.2011

At the top:
pawn Код:
new hfroze[MAX_PLAYERS];
forward HealthCheck();
At OnGameModeInit
pawn Код:
SetTimer("HealthCheck", 2000, true);
anywhere:
pawn Код:
public HealthCheck()
{
    new Float:health;
    for(new i=0; i<GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            if(hfroze[i] == 1)
            {
                GetPlayerHealth(i, health);
                SetPlayerHealth(i, health+2);
                if(health >= 15)
                {
                    TogglePlayerControllable(i, 1);
                    hfroze = 0;
                }
            }else{
                GetPlayerHealth(i, health);
                if(health < 15)
                {
                    hfroze = 1;
                    TogglePlayerControllable(i, 0);
                    SendClientMessage(i, 0x999999AA, "Wait until your health increased to over 15hp");
                }
            }
        }
    }
    return 1;
}
at OnPlayerConnect
pawn Код:
hfroze[playerid] = 0;
I hope that helped you and it works how you wanted it..
I just wrote it up so I don't know whether there is any error in it.. if there is, please tell me...

(you can also use SetTimerEx, but I wouldn't advice to do so..)