searching for a callback... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: searching for a callback... (
/showthread.php?tid=84571)
searching for a callback... -
Ignas1337 - 01.07.2009
What's the callback when player has f4 pressed and dies and what does he go to next? I want to disable f4 function. is it possible to disable it on player press f4 to not work or something? I have m own system of classes/whatever. Is it possible? And what do I need to change? I didn't script anything yet, just optimising my callbacks/code for now
Re: searching for a callback... -
refshal - 01.07.2009
I don't think so. I think that this function includes in your SA-MP. But I'm not sure...
Re: searching for a callback... -
Vince - 01.07.2009
Well, that F4 function is hardcoded into sa-mp ... When F4 is pressed and the player dies, the OnPlayerRequestClass is called.
Re: searching for a callback... -
Ignas1337 - 01.07.2009
uh huh, ok. That means I can check if player recently died and if he goes to that function and spawn him reseting the params that are neededto be setted by my script, yes?
Re: searching for a callback... -
dice7 - 01.07.2009
I think you can go pass it by adding SpawnPlayer(playerid) under OnPlayerDeath
Re: searching for a callback... -
kaisersouse - 01.07.2009
Quote:
Originally Posted by Izanagi
uh huh, ok. That means I can check if player recently died and if he goes to that function and spawn him reseting the params that are neededto be setted by my script, yes?
|
one thing you can try is setting a flag in onplayerconnect as true, and then checking that flag in onplayerrequestclass. if flag is true, let them choose a skin and then set it to false. This way if they then re-enter onplayerrequestclass it will see that the flag is set to false and you can have it respawn the player without letting them select a new skin. Does that make any sense (i think im rambling)?
Re: searching for a callback... -
Ignas1337 - 01.07.2009
that's a way, but they cannot spawn by selecting a class cause I use my login script to spawn them. Hmm.. I wonder what happens if I add no classes? I'll test that
Re: searching for a callback... -
Vince - 01.07.2009
Probably you will just get stuck on the Vinewood screen since there are no classes to display.
Re: searching for a callback... -
Ignas1337 - 02.07.2009
Nope, not stuck. only cannot spawn

pp anyway since I use my login script to spawn players it's fine.
Re: searching for a callback... -
Gappy - 02.07.2009
The easiest way to disable the class selection is to put:
under:
pawn Code:
OnPlayerRequestClass(playerid, classid)