Timer on Command - How!?
#1

i want that time remaining of JailTimer shows 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);
	GameTextForPlayer(playerid, JailTimer[playerid], 3000, 1);
	return 1;
}
Код:
CMD:prison(playerid,params[])
{
    new Random = random(sizeof(AreaSpawns));
    new id,time,reason[128],GPlayerName[MAX_PLAYER_NAME], string[128];
    if(PlayerInfo[playerid][pAdmin] < 2) return 1;
    else if(sscanf(params,"uds[128]",id,time,reason)) return SendClientMessage(playerid, COLOR_RED, "/prison <playerid> <time> <reason>");
    else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, ""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE"Igrac nije na serveru");
    else if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin])return SendClientMessage(playerid,COLOR_RED,""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE"Nemozes zatvoriti veci Admin Level");
    else if(Jailed[id] == 1)return SendClientMessage(playerid,COLOR_RED,"Igrac je vec u zatvoru");
    {
        GetPlayerName(playerid, GPlayerName, sizeof(GPlayerName));
        format(string, sizeof(string), "Zatvoren si na %d minuta; Razlog: %s", time, reason);
        SendClientMessage(playerid, COLOR_RED, string);
        format(string, sizeof(string), "Admin %s je zatvorio igraca %s (ID:%d) na %s minuta; Razlog: %s", GPlayerName, PlayerName(id), id, time, reason);
        SendAdminMessage(1, COLOR_CHARTREUSE, string);
        Jailed[id] = 1;
        SetPlayerInterior(id, 0);
        SetPlayerVirtualWorld(id, 0);
        SetPlayerFacingAngle(id, 360.0);
        SetPlayerPos(id, AreaSpawns[Random][0], AreaSpawns[Random][1], AreaSpawns[Random][2]);
        ResetPlayerWeapons(id);
        JailTimer[id] = SetTimer("Unjail",time*60000, false);
    }
    return 1;
}
Reply


Messages In This Thread
Timer on Command - How!? - by FL3GM4 - 05.01.2013, 20:19

Forum Jump:


Users browsing this thread: 2 Guest(s)