Raised This Month: $ Target: $400
 0% 

set_user_gravity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-27-2006 , 15:37   set_user_gravity
Reply With Quote #1

public mBoots(id) {
if (mBoot[id] > 0) {
new uGrav = get_user_gravity(id)
set_user_gravity(id,uGrav+(mBoot[id]*20))
}
return PLUGIN_CONTINUE
}

And the mBoot is in the top as "mBoot[33] = 1"
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-27-2006 , 15:51   Re: set_user_gravity
Reply With Quote #2

First, please put your code in [small]-Tag and indent it:
Code:
public mBoots(id) {     if (mBoot[id]>0)     {         new uGrav=get_user_gravity(id)         set_user_gravity(id,uGrav+(mBoot[id]*20))     }     return PLUGIN_CONTINUE }
Then, tell us what is your Problem!
I guess it tells you, that there is a Tag-Mismatch.
Instead of
Code:
new uGrav = get_user_gravity(id)
use
Code:
new Float:uGrav = get_user_gravity(id)
Also:
20 is an Integer, not a Float (Use: 20.0).
Also, this would increase the Players Gravity insanely high, not lower it.
Note, that get_user_gravity(id) and set_user_gravity does not work like
sv_gravity in Game. (Where 800 is normal Gravity) Here 1.0 is equal to 800 in Game
while 0.0 is equal to 0 in Game.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-27-2006 , 15:59   Re: set_user_gravity
Reply With Quote #3

Thanks duude

++karma
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-27-2006 , 16:05   Re: set_user_gravity
Reply With Quote #4

Well i've done this instead..

Code:
public mBoots(id) {     if (mBoot[id] = 1) { //line 98         set_user_gravity(id,0.9)     } else if (mBoot[id] = 2) { // line 100         set_user_gravity(id,0.7)     } else if (mBoot[id] = 3) { //line 102         set_user_gravity(id,0.4)     }     return PLUGIN_CONTINUE }

But now i get 3 warnings:

Warning: Possibly unintended assignment on line 98
Warning: Possibly unintended assignment on line 100
Warning: Possibly unintended assignment on line 102
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
jRaven
AMX Mod X Beta Tester
Join Date: Jan 2006
Location: IA, USA
Old 09-27-2006 , 16:11   Re: set_user_gravity
Reply With Quote #5

Code:
new var = 42
if (var == 1) { //if var is equal to the number 1
    do_stuff()
}
jRaven is offline
Send a message via ICQ to jRaven Send a message via AIM to jRaven
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 09-27-2006 , 16:14   Re: set_user_gravity
Reply With Quote #6

Well i know that, jRaven.
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 09-27-2006 , 16:23   Re: set_user_gravity
Reply With Quote #7

stigma

you are using "=" instead of "=="
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:46.


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