Server Closed Connection when spawning?
#1

Hey, I am currently scripting a RP script from scratch. And when i spawn, i get Server Closed connection. There is no errors in the script or the logs. The server dosent close it self, i just get dced from the server.

This is my OnPlayerSpawn code:

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerColor(playerid,COLOR_WHITE);
    new cash = PlayerInfo[playerid][pCash];
    new score = PlayerInfo[playerid][pScore];
    GivePlayerMoney(playerid,cash);
    SetPlayerScore(playerid,score);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    TogglePlayerSpectating(playerid, 0);
    SetPlayerPos(playerid, 1007.0414,-1387.0471,13.3421);
    return 1;
}
OnPlayerRequestClass code:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, 1);
    return 1;
}
dont know whats wrong.

If you need some other codes, write below.

Thankful for help, cant figure out whats wrong.
Reply
#2

There are like hundreds of such topics;

https://sampforum.blast.hk/showthread.php?tid=320794

Just use SetSpawnInfo before using SpawnPlayer and you should be alright
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)