Sending these lines only once.
#1

I've got on OnPlayerSpawn the following code:

PHP код:
             TogglePlayerSpectating(playerid0);
             
TogglePlayerControllableplayerid);
             
SetTimer("start"5000false);
             
GameTextForAll("~g~~h~Are you ready?",4000,3);
              
pInfo[playerid][pAlive] = true;
            
round[playerid]=1
But everyime a player joins it shows the script I wrote to everyone who logs-in.
I want it, when the gamemode starts it shows it to all the player connected at THAT time, who connects later doesn't see this. :>
Reply
#2

pawn Код:
//On Top
new show;

//ongamemodeinit
public OnGameModeInit()
{
     show=1;
     SetTimer("StopShowing",10*1000,false);
     return 1;
}
 
//
forward StopShowing();
public StopShowing()
{
  show=0;
  return 1;
}


public OnPlayerSpawn(playerid)
{
        if(show == 1)
       {
             TogglePlayerSpectating(playerid, 0);
             TogglePlayerControllable( playerid, 0 );
             SetTimer("start", 5000, false); // you sure about this?
             GameTextForAll("~g~~h~Are you ready?",4000,3); //Why for all ?
             pInfo[playerid][pAlive] = true;
             round[playerid]=1;  
       }
       return 1;
}
Reply
#3

pawn Код:
TogglePlayerSpectating(playerid, 0);
TogglePlayerControllable( playerid, 0 );
SetTimerEx("start", 5000, false,"i",playerid);
GameTextForPlayerl(playerid,"~g~~h~Are you ready?",4000,3);
pInfo[playerid][pAlive] = true;
round[playerid]=1;
and your "start" function should look like this:
pawn Код:
forward start(playerid);
public start(playerid)
{
     //your code here
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)