SA-MP Forums Archive
timer not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: timer not working (/showthread.php?tid=89203)



timer not working - killdahobo99 - 31.07.2009

Why isnt this timer working for my /ar command


Top of my script:
Код:
forward Taze(playerid);
forward ExitJail(playerid);
Heres the /ar command:


Код:
	new pname;
	new giveplayerid;
	if(!strcmp(cmd, "/ar", true))
	{
		if (gTeam[playerid] == TEAM_COP)
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) return SendClientMessage(playerid,	COLOR_ORANGE, "USAGE: /ar [playerid]");
			id = strval(tmp);

			Jailed[id] = 1;
			SetTimer("ExitJail",120000,0);
		 	SetPlayerInterior(giveplayerid,3);
      SetPlayerPos(giveplayerid,198.3797,160.8905,1003.0300);
      SetPlayerFacingAngle(giveplayerid,177.0350);
      SetCameraBehindPlayer(giveplayerid);

			GetPlayerName(id, oname, sizeof(oname));
			format(string, sizeof(string), "You have arrested %s (id: %d)", oname, id);
			SendClientMessage(playerid, COLOR_YELLOW, string);

			SendClientMessage(id, COLOR_YELLOW, "You have been sent to jail for your criminal acts");

			format(string, sizeof(string), "%s has been arrested by %s", oname, pname);
			print(string);
			}
			else return SendClientMessage(playerid, COLOR_LIME, "Only Law enforcement agents can use this command! ");
		return 1;
	}
//bottom of my script

Код:
public ExitJail(playerid)
{
    SendClientMessage(playerid, COLOR_WHITE,"You are now free!");
    SetPlayerPos(playerid,2234.1221,2454.1604,10.8051);
    SetPlayerInterior(playerid,0);
    return 1;
}



Re: timer not working - Doppeyy - 31.07.2009

Change
Код:
SetTimer("ExitJail",120000,0);
To
Код:
SetTimer("ExitJail",120000,false);
Then it should work fine.

Gr Artix


Re: timer not working - MadeMan - 31.07.2009

pawn Код:
SetTimerEx("ExitJail",120000,0,"d",playerid);



Re: timer not working - killdahobo99 - 31.07.2009

I want it to actually display a countdown...how do i do that? i already got the timer and everything set...so how do i make it display the actual countdown now?