[Help]SuperJump - 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: [Help]SuperJump (
/showthread.php?tid=367006)
[Help]SuperJump -
.Campionull. - 08.08.2012
Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new SuperJump[MAX_PLAYERS] = 0;
OnPlayerKeysStateChange
Код:
if (PRESSED(KEY_JUMP))
{
if(SuperJump[playerid] == 0) return 0;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z + 10.0);
}
OnPlayerCommandText
Код:
if(strcmp(cmd, "/superjump", true)==0 || strcmp(cmd, "/sj", true)==0)
{
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,COLOR_YELLOW,"* Sorry, only level 3+ Admins can use the superjump commmand.");
if (SuperJump[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "* SuperJump ENABLED...");
SuperJump[playerid] = 1;
return 1;
}
else if(SuperJump[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "* SuperJump DISABLED");
SuperJump[playerid] = 0;
return 1;
}
}
What's wrong
Re: [Help]SuperJump -
[FSaF]Jarno - 08.08.2012
"What's wrong"
We could actually be asking that from you. You just gave us the code and told nothing about your problem...
Re: [Help]SuperJump -
.Campionull. - 08.08.2012
/superjump shoud make me jump high but its not working
Re: [Help]SuperJump -
Dan. - 08.08.2012
Basically, what your code does, is that when he presses jump he will be teleported into the air above him (like slap command). You could try, when a player types /superjump, then you will set his gravity lower, so he will jump higher.
https://sampforum.blast.hk/showthread.php?tid=113485
Respuesta: [Help]SuperJump -
Convex - 08.08.2012
Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
and jump key
Код:
if(PRESSED(KEY_JUMP))
{
new Float:P[3];
GetPlayerPos(playerid,P[0],P[1],P[2]);
GetPlayerVelocity(playerid,P[0],P[1],P[2]);
SetPlayerVelocity(playerid,P[0],P[1],P[2]+5.0);
}
return 1;
}
have fun ! xd