SA-MP Forums Archive
OnPlayerConnect not calling. - 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: OnPlayerConnect not calling. (/showthread.php?tid=368075)



OnPlayerConnect not calling. - Marricio - 12.08.2012

Well, i have the callback OnPlayerConnect in a filterscript.

pawn Код:
#define FILTERSCRIPT

public OnFilterScriptInit()
{
       // ........ some code
}

public OnPlayerConnect( playerid )
{
       print("debug OnPlayerConnect" );
       //.... other code
}
I never received the print on the console. I tried relogging few times or reloading the filterscript and relog but nothing.


Re: OnPlayerConnect not calling. - Nicholas. - 12.08.2012

I am not sure but see if it works this way.

pawn Код:
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
       // ........ some code
}

public OnPlayerConnect( playerid )
{
       print("debug OnPlayerConnect" );
       //.... other code
}

#endif



Re : OnPlayerConnect not calling. - cazanova - 12.08.2012

xweird


Re : OnPlayerConnect not calling. - Sandiel - 12.08.2012

Use if defined and endif, otherwise it won't load like half your filterscript, as I heard


Re: OnPlayerConnect not calling. - IceMeteor - 12.08.2012

I got same problem on my code, it's ls_mall.pwn

pawn Код:
public OnPlayerConnect(playerid)
{
    // Remove the original mall mesh
    RemoveBuildingForPlayer(playerid, 6130, 1117.5859, -1490.0078, 32.7188, 10.0);

    // This is the mall mesh LOD
    RemoveBuildingForPlayer(playerid, 6255, 1117.5859, -1490.0078, 32.7188, 10.0);

    // There are some trees on the outside of the mall which poke through one of the interiors
    RemoveBuildingForPlayer(playerid, 762, 1175.3594, -1420.1875, 19.8828, 0.25);
    RemoveBuildingForPlayer(playerid, 615, 1166.3516, -1417.6953, 13.9531, 0.25);
    print("A Player Has connected, mall has been removed");
    return 1;
}
The Print one never got printed


Re: OnPlayerConnect not calling. - Socan - 12.08.2012

Easy fix.

You use print("debug OnPlayerConnect"); when its printf("debug OnPlayerConnect");

So this is an example of what you need to change:

pawn Код:
#define FILTERSCRIPT

public OnFilterScriptInit()
{
       // ........ some code
}

public OnPlayerConnect( playerid )
{
       printf("debug OnPlayerConnect" );
       //.... other code
}



Re: OnPlayerConnect not calling. - leonardo1434 - 12.08.2012

Socan you're wrong about the print. let me explain.

print = function without parameters.
printf = function with parameteres.

about the main question, just define it as a Fs.


Re: OnPlayerConnect not calling. - playbox12 - 12.08.2012

Show your gamemode's OnPlayerConnect. Or use a standard GM like lvdm (with the filterscript loaded) to see if the problem is in there.


Re: OnPlayerConnect not calling. - Socan - 12.08.2012

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
Socan you're wrong about the print. let me explain.

print = function without parameters.
printf = function with parameteres.

about the main question, just define it as a Fs.
printf works for me :/


Re: OnPlayerConnect not calling. - kickerbat - 12.08.2012

Quote:
Originally Posted by Socan
Посмотреть сообщение
printf works for me :/
Depends on the script. as the above post explains printf is for variables and print is for standalone.