Weird problem
#1

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 !
Reply
#2

Show OnPlayerConnect callback. I think there problem occurs.
Reply
#3

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;
}
Reply
#4

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!
Reply
#5

Thank you man !

People can be so dumb

Croatian: Hvala brate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)