27.03.2011, 12:58
Hello.Help for command operiation predefined time.
Example:
Command /drag will run from 5 pm to 5.05 pm.
Thanks.
Example:
Command /drag will run from 5 pm to 5.05 pm.
Thanks.
#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; }