View Full Version : Disable f4

12/01/2015, 12:45 PM
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!

12/01/2015, 01:00 PM
Look (http://forum.sa-mp.com/showthread.php?t=76416)

14/01/2015, 09:03 PM
i actually dont get it to be honest...

14/01/2015, 09:12 PM
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.