SA-MP Forums Archive
Timer in command - Help - 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)
+--- Thread: Timer in command - Help (/showthread.php?tid=404885)



Timer in command - Help - FL3GM4 - 04.01.2013

how to make that it shows timer on command /time

Код:
CMD:time(playerid, params[])
{
	new Sati, Min, Sec, string[128];
	gettime(Sati, Min, Sec);
	format(string, sizeof(string), "Sada je: %i sati, %i minuta i %i sekundi.", Sati, Min, Sec);
	SendClientMessage(playerid, COLOR_GREEN, string);
	return 1;
}
Код:
        JailTimer[id] = SetTimer("Unjail",time*60000, false);
Код:
public Unjail(playerid) {
	new string[128], ReturnName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, ReturnName, sizeof(ReturnName));
	format(string, sizeof(string), "Pusteni ste na slobodu");
	SendClientMessage(playerid, COLOR_RED, string);
	Jailed[playerid] = 0;
	SetPlayerInterior(playerid, 0);
	SetPlayerVirtualWorld(playerid, 0);
	SpawnPlayer(playerid);
	SetPlayerHealth(playerid, 100);
	KillTimer(JailTimer[playerid]);
	return 1;
}



Re: Timer in command - Help - FL3GM4 - 04.01.2013

sorry for DP, but it gone far away.. any help?


Re: Timer in command - Help - RedCrossER - 04.01.2013

What you want to do really?

Your script message not in English , fix it too


Re: Timer in command - Help - FL3GM4 - 04.01.2013

When I prison player, and when he/she write /time, that it shows how are they much jail to them ...

Код:
CMD:time(playerid, params[])
{
	new Sati, Min, Sec, string[128];
	gettime(Sati, Min, Sec);
	format(string, sizeof(string), "Now is: %i hours, %i minutes  %i seconds.", Sati, Min, Sec);
	SendClientMessage(playerid, COLOR_GREEN, string);
	return 1;
}
Код:
public Unjail(playerid) {
	new string[128], ReturnName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, ReturnName, sizeof(ReturnName));
	format(string, sizeof(string), "You are on freedom");
	SendClientMessage(playerid, COLOR_RED, string);
	Jailed[playerid] = 0;
	SetPlayerInterior(playerid, 0);
	SetPlayerVirtualWorld(playerid, 0);
	SpawnPlayer(playerid);
	SetPlayerHealth(playerid, 100);
	KillTimer(JailTimer[playerid]);
	return 1;
}
sorry for my bad english


Re: Timer in command - Help - RedCrossER - 04.01.2013

Oh well just assign a int to a variable and --; it every sec And show that sec


Re: Timer in command - Help - FL3GM4 - 04.01.2013

i didn't understand you what I need to do :/


Re: Timer in command - Help - RedCrossER - 04.01.2013

Pm me , I will give you the code when I come In Pc.