SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/05/2018, 02:22 AM   #1
nbx2000
Little Clucker
 
Join Date: Dec 2016
Posts: 33
Reputation: 0
Default help add use limiter

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

Code:
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;
}
nbx2000 is offline   Reply With Quote
Old 18/05/2018, 03:08 AM   #2
CyNiC
High-roller
 
Join Date: Jan 2009
Location: Brazil
Posts: 1,444
Reputation: 203
Default Re: help add use limiter

Code:
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;
}
__________________
My scripts
Brazucas'Server
CyNiC is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Speed limiter help Baumann Scripting Help 10 13/08/2013 03:22 PM
Speed limiter Sniper99 Scripting Help 1 27/02/2013 02:23 PM
Time limiter for /rob help! Panormitis Scripting Help 8 28/09/2011 10:19 AM
Speed limiter Urefeu Scripting Help 2 21/09/2011 11:17 AM


All times are GMT. The time now is 08:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.