[HELP] timers
#1

Like im buildin a CP
And at onplayerentercheckpoint how to make if checkpoint entered like in 5 mins SendClientMessage(playerid,RED,"Hello world");

If you want you can help me better via xfire
xfire:zomg2
Reply
#2

So your goal is to send a message after 5 minutes in that CP?
Reply
#3

use "SetTimerEx"
visit https://sampwiki.blast.hk/wiki/SetTimerEx for more help
Reply
#4

Nope born
My goal is to have a cp, and player has 5 mins to get there to have that text
if he reaches after 5 mins appear a message sayin you loose
and i didnt understand that wiki SetTimerEx
Reply
#5

LIL help?
Reply
#6

Here, I'll show you an example:

Put this under OnGameModeInit:

pawn Код:
new bool:PlayerInGame[MAX_PLAYERS] = false;
Then when you want the player's 5 minute timer to start put this:

pawn Код:
SetTimerEx("GameOver", 300000, false, "d", playerid);
PlayerInGame[playerid] = true;
Then your OnPlayerEnter Checkpoint should look something like this:

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(PlayerInGame[playerid])
    {
        SendClientMessage(i, AAD_COLOR_RED, "Well done You have made it before the 5 minutes!!");
        /// Do Something here
    }
    else
    {
        SendClientMessage(i, AAD_COLOR_RED, "You're too late!");
    }
    return 1;
}
and put this somewhere in your script (outside any commands and callbacks), like right at the bottom of your script:

pawn Код:
public GameOver(playerid)
{
    SendClientMessage(playerid, 0xFF8080FF, "Game Over Bitch - You're 5 Minutes are up, too bad :P");
    PlayerInGame[playerid] = false;
    //// Do Something here to punish the player or whatever when his time is up.
    return 1;
}

Reply
#7

Thanks dude.
Ima study that!
Reply
#8

Wow wow wowowowo
I got errors after errors
please help via teamviewer
but add xfire zomg2
so i can give teamviewer data!
Reply
#9

what errors do you have post the error lines along with the errors or give me your msn. No Xfire
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)