AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I'm back (with a couple questions lol) (https://forums.alliedmods.net/showthread.php?t=13410)

BioHazardousWaste 05-15-2005 11:24

I'm back (with a couple questions lol)
 
Ok, sorry I had a bit of down time their guys. Was switching ISPs.

Anyways, it's back to work on 1337 Matrix Mod for me. I'm still having problems with those mines. I don't know what the hell the problem is, but they don't work right and the server just crashes. Xeroblood said he would help me, and I PMd him a few times and I haven't heard anything back. Would someone else mind trying to give me a hand?

The other thing I can't figure out is HyperJump. HyperJump is a key you have to hold down (e.x. bind "f" "+ma_hyperjump"). What it does is lowers your gravity while you hold the button down. Allowing you to temporarily jump higher/further and/or avoid fall damage. It looked pretty easy, but it's not working. According to the funcwiki 1 grav = 800, 2 grav = 1600 etc. So here's what I did:



Code:
public ToggleJumpOn(id) {     if(!is_user_alive(id))     {         client_print(id, print_center, "You cannot use Hyper Jump while dead!")         client_print(id, print_chat, "You cannot use Hyper Jump while dead!")         return PLUGIN_HANDLED     }     if(!PlayerSkill[id][SKILL_HYPERJUMP])     {         client_print(id, print_center, "You have not trained in Hyper Jump!")         client_print(id, print_chat, "You cannot use Hyper Jump while dead!")         return PLUGIN_HANDLED     }     if(PlayerFocus[id]<2)     {         client_print(id, print_center, "You do not have enough Focus to Hyper Jump!")         client_print(id, print_chat, "You do not have enough Focus to Hyper Jump!")         return PLUGIN_HANDLED     }     client_print(id, print_center, "Toggled HYPERJUMP {ON}")     PlayerIsHyperJumping[id] = 1     new Float:NewGrav     NewGrav = (1.2 - (PlayerSkill[id][SKILL_HYPERJUMP] * 0.01))     set_user_gravity(id, NewGrav)     return PLUGIN_HANDLED } public ToggleJumpOff(id) {     client_print(id, print_center, "Toggled HYPERJUMP {OFF}")     PlayerIsHyperJumping[id] = 0     set_user_gravity(id, 1)     return PLUGIN_CONTINUE }

PlayerSkill[id][SKILL_HYPERJUMP] will return that player's hyperjump skill. (A number between 0 and 100). "Focus" is similar to "Force Power" in Star Wars, it's what lets you do amazing things in the Matrix. What should happens is the higher your hyperjump skill is the more gravity should be lowered while you hold the button, and return to normal when you release. However, this doesn't happen.

teame06 05-15-2005 12:07

set_user_gravity(id, 1) to set_user_gravity(id, 1.0)

not sure if this is the problem. but i notice this.

BioHazardousWaste 05-15-2005 12:08

hmm, yeah i'll give that a try. Can't test alone though :(


All times are GMT -4. The time now is 16:45.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.