Timer not working? +REP!
#1

Quote:

forward timer_ar1(playerid);

pawn Код:
CMD:ar1(playerid, params[])
{
    new id;
    if(GetPlayerSkin(playerid) == 285 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288)
    if (sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /ar1 [ID]");
    if(GetDistanceBetweenPlayers(playerid,id)> 2)return SendClientMessage(playerid,COLOR_RED,"[INFO]You are to far from that player");
    else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "[INFO]Player not found");
    else
    {
        SetPlayerPos(id, 226.69999694824,108.5,998.59997558594);
        SetPlayerVirtualWorld(id, -1);
        SetPlayerInterior(id, 10);
        GivePlayerMoney(id, -1500);
        ResetPlayerWeapons(id);
        SendClientMessage(id, COLOR_GOLD, "[INFO]You have been Arrested, Your Sentence is 60 Seconds.");
        GivePlayerMoney(playerid, 500);
        SendClientMessage(playerid, COLOR_GOLD, "[INFO]Player Arrested succesfully. (Arrest type: 1)");
        SetTimerEx("timer_ar1",60000,false,"i",playerid); //set your player normal spawn pos here after arrest
        SetPlayerColor(id,orange);
        TogglePlayerControllable(id, 1);
    }
    return 1;
}
pawn Код:
public timer_ar1(playerid)
{
     SetPlayerColor(playerid, COLOR_GREY);
     SetPlayerPos(playerid, -88.0029, 1222.8109, 19.7422);
     SetPlayerInterior(playerid, 0);
      TogglePlayerControllable(playerid,1);
     SetPlayerVirtualWorld(playerid, 0);
}
The player won't unjail
Reply
#2

pawn Код:
// Replace this
SetTimerEx("timer_ar1",60000,false,"i",playerid);

// With
SetTimerEx("timer_ar1",60000,false,"i",id);
Reply
#3

Testing i'll edit when i have done,Thanks

EDIT: Thanks!
Reply
#4

What about killing the timer?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)