AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help? (https://forums.alliedmods.net/showthread.php?t=5381)

_Rustynails_ 08-30-2004 13:59

Help?
 
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)

Votorx 08-30-2004 14:05

Oye slim down your code!

the function cmd_access and cmd_target should get rid of like 80 of your if statements.

KRoT@L 08-30-2004 14:21

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 }


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

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