SA-MP Forums Archive
[HELP] ID 0 ONLY! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] ID 0 ONLY! (/showthread.php?tid=113213)



[HELP] ID 0 ONLY! - Nakash - 12.12.2009

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;


Re: [HELP] ID 0 ONLY! - Correlli - 12.12.2009

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

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


Re: [HELP] ID 0 ONLY! - bigcomfycouch - 12.12.2009

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



Re: [HELP] ID 0 ONLY! - Backwardsman97 - 12.12.2009

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.


Re: [HELP] ID 0 ONLY! - Nakash - 12.12.2009

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.