checkpoint help please
#1

hello guys i need a help
i want to make a check point mission mmmm the server have 3 checkpoints
i mean to make an mission for team == 1
if player getin cp he will have evry second its give+1 hp only in the cp
and after 5 minutes the cp will end and player will get +1 score
and when the first cp will end after 10 minutes will be a next cp ... cp2
and this will be the same when player will get in cp he will have evry second +1 hp

please help
thanx for the helper
helper = king!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Reply
#2

Try this:

Код:
new timer; //Make sure this is global.
new checkpoint;

public OnPlayerEnterCheckpoint(playerid) {
	timer = SetTimerEx("addHealth", 100, true, "i" playerid);
        checkpoint = SetTimerEx("killCheckpoint", 5000, "i", 
	return 1;
}

forward addHealth(playerid);
public addHealth(playerid) {
    new Float:h;
    GetPlayerHealth(playerid, h);
    SetPlayerHealth(playerid, h + 1);
}
Then in an OnPlayerExitCheckpoint, just add in killTimer("timer");. Let me know if that works or not.

If you aren't sure how to make a checkpoint, take a look here: https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint

You can use SetTimerEx just like with the health to delay the destroying of that checkpoint you made (using DisablePlayerCheckpoint(playerid)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)