Raised This Month: $ Target: $400
 0% 

cvar not working


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Shibz
Junior Member
Join Date: Apr 2004
Old 05-31-2004 , 23:06   cvar not working
Reply With Quote #1

This is my first plugin. I just did this to learn, do plz don't tell me that this has already been done because I know. Anyway, with much help from Bailopan, I got this plugin working on everything except the part where it spaces out the slaps using the cvar amx_bslaptime. Instead, it just does them very rapidly, probably at 10 per second or more.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init(){     register_plugin("Big Slap","0.0.1","Shibz")     register_concmd("amx_bslap","cmdSlap",ADMIN_SLAY,"<name or #userid> [power] [times]")     register_cvar("amx_bslaptime",".2") } public cmdSlap(id,level,cid){     if (!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,5)     if (!player) return PLUGIN_HANDLED     new spower[32],authid[32],name2[32],authid2[32],name[32],stimes[32]     read_argv(2,spower,31)     read_argv(3,stimes,3)     new damage = str_to_num(spower)     new times = str_to_num(stimes)     new Float:delay = get_cvar_num("amx_bslaptime")     new TaskParams[2]     TaskParams[0] = player     TaskParams[1] = damage     set_task(delay, "slap_player", 0, TaskParams, 2, "a", times)     get_user_authid(id,authid,31)     get_user_name(id,name,31)     get_user_authid(player,authid2,31)     get_user_name(player,name2,31)     log_amx("Cmd: ^"%s<%d><%s><>^" slap with %d damage %d times ^"%s<%d><%s><>^"",         name,get_user_userid(id),authid, damage, times,name2,get_user_userid(player),authid2 )         switch(get_cvar_num("amx_show_activity")) {     case 2: client_print(0,print_chat,"ADMIN %s: slap %s with %d damage %d times",name,name2,damage,times)     case 1: client_print(0,print_chat,"ADMIN: slap %s with %d damage %d times",name2,damage,times)     }                 console_print(id,"[AMXX] Client ^"%s^" slaped with %d damage %d times",name2,damage,times)       return PLUGIN_HANDLED }
Shibz is offline
 


Thread Tools
Display Modes

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:36.


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