countdown
#1

how can i make a /cd [Time in seconds] command?
Reply
#2

add me in msn pyrokar@libero.it i help you !
Reply
#3

Quote:
Originally Posted by [ISS]jumbo
Посмотреть сообщение
add me in msn pyrokar@libero.it i help you !
libero.it ! Are you italian or you just use an italian email server ? ? ?
Reply
#4

italian ...
Reply
#5

Quote:
Originally Posted by [ISS]jumbo
Посмотреть сообщение
add me in msn pyrokar@libero.it i help you !
i don't have an msn account... cant you explain this on forum?
Reply
#6

Sore are you using dcmd ?
Reply
#7

Quote:
Originally Posted by [ISS]jumbo
Посмотреть сообщение
Sore are you using dcmd ?
i am using strtok
Reply
#8

strtok is not a command processor ^_^
Reply
#9

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
strtok is not a command processor ^_^
i ment... i do like:
pawn Код:
if(strcmp(cmd, "/heal", true) == 0) {
 new tmp[256];
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) {
  SendClientMessage(playerid, COLOUR_ORANGE, "Usage : /heal [playerid]");
  return 1;
  }

  new victim;
  victim = strval(tmp);

 new string[128];
  new playername[MAX_PLAYER_NAME];
  GetPlayerName(playerid, playername, sizeof(playername));
  new playername2[MAX_PLAYER_NAME];
  GetPlayerName(victim, playername2, sizeof(playername2));

  format(string, sizeof(string), "%s healed you.", playername);
  SendClientMessage(victim, COLOUR_YELLOW, string);
SetPlayerHealth(victim, 100);

format(string, sizeof(string), "You healed %s.", playername2);
  SendClientMessage(playerid, COLOUR_YELLOW, string);
  return 1;
  }
Reply
#10

try this
pawn Код:
new Timer;//this one up of all
new C=0;//this one up of all


if(strcmp(cmd, "/cd", true) == 0)//this in onplayercommandtext
{
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, COLOUR_ORANGE, "Usage : /cd  [Time in seconds]");
        return 1;
    }
    new time;
    time = strval(tmp);
    Timer = SetTimer("CountDown",1000,1);
    C=time+1;
    return 1;
}

forward CD(time);//this where u want not in other callbacks
public CD(time)
{
    new string[128];
    C--;
    format(string,sizeof(string),"%d",C);
    GameTextForAll(string,1000,3);
    if(C <= 0)
    {
        GameTextForAll("GO",1000,3);
        KillTimer(Timer);
    }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)