SA-MP Forums Archive
[+REP] TogglePlayerSpectating bug [+REP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [+REP] TogglePlayerSpectating bug [+REP] (/showthread.php?tid=600942)



[+REP] TogglePlayerSpectating bug [+REP] - ahmedraed - 14.02.2016

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;
}




Re: [+REP] TogglePlayerSpectating bug [+REP] - Dusan01 - 14.02.2016

Hmm, maybe anticheat is kicking you?


Re: [+REP] TogglePlayerSpectating bug [+REP] - ahmedraed - 14.02.2016

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..


Re: [+REP] TogglePlayerSpectating bug [+REP] - Virtual1ty - 14.02.2016

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)".


Re: [+REP] TogglePlayerSpectating bug [+REP] - Crystallize - 14.02.2016

TogglePlayerSpectating calls OnPlayerSpawn im sure about it


Re: [+REP] TogglePlayerSpectating bug [+REP] - ahmedraed - 14.02.2016

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


Re: [+REP] TogglePlayerSpectating bug [+REP] - PrO.GameR - 15.02.2016

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.


Re: [+REP] TogglePlayerSpectating bug [+REP] - ahmedraed - 15.02.2016

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