Raised This Month: $12 Target: $400
 3% 

amx_SLAM!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarlD
Senior Member
Join Date: Aug 2004
Old 12-26-2005 , 19:35   amx_SLAM!
Reply With Quote #1

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
__________________
DarlD is offline
Send a message via MSN to DarlD
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 12-26-2005 , 19:43  
Reply With Quote #2

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
Freecode is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-26-2005 , 19:47  
Reply With Quote #3

http://www.compuphase.com/pawn/pawn-lang.pdf
Brad is offline
DarlD
Senior Member
Join Date: Aug 2004
Old 12-26-2005 , 19:56  
Reply With Quote #4

Well, at least i tried... thanks for the help
__________________
DarlD is offline
Send a message via MSN to DarlD
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 02:51.


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