SA-MP Forums Archive
Weird problem - 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)
+--- Thread: Weird problem (/showthread.php?tid=378222)



Weird problem - Muhamed.pwn - 16.09.2012

Hi all...

I'm scripting a new server from 0 !
I've done several things (login system, some jobs etc)

I wanted to test with two players so I added my server on 192.168.1.2:7777 and joined the game, also done on my laptop (using same network).

The first player spawned allright.

But when I want to join with my laptop and wait for the dialog to appear it appears to the first player!

I don't know what to do, so please MTV , Pimp My Ride !


Re: Weird problem - Roko_foko - 16.09.2012

Show OnPlayerConnect callback. I think there problem occurs.


Re: Weird problem - Muhamed.pwn - 16.09.2012

pawn Код:
OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        LoginIntro(playerid);
        IntroTimer = SetTimer("IntroLog",3000,1);
        gPlayerLogged[playerid] = 0;
    }
    return 1;
}
It starts a timer for the dialog to show, here is the timer callback:
pawn Код:
public IntroLog(playerid)
{
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{F81414}Login","{FFFFFF}Modern  {FFFFFF}RolePlay\n\n{F81414}Type in your password to play","Login","Exit");
    KillTimer(IntroTimer);
    return 1;
}



Re: Weird problem - Roko_foko - 16.09.2012

Use SetTimerEx if you want to pass parameters to your function ( in this case it is playerid ).
Correct usage would be:
pawn Код:
IntroTimer = SetTimerEx("IntroLog",3000,true,"d",playerid);
Good luck!


Re: Weird problem - Muhamed.pwn - 16.09.2012

Thank you man !

People can be so dumb

Croatian: Hvala brate