Player bleeding
#1

Hello, I've asked before about a bleeding system. I have the ideas, but I simply need some help to make them realistic.

I'm trying to learn some of the basics of scripting, and together with that I had an idea for a bleeding system. The idea was that when the players health got below.. let's say 30 - then a timer would start, and he would start loosing health until he gets /heal'ed or gets to a sprunk and get his health over 30. If he of course gets it over 30, it'll stop. I suppose I have to somehow make it check "OnPlayerUpdate" if his health starts to go below 30 and then it should implement the timer which will make him loose health, let's say every 10-15 second.

Could someone provide me with some code, and explain how It'll work? Or can someone give me some tips on how to get started.
Reply
#2

I'm really sorry but i can't provide any Code as i am also in a learning stage within the part of "OnPlayerUpdate".
But i suggest you start on browsing for some Filterscripts which is similar or which has OnPlayerUpdate that gets the persons ARMOR or.. Speaking of that lemme get a link of a FS i know..

https://sampforum.blast.hk/showthread.php?pid=1010610#pid1010610
There
Reply
#3

hi create a timer and check the health and do some process..
Reply
#4

like
pawn Код:
SetTimerEx("bleedchk",10000,1,"d",playerid) //on playerconnect
forward bleedchk(playerid);
public bleedchk(playerid)
{
new float:hp;
 GetPlayerHealth(playerid,hp);
if(hp<=30)
SetPlayerHealth(playerid,hp-5);
SendClientMessage(playerid,0xFFFFF,"You are bleeding");
}
Reply
#5

Quote:
Originally Posted by Harish
Посмотреть сообщение
like
pawn Код:
SetTimerEx("bleedchk",10000,1,"d",playerid) //on playerconnect
forward bleedchk(playerid);
public bleedchk(playerid)
{
new float:hp;
GetPlayerHealth(playerid,hp);
if(hp<=30)
SetPlayerHealth(playerid,hp-5);
SendClientMessage(playerid,0xFFFFF,"You are bleeding");
}
By the way umm Thread Starter,
SetTimerEx("bleedchk",10000,1,"d",playerid) - Thats 10 Seconds.
Reply
#6

Ugh, Everyone's Too Quick fo' Me

@Harish Thanks for Helping this Member

What Harish Said Will Work,

Bassically Setting a Timer,
Using a Forward to Drop the Health Based on the Timer
The Time Format is in Milliseconds, I'd Think You'd Know.
Код:
600000 = 60 Minutes
Cheers,

Ezay \o/
Reply
#7

I'm starting to understand the basics behind it, thank you I'll try to play around with the code and see if I can get it to work Much appreciate the help from all of you
Reply
#8

If you Have Any Issues, Feel Free to Post Back Here Again.

Cheers

Ezay \o/
Reply
#9

I get

Код:
C:\Users\Christoffer\Documents\Modtagne filer\samp03\samp03\gamemodes\NGRP_nomysql.pwn(7797) : warning 213: tag mismatch
I get that warning from the code
Reply
#10

Thats Fine, Warnings, Dont Really Matter (With That Said They CAN DO WEIRD THINGS TO YOUR SCRIPT)

Tag Mismatch Usually Means That a Tag is in the Wronge Place
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)