SA-MP Forums Archive
Help!Commands almost under time ;( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help!Commands almost under time ;( (/showthread.php?tid=244484)



Help!Commands almost under time ;( - Torres16 - 27.03.2011

Hello.Help for command operiation predefined time.
Example:
Command /drag will run from 5 pm to 5.05 pm.
Thanks.


Re: Help!Commands almost under time ;( - [ProX]BlueFire - 27.03.2011

k i have maked this:
Код:
#include <a_samp>
forward i(cmdtext[]);
forward i1();
public i1()
{
KillTimer(0);
KillTimer(1);
}
public i(cmdtext[])
{
    SetTimer("i1", 20000,true);
    SendClientMessageToAll(0xFFFFFF, "You can use /test now!");
	new playerid;
	if (strcmp("/TEST", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid, 31, 300);
	}
	
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/start", cmdtext, true, 10) == 0)
	{
		SetTimer("i", 500, true);
		return 1;
	}
	if (strcmp("/end", cmdtext, true, 10) == 0)
	{
		KillTimer(0);
		KillTimer(1);
		return 1;
	}
	return 0;
}
public OnFilterScriptInit()
{
	SetTimer("i", 500, true);
	print("\n--------------------------------------");
	print(" Testing!");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	KillTimer(0);
	KillTimer(1);
	return 1;
}
NOTE:UNTESTED!!!!
i hope it will help
ANOTHER NOTE:u will need to start it by urself!+it will start when u will