SA-MP Forums Archive
Stop showing for all - 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: Stop showing for all (/showthread.php?tid=93650)



Stop showing for all - V1ceC1ty - 26.08.2009

Ive made this script so when you spawn it shows a tutorial using camera positions but if another person spawns it shows it again for both people.

I want it to stop showing it to everyone how do i do this heres the code?
pawn Код:
#include <a_samp>

forward Tutone();
forward Tuttwo();
forward Tutthree();
forward Tutfour();
forward Spawn();

public OnPlayerRequestSpawn(playerid)
{
  SetTimer("Tutone", 1000, 0);
  SetTimer("Tuttwo", 11000, 0);
  SetTimer("Tutthree", 21000, 0);
  SetTimer("Tutfour", 31000, 0);
  SetTimer("Spawn", 32000, 0);
    return 1;
}

public Tutone()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
  SetPlayerPos(i, 132, -67, 1.58);
    SetPlayerCameraPos(i, 96, 1816, 57);
    SetPlayerCameraLookAt(i, 125, 1836, 47);
    }
    return 1;
}

public Tuttwo()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    SetPlayerPos(i, 132, -67, 1.58);
    SetPlayerCameraPos(i, 277, 1948, 77);
    SetPlayerCameraLookAt(i, 145, 1914, 59);
    }
    return 1;
}

public Tutthree()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    SetPlayerPos(i, 132, -67, 1.58);
    SetPlayerCameraPos(i, 324, 2053, 27);
    SetPlayerCameraLookAt(i, 311, 2022, 22);
    }
    return 1;
}

public Tutfour()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    SetPlayerPos(i, 132, -67, 1.58);
    SetPlayerCameraPos(i, 282, 1814, 33);
    SetPlayerCameraLookAt(i, 123, 1868, 24);
    }
    return 1;
}

public Spawn()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    SpawnPlayer(i);
    }
    return 1;
}



Re: Stop showing for all - Finn - 26.08.2009

You have made a loop going through all player ID's and then you ask why does it do it for all players? Nice job.

Use SetTimerEx and pass the player id with it, that'll work.