timer string
#1

Hey. I need some help with an /arrest command. I want to make an /arrest command with a timer to it. Like this: /arrest [playerid] [seconds]. This is what I've got sofar. I need help with starting a timer to however many seconds I type.

pawn Код:
COMMAND:arrest(playerid, params[])
{
    new criminal;
    new string[128];

    if(sscanf(params, "ud", criminal, params)) return SendClientMessage(playerid, COLOR_GREY, "[Usage]: /arrest [ID] [seconds].");
    if(criminal == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_LIGHTRED, "[Error]: That player is not connected.");
    if(Duty[playerid] < 1) return SCM(playerid, COLOR_LIGHTRED, "[Error]: You're not a cop on duty.");

    if(IsPlayerInRangeOfPoint(playerid, 7.0, 1, 2, 3))
    {
        format(string, sizeof(string), "%s pushes %s into the jail cell.", GetName(playerid), GetName(criminal));
        ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        SetPlayerPos(playerid, 1, 2, 3);
    }
    else return SCM(playerid, COLOR_LIGHTRED, "[Error]: You're not close enough.");
    return 1;
}
Reply
#2

pawn Код:
//In command
SetTimerEx("UnJail", 1000*params, false, "i", criminal);

public UnJail(playerid)
{
//UnjailCode
}
Reply
#3

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)