Raised This Month: $ Target: $400
 0% 

medic


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 02-17-2005 , 13:21   medic
Reply With Quote #1

how can i do this in my plugin Bind a key to "fullupdate; amx_medicheal"
Code:
#include <amxmodx> #include <amxmisc> #include <fun> new PLUGIN[]="Medic" new AUTHOR[]="Nighscream" new VERSION[]="0.3" new helper[32] new teamers[33] new bool:startCOOL[33] = false new medpeople = 0 new med_id[32] new med_idp[32] new currhp new afterhp public plugin_init() {     register_plugin(PLUGIN, AUTHOR, VERSION)     register_clcmd("amx_medicheal","med_useability")     register_clcmd("amx_beamedic","med_become")     register_clcmd("amx_needmedic","med_help")     register_cvar("med_active","1")     register_cvar("med_cooldown","20.0")     register_cvar("med_hpgive","30")     register_cvar("med_teamlimit","1")     register_clcmd("fullupdate; amx_medicheal","Function",0,"Description") } public med_become(id) { if(get_cvar_num("med_active") == 0) { client_print(id,print_chat,"Medic not available") client_print(id,print_console,"Medic not available") return PLUGIN_HANDLED } if(get_cvar_num("med_teamlimit") > medpeople) { medpeople = medpeople + 1 get_user_authid(id,med_id,31) } return PLUGIN_CONTINUE } public med_useability(id){ new arg[32] read_argv(1,arg,31) new player = cmd_target2(id,arg) if (!player) return PLUGIN_HANDLED currhp = get_user_health(player) afterhp = get_cvar_num("med_hpgive") if(startCOOL[id]==true){ client_print(id,print_chat,"Cooldown not finished") return PLUGIN_HANDLED } get_user_authid(id,med_idp,31) get_user_authid(player,med_id,31) if(med_id[player] != med_idp[id]){ set_user_health(player,currhp + afterhp) startCOOL[id] = true new cooldownparm[1] cooldownparm[0]=id set_task(get_cvar_float("med_cooldown"),"med_useagain",50+id,cooldownparm,1) } return PLUGIN_HANDLED } public med_useagain(id) {     startCOOL[id] = false     return PLUGIN_CONTINUE } public newround(id){ if (task_exists(50 + id))       // Remove any current cooldowns     remove_task(50+id) } public med_help(id) { teamers[id]=get_user_team(id) get_user_name(id,helper,31) client_print(teamers[id],print_console,"%s needs a medic!",helper) client_print(teamers[id],print_chat,"%s needs a medic!",helper) return PLUGIN_CONTINUE } stock cmd_target2(id,const arg[]) {   new player = find_player("bl",arg)   if (player){     if ( player != find_player("blj",arg) ){       console_print(id,"There are more clients matching to your argument")       return 0         }   }   else if ( ( player = find_player("c",arg) )==0 && arg[0]=='#' && arg[1] )     player = find_player("k",str_to_num(arg[1]))       if (!player){     console_print(id,"Client with that name or userid not found")     return 0   }     return player }
__________________
- Bye bye!
nightscreem 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 19:23.


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