AlliedModders

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

DarlD 12-26-2005 19:35

amx_SLAM!
 
okay, i've created a plugin (more like an amxx addon) called amx_SLAM!


Code:
#include <amxmodx> #include <amxmisc> #include <fun> new s_name[32],s_target[32],s_name2[32],s_times[101],arg[32], arg1[32],arg2[32],s_damage public plugin_init() {     register_plugin("amx_SLAM!", "1.0", "DarlD")     register_clcmd("SLAM!","func_slam",ADMIN_SLAY,"SLAM! <Target> <Damage> <Times>") } public func_slam(id, level, cid) {         get_user_name(id,s_name,31)         if (!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED         s_target = cmd_target(id,arg,5)         get_user_name(s_target,s_name2,31)         read_argv(2,arg1,31)     read_argv(3,arg2,31)         slam(s_target,arg1,arg2)         client_print(id ,print_console,"[AMXX] %s used SLAM! on %s",s_name,s_name2)     client_print(0, print_chat,"[AMXX] %s used SLAM! on %s",s_name,s_name2)         log_amx("ADMIN %s used SLAM! cmd on %s",s_name,s_name2)         return PLUGIN_CONTINUE } public slam(s_target,arg1,arg2) {         new origin[3],old_origin[3];new i = 0         get_user_origin(s_target, old_origin, 0)     get_user_origin(s_target, origin, 0)         if (old_origin[2] == origin[2])         return PLUGIN_CONTINUE             origin[2] = origin[2] + 50         set_user_origin(s_target, origin)         s_damage = read_argv(2, arg1, 31)     s_times = read_argv(3,arg2,31)         user_slap(s_target, s_damage, 1)         for (i < s_times; i++)         return PLUGIN_CONTINUE     }

i get these errors when i compile:

Code:



/home/users/amxmodx/tmp3/phpg7aoed.sma(19 -- 21) : error 033: array must be indexed (variable "s_target")
/home/users/amxmodx/tmp3/phpg7aoed.sma(21) : error 035: argument type mismatch (argument 1)
/home/users/amxmodx/tmp3/phpg7aoed.sma(26) : error 035: argument type mismatch (argument 1)
/home/users/amxmodx/tmp3/phpg7aoed.sma(50) : error 035: argument type mismatch (argument 2)
/home/users/amxmodx/tmp3/phpg7aoed.sma(51) : error 035: argument type mismatch (argument 2)
/home/users/amxmodx/tmp3/phpg7aoed.sma(51 -- 53) : error 033: array must be indexed (variable "s_times")
/home/users/amxmodx/tmp3/phpg7aoed.sma(55) : error 033: array must be indexed (variable "s_times")
/home/users/amxmodx/tmp3/phpg7aoed.sma(59) : warning 209: function "slam" should return a value


Freecode 12-26-2005 19:43

wow. i would say learn arrays first. Its obviously you dont understand how they work. your s_target array is all over the place like its a regular var when its an array

Brad 12-26-2005 19:47

http://www.compuphase.com/pawn/pawn-lang.pdf

DarlD 12-26-2005 19:56

Well, at least i tried... thanks for the help


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

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