Timer in command - Help
#1

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;
}
Reply
#2

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

What you want to do really?

Your script message not in English , fix it too
Reply
#4

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
Reply
#5

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)