public Counting(playerid)
{
if(Count >= 11) return 0;
if(Count == 0){
KillTimer(CountTimer);
}else{
new string[20];
format(string,sizeof(string),"~g~%d",Count);
GameTextForPlayer(playerid, string, 1000, 3) && PlayerPlaySound(playerid, 1056,0,0,0) && Count --;
}
return 1;
}
CMD:count(playerid,params[])
{
if(PlayerInfo[playerid][Freeze] == 1) return GameTextForPlayer(playerid, "~g~you cant use commands while being ~n~~g~frozen",4500,3);
if(PlayerInfo[playerid][Jail] == 1) return GameTextForPlayer(playerid,"~g~Player is not in freeroam",2500,3);
if(indm[playerid] >= 1) return GameTextForPlayer(playerid,"~g~Player is not in freeroam",2500,3);
if(PlayerInfo[playerid][pVip] >= 1)
{
new seconds;
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params,"i",seconds)) return GameTextForPlayer(playerid, "~g~/count <seconds>",4500,3);
Count = seconds;
CountTimer = SetTimer("Counting",1000,true);
if IsPlayerInRangeOfPoint(playerid, COUNTRANGE, x, y, z) *then SetTimer("Counting",1000,false);
}
return 1;
}
forward Counting(playerid);
forward Counting9(playerid);
forward Counting8(playerid);
forward Counting7(playerid);
forward Counting6(playerid);
forward Counting5(playerid);
forward Counting4(playerid);
forward Counting3(playerid);
forward Counting2(playerid);
forward Counting1(playerid);
forward CountingGO(playerid);
public Counting(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~g~10 ~y~]",2000,3);
SetTimer("Counting9",1000,false);
return 1;
}
public Counting9(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~b~9 ~y~]",2000,3);
SetTimer("Counting8",1000,false);
return 1;
}
public Counting8(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~8 ~y~]",2000,3);
SetTimer("Counting7",1000,false);
return 1;
}
public Counting7(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~7 ~y~]",2000,3);
SetTimer("Counting6",1000,false);
return 1;
}
public Counting6(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~6 ~y~]",2000,3);
SetTimer("Counting5",1000,false);
return 1;
}
public Counting5(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~5 ~y~]",2000,3);
SetTimer("Counting4",1000,false);
return 1;
}
public Counting4(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~4 ~y~]",2000,3);
SetTimer("Counting3",1000,false);
return 1;
}
public Counting3(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~3 ~y~]",2000,3);
SetTimer("Counting2",1000,false);
return 1;
}
public Counting2(playerid)
{
Count= 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~2 ~y~]",2000,3);
SetTimer("Counting1",1000,false);
return 1;
}
public Counting1(playerid)
{
Count = 1;
PlayerPlaySound(playerid, 1056,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~1 ~y~]",2000,3);
SetTimer("CountingGO",1000,false);
return 1;
}
public CountingGO(playerid)
{
Count = 0;
PlayerPlaySound(playerid, 1057,0.0,0.0,0.0);
GameTextForAll("~y~] ~r~G ~g~O ~b~O ~p~O ~w~ ~y~]",1000,3);
return 1;
}
CMD:count(playerid,params[])
{
if(PlayerInfo[playerid][Freeze] == 1) return GameTextForPlayer(playerid, "~g~you cant use commands while being ~n~~g~frozen",4500,3);
if(PlayerInfo[playerid][Jail] == 1) return GameTextForPlayer(playerid,"~g~Player is not in freeroam",2500,3);
if(indm[playerid] >= 1) return GameTextForPlayer(playerid,"~g~Player is not in freeroam",2500,3);
if(PlayerInfo[playerid][pVip] >= 1)
{
new seconds;
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params,"i",seconds)) return GameTextForPlayer(playerid, "~g~/count <seconds>",4500,3);
Count = seconds;
CountTimer = SetTimer("Counting",1000,true);
if IsPlayerInRangeOfPoint(playerid, COUNTRANGE, x, y, z) *then SetTimer("Counting",1000,false);
}
return 1;
}
For me, it would be better using this :
PHP код:
|
SetTimer("Counting",1000,false);
SetTimer("Counting",1,false);
[COLOR="DarkRed"][I]For me, it would be better using this :
PHP код:
|
For me, it would be better using this :
PHP код:
|