03.09.2016, 18:36
Hello, i was curious if this callback is called when a player disconnects if he is viewing the menu?? I could not find that on the wiki. Thank you.
public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { OnPlayerExitedMenu(playerid); return 1; }
^ And what if packet loss occurs and the server does not receive the packet that runs OnPlayerExitedMenu? causing OnPlayerExitedMenu to never run and something important in that function needs to run when a player disconnects? Better be safe then write code based on luck.
|
What are you talking about? The callback only handles the ID of the player, which OnPlayerDisconnect always gets right.
|
According to https://sampwiki.blast.hk/wiki/OnPlayerExitedMenu
Called when a player exits a menu. (Only when a player exits a menu) When a packet loss occurs, that callback is never called. Server might see the menu as open, even though it was closed client sided (p.s. "not even sure the server tracks opened menus making it possible to send repeated "exitmenu" packets. to be safe, make sure that callback is not called when a menu is not open"). OnPlayerExitedMenu does not get called when a player disconnects. It's like saying OnPlayerExitVehicle is called when a player disconnects. |
C:\Users\boksi\Desktop\SAMP reikalai\FunZoneLT\filterscripts\ADMINAS.pwn(6568) : warning 213: tag mismatch C:\Users\boksi\Desktop\SAMP reikalai\FunZoneLT\filterscripts\ADMINAS.pwn(6571) : warning 213: tag mismatch
if(examplemenu[playerid] != -1)
examplemenu[playerid] = -1;