Players undable to climb and jump - 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: Players undable to climb and jump (
/showthread.php?tid=498556)
Players undable to climb and jump -
ZeroTheScyther - 03.03.2014
Hello everyone. My question it's simple. How can I make a player unable to jump or climb? About the climbing, I saw something like getting the special action and then canceling the animation.
Re: Players undable to climb and jump -
Abagail - 03.03.2014
You could use key-presses. Be Creative.
Re: Players undable to climb and jump -
ZeroTheScyther - 03.03.2014
Quote:
Originally Posted by Abagail
You could use key-presses. Be Creative.
|
That should work but I wasn't (am not) really sure what to choose between OnPlayerKeyStateChange and OnPlayerUpdate...
Re: Players undable to climb and jump -
Dignity - 03.03.2014
I think I tried to make something like this before. Using OnPlayerKeyStateChange (Basically getting their position and setting them to it - aka not allowing the velocity increase was a method I found to work).
Try if this works (I think this is how the code should be):
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
return 1;
}
EDIT: You could've just asked me on Skype.
Re: Players undable to climb and jump -
ZeroTheScyther - 03.03.2014
Quote:
Originally Posted by Mionee
I think I tried to make something like this before. Using OnPlayerKeyStateChange (Basically getting their position and setting them to it - aka not allowing the velocity increase was a method I found to work).
Try if this works (I think this is how the code should be):
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys & KEY_JUMP) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z); } return 1; }
EDIT: You could've just asked me on Skype.
|
And Mionee saves the situation again ^-^ This is exactly and I mean EXACTLY what I was looking for. Thanks everyone :P