Timers
#1

How does this need to work?

When you go to x,y,z you type /plant which freezes you and it takes 60 seconds to plant a bomb.
When planted a Textdraw with a timer goes to all clients and it counts down from 35 seconds when reach 0 a
createexplosion happens. BUT if the bomb is /defuse the timers stop
Reply
#2

pawn Code:
if(!strcmp(cmdtext, "/plant", true))(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid, x, y, z);
{
SetTimerEx() //put ur times and other shit on here
}
return 1;
}
Then u have to forward ur timer and add /defuse command D just simple KillTimer(timerid); but remember rangepoints and other shits Im not very sure but I think it works if u get it
Reply
#3

Something like this?

You'll have to make the defuse CMD

pawn Code:
forward BombTimer(playerid);

COMMAND:plant(playerid, params[])
{
    new string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    if(!IsPlayerInRangeOfPoint(playerid,range,X , Y , Z)) return SendClientMessage(playerid, -1, "You can't plant a bomb here !");
    TogglePlayerControllable(playerid, 0);
    format(string, 128, "%s has planted a bomb !", pName);
    SendClientMessageToAll(-1, string);
    SetTimerEx( "BombTimer", 60000, false, "i", playerid);
    return 1;
}


public BombTimer(playerid)
{
    CreateExplosion(...);
    SendClientMessageToAll(-1, "The planted bomb exploded before it got defused !");
    return 1;
}
Good luck!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)