[HELP] ID 0 ONLY!
#1

Hello,i have scripted that code:

pawn Код:
if (strcmp(cmd, "/bla", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            if (gPlayerLogged[playerid] != 0)
            {


              SetTimer("StartTest", 6000, false);
              SetTimer("FaildTest", 100000, false);
       

            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "  You are not Logged in!");
            }
        }
        return 1;
    }
Now the problem is when the timer runs,it sends the message to the ID 0 only.
How can i set it when someone use /bla it will send TO him and not to ID 0?

pawn Код:
public StartTest(playerid)
{
  SendClientMessage(playerid, COLOR_WHITE, "Your test has began!");
  //SetPlayerCheckpoint(playerid, 2033.2446,-1929.7856,12.9651, 5.0);

    //return true;
}
as you can see,i tried to remove the return true;
Reply
#2

Use SetTimerEx-function (you can pass parameters to the function).

And also, get rid of the IsPlayerConnected-check, you don't need it.
Reply
#3

pawn Код:
SetTimerEx("StartTest", 6000, false, "i", playerid);
SetTimerEx("FaildTest", 100000, false, "i", playerid);
Reply
#4

It's because you have to use SetTimerEx.

pawn Код:
SetTimerEx("StartTest", 6000, false,"d",playerid);
SetTimerEx("FaildTest", 100000, false,"d",playerid);
The "d" is your format. D and I represent integers, which is what playerid is.
Reply
#5

Quote:
Originally Posted by Backwardsman97
It's because you have to use SetTimerEx.

pawn Код:
SetTimerEx("StartTest", 6000, false,"d",playerid);
SetTimerEx("FaildTest", 100000, false,"d",playerid);
The "d" is your format. D and I represent integers, which is what playerid is.
Thank you very much guys!
Helped me alot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)