09.09.2012, 13:00
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.
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;
}
public OnPlayerConnect(playerid)
{
TogglePlayerSpectating(playerid, 1);
return 1;
}
TogglePlayerSpectating(playerid, 0);
TogglePlayerSpectating(playerid, 1);
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;
}
public OnPlayerSpawn(playerid)
{
TogglePlayerSpectating(playerid, 0);
}