SA-MP Forums Archive
Class selection dialog bug with F4 key. - 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: Class selection dialog bug with F4 key. (/showthread.php?tid=579828)



Class selection dialog bug with F4 key. - iOxide - 30.06.2015

I am using a dialog for class selection menu in OnPlayerRequestClass, everything works fine but i got one issue.

If a player presses F4 only ONCE and after they die, it sends them to class selection screen and they can choose a class and spawn, OK. But, whenever they presses F4 twice, thrice or even more and it sends them to class selection the next death, players aren't able to spawn after selecting the class. It keeps popping up the class selection dialog more and more instead of spawning them. I've even tried setting some vars to check if the player is switching class or not, then show the dialog etc. but it just don't work. Any ideas?


Re: Class selection dialog bug with F4 key. - Youssef221 - 30.06.2015

It's a SAMP bug, why don't make a command that sends them to the class selection screen?


Re: Class selection dialog bug with F4 key. - iOxide - 30.06.2015

Quote:
Originally Posted by Youssef221
Посмотреть сообщение
It's a SAMP bug, why don't make a command that sends them to the class selection screen?
I do have a command, but you know most of the people use /kill + F4 instead of asking admins whats the command to switch class. So i wanted to make it working with both built in command and with F4. I've seen a server which has same class selection system as mine and it has no bug like that so i guess there's a way to fix it.


Re: Class selection dialog bug with F4 key. - iOxide - 01.07.2015

/Bump, still didn't find any ways to fix it. Anyone help please.


Re: Class selection dialog bug with F4 key. - Suicidal.Banana - 01.07.2015

You can try use the variable you described (that defines if a player is in class selection or not) to decide to return 0 in OnPlayerRequestClass and/or OnPlayerRequestSpawn, that way if somebody does /kill or F4 when already in class selection nothing should change.