Quote:
Originally Posted by IamPRO
pawn Код:
//at the top will be good under the includes// new Float:SuperJump[3]; //anywhere outside all the call backs// CMD:superjump( playerid, params[ ] ) { #pragma unused params if(PlayerInfo[playerid][SjKey] == 1) { PlayerInfo[playerid][SjKey] = 0; SendClientMessage(playerid, COLOR_RED, "You turned off Super Jump {00FF00}(/Superjump)"); return 1; } else { PlayerInfo[playerid][SjKey] = 1; SendClientMessage(playerid, COLOR_RED, "You turned on Super Jump. Press {00FF00}LShift {FF0000}to use it"); return 1; } return 1; } //onplayerkeystatechange// if ( newkeys & KEY_JUMP && PlayerInfo[ playerid ][ SjKey ] == 1 ) { SetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]+5); return 1; } //At Onplayerupdate// GetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]);
Tested! works fine for me.
|
The SuperJump variable doesn't need to be a global it was fine within the scope of OnPlayerKeyStateChange (Local variable).