SA-MP Forums Archive
Register Login delay - 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: Register Login delay (/showthread.php?tid=228578)



Register Login delay - 77ther - 20.02.2011

I created short video with camera moving and texdraws etc..
but how to delay reg/log dialog to pop up?


Re: Register Login delay - [L3th4l] - 20.02.2011

pawn Код:
public OnPlayerConnect(playerid)
{
    SetTimerEx("LogReg", 6000, false, "d", playerid); // A Timer for that player, 6 seconds.
    return 1;
}

forward LogReg(playerid);
public LogReg(playerid)
{
    // Show log or register info
    return 1;
}



Re: Register Login delay - 77ther - 20.02.2011

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
    SetTimerEx("LogReg", 6000, false, "d", playerid); // A Timer for that player, 6 seconds.
    return 1;
}

forward LogReg(playerid);
public LogReg(playerid)
{
    // Show log or register info
    return 1;
}
So basicly I have to count how much that "video" is long and put that time in timer?


Re: Register Login delay - admantis - 20.02.2011

Yes.


Re: Register Login delay - xRyder - 20.02.2011

Well not really. This will never give you right time, and that can vary a lot (from player to player).

What you can do is like making player variable.
Something like: ( this will be really simple just to show you how you can do it.)

pawn Код:
new PlayerStep[MAX_PLAYERS] = 0;

public OnPlayerConnect(playerid)
{
    //Set him spectating here.
    //Set his camera where you want.
   
    //Make new function where you will send him here( In my case i'll use ShowVideo).
    ShowVideo(playerid);
    PlayerStep[playerid] = 1;
    //Some more code if you want...
    return 1;
}

forward ShowVideo(playerid);
public ShowVideo(playerid)
{
    if(PlayerStep[playerid] == 1)
    {
        // Do this ( your code here)
        PlayerStep[playerid] = 2;
        ShowVideo(playerid);
    }
    else if(PlayerStep[playerid] == 2)
    {
        //Do something else
        PlayerStep[playerid] = 3;
        ShowVideo(playerid);
    }
    //And you continue like this till some number that will be your last number. ( My case is 8)
    else if(PlayerStep[playerid] == 8)
    {
        PlayerStep[playerid] = 0;
        ShowPlayerDialog();
    }
    return 1;
}



Re: Register Login delay - 77ther - 20.02.2011

Quote:
Originally Posted by xRyder
Посмотреть сообщение
Well not really. This will never give you right time, and that can vary a lot (from player to player).

What you can do is like making player variable.
Something like: ( this will be really simple just to show you how you can do it.)

pawn Код:
new PlayerStep[MAX_PLAYERS] = 0;

public OnPlayerConnect(playerid)
{
    //Set him spectating here.
    //Set his camera where you want.
   
    //Make new function where you will send him here( In my case i'll use ShowVideo).
    ShowVideo(playerid);
    PlayerStep[playerid] = 1;
    //Some more code if you want...
    return 1;
}

forward ShowVideo(playerid);
public ShowVideo(playerid)
{
    if(PlayerStep[playerid] == 1)
    {
        // Do this ( your code here)
        PlayerStep[playerid] = 2;
        ShowVideo(playerid);
    }
    else if(PlayerStep[playerid] == 2)
    {
        //Do something else
        PlayerStep[playerid] = 3;
        ShowVideo(playerid);
    }
    //And you continue like this till some number that will be your last number. ( My case is 8)
    else if(PlayerStep[playerid] == 8)
    {
        PlayerStep[playerid] = 0;
        ShowPlayerDialog();
    }
    return 1;
}
I don't get some parts of it...
Can you take a look at raven's RP and explain it a bit further?

1st of all it doesn't set my camera where I want it, it remains the same..
2nd it doesn't even create any textdraws..


EDIT: I think I figured it out..