Disable f4 - 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: Disable f4 (
/showthread.php?tid=556993)
Disable f4 -
vassilis - 12.01.2015
Hello guys is there a way i could disable f4 system which will return to class selection after death?
Because i have a system where my players change skin at clothes shops!
Re: Disable f4 -
silenthill - 12.01.2015
Look
Re: Disable f4 -
vassilis - 14.01.2015
i actually dont get it to be honest...
Re: Disable f4 -
PowerPC603 - 14.01.2015
Save their skin in their playerdata array (or pData, or whatever you call it).
Also set a variable to "1" for example when they are allowed to return to class selection.
When they press F4, your script didn't set that variable to 1, so inside OnPlayerRequestClass you check if the variable is set to 1.
If it's set to 1, let them use OnPlayerRequestClass normally, to allow them choosing their skin.
If it's not set to 1, immediately spawn them using SpawnPlayer (first use SetSpawnInfo) and set their skin to the skin you saved earlier and exit the callback using return.
When they press F4 in that case and die, they will very briefly return to class-selection, but spawn right away, bypassing the skins in class-selection.