Raised This Month: $ Target: $400
 0% 

Private script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 06-25-2004 , 00:00   Private script
Reply With Quote #1

I'm trying to get this plugin to work on my server but having problems, I think it is done completly wrong too.
Code:
#include <amxmodx>   #include <amxmisc> public plugin_init(){     register_plugin("Slapall","1.0","Nick")     register_concmd("amx_slapall","admin_slapall",ADMIN_SLAY,": slaps everyone on map")     register_concmd("amx_slapdmg","amx_slappower",ADMIN_CVAR,": slap damage")     register_concmd("amx_numslaps","amx_numslaps",ADMIN_CVAR,": number of slaps")     register_cvar("sv_slappower","1")     register_cvar("sv_numslaps","50")     return PLUGIN_CONTINUE    }     public plugin_precache()           {           precache_sound("misc/tslap.wav")           }               public admin_slapall(id,level,cid) {     if (!cmd_access(id,level,cid,2)) {         return PLUGIN_HANDLED         }     new salist[32],pnum     get_players(salist, pnum ,"a")     for(new i=0; i<pnum; i++)     set_task(get_cvar_float("sv_slappower"),"slap_players",0, salist,1,"a", get_cvar_float("sv_numslaps"))     return PLUGIN_HANDLED } public amx_slappower(id,level,cid){     if (!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED     new arg[8]     read_argv(1,arg,7)     if ((str_to_num(arg) > 20) || (str_to_num(arg) < 1)){         console_print(id,"[AMXX] MAX slap power is 20")                 return PLUGIN_HANDLED        }     set_cvar_string("sv_slappower",arg)     return PLUGIN_HANDLED      }   public amx_numslaps(id,level,cid){     if (!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED     new arg[8]     read_argv(1,arg,7)     if ((str_to_num(arg) > 100) || (str_to_num(arg) < 2)){         console_print(id,"[AMXX] MAX slaps is 100")                 return PLUGIN_HANDLED        }     set_cvar_string("sv_numslaps",arg)     return PLUGIN_HANDLED      }
I get a tag mismatch warning ong this line:
Code:
set_task(get_cvar_float("sv_slappower"),"slap_players",0, salist,1,"a", get_cvar_float("sv_numslaps"))
__________________
Nick is offline
Send a message via MSN to Nick
Poison_Jay
Senior Member
Join Date: May 2004
Old 06-25-2004 , 00:54  
Reply With Quote #2

what happens if u compile it
Poison_Jay is offline
Send a message via MSN to Poison_Jay
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 06-25-2004 , 00:55  
Reply With Quote #3

Code:
set_task(get_cvar_float("sv_slappower"),"slap_players",0, salist,1,"a", get_cvar_float("sv_numslaps"))
__________________
Nick is offline
Send a message via MSN to Nick
BAILOPAN
Join Date: Jan 2004
Old 06-25-2004 , 01:49  
Reply With Quote #4

get_cvar_num() for the last parameter
__________________
egg
BAILOPAN is offline
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 06-25-2004 , 03:07  
Reply With Quote #5

alright anything else Im missing?
__________________
Nick is offline
Send a message via MSN to Nick
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 06-25-2004 , 03:12  
Reply With Quote #6

ok never had this before, it won't run the command I go amx_slapall and it just tells me the usage and does nothing.
__________________
Nick is offline
Send a message via MSN to Nick
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 06-25-2004 , 04:23  
Reply With Quote #7

I compiled without any errors but getting these error messages:

Code:
L 06/25/2004 - 01:11:18: [AMXX] Function is not present (function "slap_players") (plugin "amx_slapall.amx")
L 06/25/2004 - 01:11:18: [AMXX] Run time error 10 on line 60 (plugin "amx_slapall.amx")
Still the same line:
Code:
set_task(get_cvar_float("sv_slappower"),"slap_players",0, salist,1,"a", get_cvar_num("sv_numslaps"))

Anyone know what I'm doing wrong?
__________________
Nick is offline
Send a message via MSN to Nick
Neo-Vortex
Senior Member
Join Date: Jun 2004
Location: Australia
Old 06-25-2004 , 04:31   hmmm
Reply With Quote #8

looks as if you have a missing #include line (like the one for 'string' or something )
Neo-Vortex is offline
Mugwump
Senior Member
Join Date: May 2004
Old 06-25-2004 , 10:14  
Reply With Quote #9

slap_players is not a valid function, the correct function is slap_player (singular). You want your for() loop to be called once for each player with the set_task ...

Mugwump
Mugwump is offline
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 06-25-2004 , 11:25  
Reply With Quote #10

changed but, your saying its impossible to use set_task for what Im trying to do?
__________________
Nick is offline
Send a message via MSN to Nick
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 14:39.


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