[+REP] TogglePlayerSpectating bug [+REP]
#1

Hello guys, so i got this issue from some days..when i toggleplayerspectating to 1 so he cant see the Spawn buttons and then when i toggle it to 0 he gets kick (Server Closed The Connection)..wired ha?

Quote:

if(dialogid == TEAM_DIALOG)
{
if(response)
{
switch(listitem)
{
case 0:
{
TogglePlayerSpectating(playerid, 1);

}
}
}
return 1;
}

Quote:

if(dialogid == CLASS_DIALOG)
{
if(response)
{
switch(listitem)
{
case 0:
{
TogglePlayerSpectating(playerid, 0);
}
}
}
return 1;
}

Reply
#2

Hmm, maybe anticheat is kicking you?
Reply
#3

well..i removed all Kick and Ban functions from the script and tried but well still says server closed the connection
Note: OnPlayerSpawn doesn't get called..
Reply
#4

There's no bug with TogglePlayerSpectating. It's your code.

The only perhaps, undesired thingy would be that it DOES CALL OnPlayerSpawn when you "TogglePlayerSpectating(playerid, false)".
Reply
#5

TogglePlayerSpectating calls OnPlayerSpawn im sure about it
Reply
#6

Quote:
Originally Posted by Wizzard2H
Посмотреть сообщение
TogglePlayerSpectating calls OnPlayerSpawn im sure about it
Yep it does..but when i use it like that it doesn't and i already tried debugging it by formating a message on the server log so...it just says Server Closed The Connection so..any ideas guys!? or something you want from me to show to you?!even we can have a skype call and screenshare the code to check it
Reply
#7

Here is the reason you should SEARCH first..
This is a very old problem, solution is simple, you should have a SetSpawnInfo before toggling the spectating off, If there is no SpawnInfo when you toggle it off player gets kicked.
Reply
#8

Quote:
Originally Posted by PrO.GameR
Посмотреть сообщение
Here is the reason you should SEARCH first..
This is a very old problem, solution is simple, you should have a SetSpawnInfo before toggling the spectating off, If there is no SpawnInfo when you toggle it off player gets kicked.
ahh..didn't know that i just searched on wiki about the function but never heard about something like that w/e i will try that and tell you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)