12.07.2015, 16:50
I have a countdown command but when i type /count 10,it start the counting from 9
PHP код:
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;
}
PHP код:
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;
}