help add use limiter
#1

how can I set time limit to use the teles command to not agan spawn cmds.
use zcmd scanff2

Код:
CMD:dglobe(playerid,params[]) {
	#pragma unused params
	if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape      your punishment!");
	TeleTimer[playerid] = SetTimerEx("ttimer", 1000, true, "i",playerid);
	tseconds[playerid] = 6;
	format(tstring,45,"You Must wait %d seconds before teleporting", tseconds[playerid]-1);
	if(PlayerInfo[playerid][Level] == 0) SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
	Tx[playerid] = 3994.595459;
	Ty[playerid] = 3996.388672;
	Tz[playerid] = 4.0;
	Ti[playerid] = 0;
	new string[128];
	new dsname[MAX_PLAYER_NAME];
	format(telestring[playerid],43,"Death Globe!");
	GetPlayerName(playerid, dsname, sizeof(dsname));
	format(string, sizeof(string), "[TELE]:%s has Just Teleported To The Death Globe /dglobe", dsname);
	SendClientMessageToAll(COLOR_LIGHTBLUE, string);
	SetTimerEx("setstunt",3000,0,"i", playerid);
	return 1;
}
Reply
#2

pawn Код:
CMD:dglobe(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape      your punishment!");
    //tseconds[playerid] = 6;
    if(PlayerInfo[playerid][Level] == 0) {
        if((gettime() - TeleTimer[playerid]) <= 6) {
            format(tstring,45,"You Must wait %d seconds before teleporting", gettime() - TeleTimer[playerid]);
            SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
            return 1;
        }
    }
    Tx[playerid] = 3994.595459;
    Ty[playerid] = 3996.388672;
    Tz[playerid] = 4.0;
    Ti[playerid] = 0;
    TeleTimer[playerid] = gettime();//Gets the current time as a unix timestamp (seconds)
    new string[128];
    new dsname[MAX_PLAYER_NAME];
    format(telestring[playerid],43,"Death Globe!");
    GetPlayerName(playerid, dsname, sizeof(dsname));
    format(string, sizeof(string), "[TELE]:%s has Just Teleported To The Death Globe /dglobe", dsname);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
    SetTimerEx("setstunt",3000,0,"i", playerid);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)