OnPlayerConnect not calling.
#1

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

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
Reply
#3

xweird
Reply
#4

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

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
Reply
#6

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

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.
Reply
#8

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

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 :/
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)