forward and timer problem
#1

pawn Код:
new dosomethingtimer[MAX_PLAYERS];
CMD:dosomething(playerid,params[])
{
  SendClientMessage(playerid,GREY,"Your are doing something,it will last for 5 seconds.");
  dosomethingtimer[playerid] = SetTimerEx("dosomethingtimer", 5000, false,"i",playerid);
  return 1;

}
forward dosomethinga(playerid);
public dosomethinga(playerid)
{
    KillTimer(dosomethingtimer[playerid]);
    SendClientMessage(playerid,GREY,"You are not doing something anymore!");
    return 1;
}
It won't send the clientmessage "you are not doing something anymore!"
Reply
#2

The first parameter in SetTimerEx is the direct function you are calling, so it should match the public you want to be executed.

pawn Код:
dosomethingtimer[playerid] = SetTimerEx("dosomethinga", 5000, false,"i",playerid);
Reply
#3

I'll test it.
Reply
#4

pawn Код:
SetTimerEx("dosomethingtimer", 5000, false,"i",playerid);
to
SetTimerEx("dosomethinga", 5000, false,"i",playerid);

// dosomethinga this is the function as u can see you didnt called the function you called the timer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)