09.07.2015, 11:25
This is a countdown filterscript and if a player type /count so it will start countdown for 10 seconds but i want to make its command like /count <seconds>
Код:
#include "a_samp" #include "zcmd" #define COUNTRANGE 20 forward Count1(playerid); forward Count2(playerid); forward Count3(playerid); forward Count4(playerid); forward Count5(playerid); forward Count6(playerid); forward Count7(playerid); forward Count8(playerid); forward Count9(playerid); forward Count10(playerid); public OnFilterScriptInit() { return 1; } CMD:count(playerid,params[]) { new Float:x,Float:y,Float:z; GetPlayerPos(playerid, x, y, z); SetTimer("Count1",1000,false); if IsPlayerInRangeOfPoint(playerid, COUNTRANGE, x, y, z) *then SetTimer("Count1",1000,false); return 1; } public Count1(playerid) { GameTextForPlayer(playerid,"~g~10",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count2",1000,false); return 1; } public Count2(playerid) { GameTextForPlayer(playerid,"~g~9",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count3",1000,false); return 1; } public Count3(playerid) { GameTextForPlayer(playerid,"~g~8",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count4",1000,false); return 1; } public Count4(playerid) { GameTextForPlayer(playerid,"~g~7",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count5",1000,false); return 1; } public Count5(playerid) { GameTextForPlayer(playerid,"~g~6",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count6",1000,false); return 1; } public Count6(playerid) { GameTextForPlayer(playerid,"~g~5",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count7",1000,false); return 1; } public Count7(playerid) { GameTextForPlayer(playerid,"~g~4",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count8",1000,false); return 1; } public Count8(playerid) { GameTextForPlayer(playerid,"~g~3",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count9",1000,false); return 1; } public Count9(playerid) { GameTextForPlayer(playerid,"~g~2",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); SetTimer("Count10",1000,false); return 1; } public Count10(playerid) { GameTextForPlayer(playerid,"~g~1",1000,3); PlayerPlaySound(playerid, 1056,0,0,0); return 1; }