Raised This Month: $ Target: $400
 0% 

help with this


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lotion
Member
Join Date: Apr 2005
Old 06-30-2006 , 07:21   help with this
Reply With Quote #1

I'm kind of stumped on this.

Code:
    new speed = str_to_num(buffer)     set_user_maxspeed(id, %i, speed)     client_cmd(id,"cl_forwardspeed %i", speed)     client_cmd(id,"cl_sidespeed %i", speed)     client_cmd(id,"cl_backspeed %i", speed)
you can probably see what I'm trying to do, but I know im doing this wrong somehow. Speed is a variable pulled out of mysql. I can't figure out how to do this. Ive never really done anything with variables and doing this.
Lotion is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-30-2006 , 08:17   Re: help with this
Reply With Quote #2

set_user_maxspeed(id, float(speed));

;)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-30-2006 , 12:29   Re: help with this
Reply With Quote #3

I think the better way would be:

Code:
new Float:speed = str_to_float(buffer) set_user_maxspeed(id, speed) client_cmd(id,"cl_forwardspeed %f", speed) client_cmd(id,"cl_sidespeed %f", speed) client_cmd(id,"cl_backspeed %f", speed)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Lotion
Member
Join Date: Apr 2005
Old 07-02-2006 , 16:05   Re: help with this
Reply With Quote #4

ah,thanks

EDIT: I tried it Hawk552, and I gueds str_to_float didn't exist in amxx 1.01? Or I'm not using the right includes? I get an unidentified symbol error.

Last edited by Lotion; 07-02-2006 at 20:56.
Lotion is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 07-02-2006 , 20:38   Re: help with this
Reply With Quote #5

Quote:
Originally Posted by Lotion
ah,thanks

EDIT: tryed it Hawk552 and I gues str_to_float didnt exist in amxx 1.01? Or i'm not using the righ includes? I get an unidentified symbol error
Try floatstr, I think it's in 1.01.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Lotion
Member
Join Date: Apr 2005
Old 07-02-2006 , 21:01   Re: help with this
Reply With Quote #6

Yeah it is, looked in the inc. How do I use it? I'm pretty new to amxx scripting and this is going to be my first major plugin. I'm not really sure how to interpret incs. Would I use it like this?

Code:
    new float:speed = floatstr(buffer)     set_user_maxspeed(id,speed)     client_cmd(id,"cl_forwardspeed %f", speed)     client_cmd(id,"cl_sidespeed %f", speed)     client_cmd(id,"cl_backspeed %f", speed)

Yep, apparently thats how you use it.
Thanks bud, works now.

Last edited by Lotion; 07-02-2006 at 21:05.
Lotion is offline
Reply


Thread Tools
Display Modes

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 08:00.


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