Checkpoint problem
#4

Oh btw, I'm trying to make something like this. There are 2 teams, Player 1 & Player 2 is in Red team. The objective of the Red team is to rob the bank. It takes 6 seconds for the Red team members to be in the checkpoint for the rob to be success.

This is the situation, if player 1 is in the checkpoint, the robbing timer will run like normal , and if player 2 enter the checkpoint, it will automaticly send Player 2 a message, "Another player is already robbing the bank!" and Player 2 can't rob the bank(kill the timer for player 2 only) unless Player 1 leave the checkpoint.

This is my some of script:

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	new playername [MAX_PLAYER_NAME];
	GetPlayerName (playerid, playername, sizeof(playername));
  	if(gTeam[playerid] == TEAM_RED)
 	{
	new newtext[60], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(newtext, sizeof(newtext), "%s is now robbing the bank.", playername);
        SendClientMessageToAll(RED, newtext);
        BlowTimer = SetTimerEx("bombcountupdate", 6000, false, "i", playerid);
	}
    return 1;
}
/* ----------------------------------------------------------------------------------- */
public OnPlayerLeaveCheckpoint(playerid)
{
	new playername [MAX_PLAYER_NAME];
	GetPlayerName (playerid, playername, sizeof(playername));
  	if(gTeam[playerid] == TEAM_RED)
 	{
	new newtext[60], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(newtext, sizeof(newtext), "%s has stopped robbing the bank.", playername);
        SendClientMessageToAll(RED, newtext);
	KillTimer(BlowTimer);
	}
    return 1;
}
Hope that someone will help me with this thing.
Reply


Messages In This Thread
Checkpoint problem - by Min - 30.12.2011, 06:53
Re: Checkpoint problem - by coole210 - 30.12.2011, 08:58
Re: Checkpoint problem - by Min - 30.12.2011, 14:41
Re: Checkpoint problem - by Min - 31.12.2011, 12:50

Forum Jump:


Users browsing this thread: 1 Guest(s)