SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 03/05/2011, 04:13 PM   #1
boyan96
Huge Clucker
 
Join Date: Sep 2010
Posts: 487
Reputation: 2
Default Timer help

How i can can put on this command timer and after 2 minutes to can spawn car again


Code:
if (strcmp("/NRG", cmdtext, true, 10) == 0)
    {
    if (PlayerInfo[playerid][pDonateRank] >= 3)
	{
    new Float:X,Float:Y,Float:Z,Float:Angle, carid;
	GetPlayerPos(playerid,X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
	carid = CreateVehicle(522,X,Y,Z,Angle,-1,-1,600);
	PutPlayerInVehicle(playerid,carid,0);
	TogglePlayerControllable(playerid,true);
    return SendClientMessage(playerid, 0x40FF40FF, "NRG has been spawned!");
    	 	}
	return 1;
	}
boyan96 is offline  
Old 03/05/2011, 04:34 PM   #2
MadeMan
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,500
Reputation: 254
Default Re: Timer help

Code:
if (strcmp("/NRG", cmdtext, true) == 0)
{
	if (PlayerInfo[playerid][pDonateRank] >= 3)
	{
		if(GetTickCount() - GetPVarInt(playerid, "LastNRG") < 120000) return SendClientMessage(playerid, 0xFF0000FF, "You have to wait 2 minutes before spawning new NRG");
		new Float:X,Float:Y,Float:Z,Float:Angle, carid;
		GetPlayerPos(playerid,X,Y,Z);
		GetPlayerFacingAngle(playerid,Angle);
		carid = GetPlayerVehicleID(playerid);
		carid = CreateVehicle(522,X,Y,Z,Angle,-1,-1,600);
		PutPlayerInVehicle(playerid,carid,0);
		TogglePlayerControllable(playerid,true);
		SetPVarInt(playerid, "LastNRG", GetTickCount());
		return SendClientMessage(playerid, 0x40FF40FF, "NRG has been spawned!");
	}
	return 1;
}
MadeMan is offline  
 

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
this timer is 10 min gpclan Help Archive 3 13/07/2009 05:56 PM
Help with timer coole210 Help Archive 1 11/07/2009 09:03 AM
C4 TIMER Frankox Help Archive 15 09/07/2009 12:21 PM
Timer help... introzen Help Archive 2 05/07/2009 08:26 PM
Timer JoeDaDude Help Archive 6 22/04/2009 07:27 PM


All times are GMT. The time now is 01:27 AM.


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