TogglePlayerSpectating cause player kick.
#1

I have TogglePlayerSpectating and i somewhere read that i need to have SetPlayerInfo to make it working. But i have SetPlayerInfo and when i start my server it shows: Server closed the connection.
Reply
#2

Can you show us your code please for it?
Reply
#3

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    if(PlayerInfo[playerid][Skin] == -1)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 249.8809, 1852.4695, 8.7625);
        SetPlayerCameraPos(playerid, 250.0132, 1849.3933, 8.7734);
        SetPlayerCameraLookAt(playerid, 249.8809, 1852.4695, 8.7625);
        SetPlayerFacingAngle(playerid, 177.0050);
    }
    else
    {
        SetSpawnInfo(playerid, 1, 0, 963.7003, -1616.3728, 14.7561, 180, 0, 0, 0, 0, 0, 0);
        SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
        SpawnPlayer(playerid);
    }
    return 1;
}
pawn Code:
public OnPlayerConnect(playerid)
{
    TogglePlayerSpectating(playerid, 1);
    return 1;
}
pawn Code:
TogglePlayerSpectating(playerid, 0);
on player login.
Reply
#4

BUMP

(i know, im bumping even if 24 hours aren't gone, but im in hurry, sorry)
Reply
#5

Well first off place.
pawn Code:
TogglePlayerSpectating(playerid, 1);
In the OnPlayerRequestClass public function, if you don't understand me:
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, 1);
    if(PlayerInfo[playerid][Skin] == -1)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 249.8809, 1852.4695, 8.7625);
        SetPlayerCameraPos(playerid, 250.0132, 1849.3933, 8.7734);
        SetPlayerCameraLookAt(playerid, 249.8809, 1852.4695, 8.7625);
        SetPlayerFacingAngle(playerid, 177.0050);
    }
    else
    {
        SetSpawnInfo(playerid, 1, 0, 963.7003, -1616.3728, 14.7561, 180, 0, 0, 0, 0, 0, 0);
        SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
        SpawnPlayer(playerid);
    }
    return 1;
}
And OnPlayerSpawn:
pawn Code:
public OnPlayerSpawn(playerid)
{
     TogglePlayerSpectating(playerid, 0);
}
Give it a shot, if not I'll think of another soloution.
Reply
#6

Tried million times.
Reply
#7

BUMP
Reply
#8

bumping topics without waiting for the time needed is breaking the rules please take notice to them or your pots can be removed and help will not be given
Reply
#9

Boy, check my bumping time. In first one I told my earlier bumping reason, and 24 are gone since my last bump so don't raise your Posts counter using those lame posts.
Reply
#10

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)