OnPlayerRequestClass -
Sascha - 17.02.2016
Hi,
I'm wondering when "OnPlayerRequestClass" is called and when it isn't.
I'm currently facing a weird bug on one of my scripts that I can't explain.
Obviously "OnPlayerRequestClass" is called once a player connected to the server if you don't force him to spawn immediately.
What else is calling this?
What I am aware of is pressing F4 and then dieing and "ForceClassSelection".
I aint having any problems with my spawn system, although once using "ForceClassSelection" is making my player return to class selection after each "reset" (TogglePlayerSpectating or death).
Re: OnPlayerRequestClass -
Sew_Sumi - 17.02.2016
OnPlayerRequestClass is when you switch skins from one to another, in the skin select screen. That's when it's called. There will be other places, but you could do a SendClientMessage to show where that the callback got called.
OnPlayerRequestSpawn is called when you click spawn.
Put this under OnPlayerRequestClass, right up top.
Code:
SendClientMessage(playerid, -1, "[DEBUG] OnPlayerRequestClass called");
Re: OnPlayerRequestClass -
Sascha - 18.02.2016
That's not what i mean... i obviously see when im in class selection, i want to know what is calling it
Re: OnPlayerRequestClass -
Sew_Sumi - 18.02.2016
Quote:
Originally Posted by Sew_Sumi
OnPlayerRequestClass is when you switch skins from one to another, in the skin select screen. That's when it's called.
|
Quote:
Originally Posted by Sascha
That's not what i mean... i obviously see when im in class selection, i want to know what is calling it
|
What? When you go left and right going through the skins, that is when that callback is called...
Re: OnPlayerRequestClass -
Sascha - 18.02.2016
....
I do not want to know how I can know that I am in class selection, I want to know what is making a player go into class selection...
Like: ForceClassSelection and F4 are making a player go into class selection, and I do want to know what else could possible make a player go in class selection.
I do not want to detect whether a player is in class selection, I want to know what sent him into it.
Update: For whoever that might care in some time: TogglePlayerSpectating does not reset the "ForceClassSelection" - you will continue being kept into class selection once you've used TogglePlayerSpectatinv after ForceClassSelection. At least this occures on my script.
Re: OnPlayerRequestClass -
puala123 - 18.02.2016
Man, i don't know what'ha fu**ck do you mean...but maybe if you want this for a command or something.. or... really don't know..
Quote:
ForceClassSelection(playerid);
|
Re: OnPlayerRequestClass -
Sascha - 18.02.2016
Quote:
Originally Posted by puala123
Man, i don't know what'ha fu**ck do you mean...but maybe if you want this for a command or something.. or... really don't know..
|
If you don't know what'ha fu**ck I mean, then why do you reply with such an idiot content?
Anyway, as I mentioned above:
If you use "TogglePlayerSpectating" after "ForceClassSelection" and before dieing, the player will be set to class selection each time he dies or leaves spectating mode, at least this is happening on my script.
Only way to prevent that is not to set player into spectation mode but killing him after using ForceClassSelection
... just sharing that incase anyone will face a similar issue later.
Re: OnPlayerRequestClass -
Slice - 18.02.2016
@puala123: Did you register your account just to say that?
Be wary of the return value in OnPlayerRequestClass. Returning 0 can cause strange behavior.
Also, F4/ForceClassSelection will keep going into class selection until the player dies (simply spawning does not stop it from happening).
This is clearly a bug in the SA-MP server but I doubt it will ever get fixed.
Re: OnPlayerRequestClass -
puala123 - 20.02.2016
Still not understand..