TogglePlayerSpectating, spawning then closing server connection. [REP++]
#1

So yeah, I TogglePlayerSpectating() when OnPlayerRequestClass is called, and I call it again to toggle it off after a dialog, it spawns them fine but the server closes connection instantly, ideas?
Reply
#2

If the server closes connection, it's probably kicking them. Look for that code.
Reply
#3

No instances found. I just checked for that, it has something to do with TogglePlayerSpectating, I had a similar problem a while ago with SetSpawnInfo();

These are all the relevant things.

pawn Код:
public OnGameModeInit()
{

    AddPlayerClass(-snip-);

}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid,1);
....
    if(!fexist(File) )
    {
        ShowPlayerDialog(
        }
}
pawn Код:
 
pawn Код:
public OnPlayerSpawn(playerid)
{
    IsPlayerSpawned[playerid] = 1;
    HUDCreate(playerid);
    SpawnShit(playerid);
    return 1;
}
pawn Код:
if(dialogid == Register_Dialog)
    {
    if(response)
        {
        TogglePlayerSpectating(playerid,0);
        //SpawnPlayer(playerid);
        clearchat(playerid);

Now if I uncomment SpawnPlayer, they're not kicked but they spawn twice, doubling everything they get from SpawnShit(playerid);
Reply
#4

bamp
Reply
#5

pawn Код:
SetSpawnInfo(playerid,1,90,0,0,0,0,0,0,0,0,0,0);
otherwise the server will kick ya
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)