Raised This Month: $ Target: $400
 0% 

Help with RATE checker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fannymagnet
Junior Member
Join Date: Mar 2005
Old 05-08-2005 , 16:30   Help with RATE checker
Reply With Quote #1

OK, I'm writing my first script but having problems. Here's the code >

Code:
#include <amxmodx> new PLUGIN[]="Rate_Checker" new AUTHOR[]="FannyMagnet" new VERSION[]="1.00" public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("amx_rc", "cmd_rc", ADMIN_SLAY, "<target> ") } public cmd_rc(id)   {     new user[32], rate[32], uid           read_argv(1,user,32) // Read first part after command     uid = find_player("bh",user) // Find user     get_user_info(uid, "rate", rate, 31) // Get the rate of the user from UID         client_print (id, print_chat, "Thier rate is %s",rate) // Print the result to the admin         return PLUGIN_HANDLED     }

However, when I run the command it just displays the name of the user. Or sometimes doesn't work at all. Can anyone point me in the right direction. I don't want you to finish it, just tell me where I'm going wrong so I can learn.

Is it something to do with strings and integers? Is the GET_USER_INFO returning an integer or string.

Also, can anyone explain the %s and %d in text outputs? I can't find anything on these but have seen them used, hense me using then in my script.

Thanks in advance.
fannymagnet is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-08-2005 , 16:43  
Reply With Quote #2

Hmm..
Code:
#include <amxmodx> #include <amxmisc> //This contains some useful functions #include <fun>     //This contains the function to change health new PLUGIN[]="Rate_Checker" new AUTHOR[]="FannyMagnet" new VERSION[]="1.00" public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_concmd("amx_rc", "cmd_rc", ADMIN_SLAY, "<target> ") } public cmd_rc(id,level,cid)    {     if(!cmd_access(id,level,cid,2)) { // If they don't have access         return PLUGIN_HANDLED     }     // command itself + the arg = 2     new user[32], rate[32]     // If the index for user is 32, then you want to     // put 32-1 (31) down here:         read_argv(1,user,31)     new uid = find_player("bh",user)     get_user_info(uid, "rate", rate, 31)         client_print (id, print_chat, "Their rate is %i",rate)     // %s - string     // %i - integer     // %d - decimal     // %f - float         return PLUGIN_HANDLED }
__________________
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
fannymagnet
Junior Member
Join Date: Mar 2005
Old 05-08-2005 , 16:53  
Reply With Quote #3

Cheers for that but I'm getting an error.

Now, when I enter amx_rc (the command) into the console it says Usage amx_rc <target> which is should. If I enter a username to execute the command on amx_rc username then nothing happens. When I check the logs it says

L 05/08/2005 - 21:49:05: [AMXX] Run time error 10 (native) (plugin "rates.amxx") - debug not enabled.



When I declare the variable RATE (rate[32]) is this declared as a string? If so then it can't be printed as an interger can it until it's converted?
fannymagnet is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-08-2005 , 17:32  
Reply With Quote #4

Try
Code:
new uid = cmd_target(id,user,0) if(!uid) {     return PLUGIN_HANDLED }
Instead of the other one.
__________________
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
Yuri
Senior Member
Join Date: May 2005
Location: Yuri's Cyber Cafe
Old 05-08-2005 , 17:43  
Reply With Quote #5

Why not

Code:
#include <amxmodx> #include <amxmisc> new PLUGIN[]="Rate_Checker" new AUTHOR[]="FannyMagnet" new VERSION[]="1.00" public plugin_init() {      register_plugin("PLUGIN,"VERSION,"AUTHOR")      register_concmd("amx_rc", "cmd_rc", ADMIN_SLAY, "<target> ") } public cmd_rc(id)    {     new user[32], rate[32], uid         read_argv(1,user,32) // Read first part after command     uid = find_player("bh",user) // Find user     get_user_info(uid, "rate", rate, 31) // Get the rate of the user from UID         client_print (id, print_chat, "Thier rate is %s",rate) // Print the result to the admin         return PLUGIN_HANDLED     } new uid = cmd_target(id,user,0) if(!uid) {     return PLUGIN_HANDLED }
Yuri is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-08-2005 , 17:52  
Reply With Quote #6

Just.. Shh..
__________________
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
Yuri
Senior Member
Join Date: May 2005
Location: Yuri's Cyber Cafe
Old 05-08-2005 , 17:54  
Reply With Quote #7

Oh because you know mine's better?
wooo
Yuri is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-08-2005 , 17:57  
Reply With Quote #8

No, it isn't. Quit trying to get your post count up by posting useless crap. kthnx
__________________
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
Yuri
Senior Member
Join Date: May 2005
Location: Yuri's Cyber Cafe
Old 05-08-2005 , 18:51  
Reply With Quote #9

Yuri is offline
fannymagnet
Junior Member
Join Date: Mar 2005
Old 05-09-2005 , 03:17  
Reply With Quote #10

Guy, guys, can't we all just get along?

Thanks for your help lads. The script is essentially working, except it's not displaying the RATE properly. Instead of 20000 which it should be (for the person I'm checking) it's showing 72 all the time. I'll figure it out, thanks for helping again.
fannymagnet is offline
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 16:38.


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