Raised This Month: $ Target: $400
 0% 

Help?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_Rustynails_
Junior Member
Join Date: Aug 2004
Old 08-30-2004 , 13:59   Help?
Reply With Quote #1

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() {   register_plugin("AMX-USERGRAVITY","0.1","Rustynails")   register_clcmd("amx_usergrav","do_grav",ADMIN_KICK) } public do_grav(id) {   new user[32], float:grav[32], uid   read_argv(1,user,31)   read_argv(2,grav,10)   uid = find_player("bl",user)   if (access(id,ADMIN_KICK)) {     if (uid) {       if (containi(grav, "") != -1) {         if (isdigit(grav)) {           if (!access(uid,ADMIN_IMMUNITY)) {             set_user_gravity(uid,grav)             console_print(id,"Set player's gravity.")             } else {             console_print(id,"That user is immune to this command.")           }           } else {           console_print(id,"Gravity must be in digit form.")         }         } else {         console_print(id,"You must include the gravity.")       }       } else {       console_print(id,"Could not find that user.")     }     } else {     console_print(id,"You lack sufficient access to this command.")   }   return PLUGIN_HANDLED }

I get these errors:

/home/users/amxmodx/tmp/phpgp6b56.sma(20) : error 035: argument type mismatch (argument 1)
/home/users/amxmodx/tmp/phpgp6b56.sma(22) : error 035: argument type mismatch (argument 2)
_Rustynails_ is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 08-30-2004 , 14:05  
Reply With Quote #2

Oye slim down your code!

the function cmd_access and cmd_target should get rid of like 80 of your if statements.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
KRoT@L
Member
Join Date: Aug 2004
Location: http://www.amxmod.net
Old 08-30-2004 , 14:21  
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() { register_plugin("AMX-USERGRAVITY","0.1","Rustynails") register_clcmd("amx_usergrav","do_grav",ADMIN_KICK) } public do_grav(id) { new user[32], grav[6], uid read_argv(1,user,31) read_argv(2,grav,5) uid = find_player("bl",user) if (access(id,ADMIN_KICK)) {     if (uid) {         if (containi(grav, "") != -1) {             if (isdigit(grav[0])&& isdigit(grav[1])&& isdigit(grav[2])&& isdigit(grav[3])&& isdigit(grav[4])&& isdigit(grav[5])) {                 if (!access(uid,ADMIN_IMMUNITY)) {                     set_user_gravity(uid,float(str_to_num(grav)))                     console_print(id,"Set player's gravity.")                 } else {                     console_print(id,"That user is immune to this command.")                 }             } else {                 console_print(id,"Gravity must be in digit form.")             }         } else {             console_print(id,"You must include the gravity.")         }     } else {         console_print(id,"Could not find that user.")     } } else { console_print(id,"You lack sufficient access to this command.") } return PLUGIN_HANDLED }
KRoT@L 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 17:17.


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