AlliedModders

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

Nick 06-25-2004 00:00

Private script
 
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"))

Poison_Jay 06-25-2004 00:54

what happens if u compile it

Nick 06-25-2004 00:55

Code:
set_task(get_cvar_float("sv_slappower"),"slap_players",0, salist,1,"a", get_cvar_float("sv_numslaps"))

BAILOPAN 06-25-2004 01:49

get_cvar_num() for the last parameter

Nick 06-25-2004 03:07

alright anything else Im missing?

Nick 06-25-2004 03:12

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 06-25-2004 04:23

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?

Neo-Vortex 06-25-2004 04:31

hmmm
 
looks as if you have a missing #include line (like the one for 'string' or something :P)

Mugwump 06-25-2004 10:14

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

Nick 06-25-2004 11:25

changed but, your saying its impossible to use set_task for what Im trying to do?


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

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