Raised This Month: $ Target: $400
 0% 

Set Health Command Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Minimum
Senior Member
Join Date: Jun 2006
Old 06-13-2006 , 17:33   Set Health Command Help
Reply With Quote #1

Ok, when I compile this I get an error stating argument type mismatch. It says its on the line where I have set_user_health. I tried to fix this in many different ways but it keeps showing this error. This is one problem I can't seem to figure out. I only included the public part of the code just so you know. This is part of a bigger plugin. Thanks in advance for any help.

Code:
public minisethealth(id) {     new entid, entbody, health[32]     read_argv(1,health,31)     remove_quotes(health)         // "You don't know who you messing with fool!"     if(!(get_user_flags(id) & ADMIN_SLAY)) {         client_print(id, print_console, "***Access Denied***^n")         return PLUGIN_HANDLED     }     if(equali(health,"")) {         client_print(id,print_console,"Usage: amx_sethealth <health>^n")         return PLUGIN_HANDLED     }     get_user_aiming(id,entid,entbody,9999)     // Are you looking at someone?     if(!is_user_connected(entid)) {         client_print(id,print_chat,"What are you looking at?  A wall?^n")         return PLUGIN_HANDLED     }         // Setting the health     set_user_health(entid, health)     return PLUGIN_HANDLED }
Minimum is offline
Send a message via AIM to Minimum Send a message via MSN to Minimum
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 06-13-2006 , 18:12  
Reply With Quote #2

Your "health" variable is a string. It needs to be an integer.
__________________
Brad is offline
lunarwolfx
Member
Join Date: Feb 2005
Old 06-13-2006 , 23:35  
Reply With Quote #3

Code:
new sethealth = str_to_num(health) set_user_health(entid,sethealth)
lunarwolfx 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 08:07.


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