Server sends me back to class selection
#1

I'm making a custom class selection. Server should spawn me after I click a textdraw. But it sends me back to class selection.
pawn Code:
else if(playertextid == tID[playerid][9])
    {
        ClearTD(playerid); //removes all textdraws
        CancelSelectTextDraw(playerid);
        TogglePlayerSpectating(playerid,0); //I set it to 1 under OnPlayerConnect and setting it back to 0 after they've done choosing a skin.
        SetPlayerSkin(playerid, (Player[playerid][Team] == CTerror) ? 285 : 28); //Sets player's skin
        Player[playerid][Skin] = GetPlayerSkin(playerid);
        SpawnPlayer(playerid); //Spawns them
        SetCameraBehindPlayer(playerid);
    }
Reply
#2

When you toggle player spectating off, it automatically forces player to spawn, so you don't have to use SpawnPlayer function.

Code:
Note: When the spectating is turned off, OnPlayerSpawn will automatically be called.
Also check your OnPlayerSpawn callback, maybe there is an issue there, however first try removing the SpawnPlayer as I said before.
Reply
#3

Use SetSpawnInfo before toggling off spectating
Reply
#4

use
pawn Code:
ForceClassSelection(playerid);
Reply
#5

@Cypress: Did that. No luck. Also, there's nothing in my OnPlayerSpawn except SetPlayerSkin.
@Nero_3D: You mean, SetSpawnInfo(..) and then TogglePlayerSpectating(0)? If so, will try.
@Vanter: Maybe you should read again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)