Raised This Month: $ Target: $400
 0% 

medic


Post New Thread Reply   
 
Thread Tools Display Modes
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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-17-2005 , 15:04  
Reply With Quote #2

bind "key" "fullupdate; amx_medicheal"

If you want to force a bind (which I would not do), use client_cmd to force the client to bind.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 02-17-2005 , 16:49  
Reply With Quote #3

i edited the file above i put it under
Code:
register_cvar("med_teamlimit", "1")
there was something else
devicenull was talking about
register_event("ResetHUD", "newround", "b")
Bad idea so i removed it
plz test this plugin
__________________
- Bye bye!
nightscreem is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 02-18-2005 , 10:42  
Reply With Quote #4

HELP
__________________
- Bye bye!
nightscreem is offline
NiGHTFiRE
Senior Member
Join Date: Dec 2004
Location: Sweden
Old 02-18-2005 , 11:52  
Reply With Quote #5

sorry but how do you quote and it says small?
NiGHTFiRE is offline
Send a message via AIM to NiGHTFiRE Send a message via MSN to NiGHTFiRE
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 02-18-2005 , 12:28  
Reply With Quote #6

type [ small] [/small] or pick the button right of the url button
can someone help me
__________________
- Bye bye!
nightscreem is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 02-18-2005 , 12:37  
Reply With Quote #7

Would this work? :
Code:
register_clcmd("fullupdate; amx_medicheal","Function",0,"Description")
Peli is offline
Send a message via MSN to Peli
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 02-18-2005 , 12:47  
Reply With Quote #8

i get compiling error
Quote:
//// medic.sma
// C:\Program Files\Valve\Steam\SteamApps\pipo1568@hotmail. com\dedicated server\
cstrike\addons\amxmodx\scripting\medic.sma(12 7) : warning 203: symbol is never u
sed: "AUTHOR"
// C:\Program Files\Valve\Steam\SteamApps\pipo1568@hotmail. com\dedicated server\
cstrike\addons\amxmodx\scripting\medic.sma(12 7) : warning 203: symbol is never u
sed: "PLUGIN"
// C:\Program Files\Valve\Steam\SteamApps\pipo1568@hotmail. com\dedicated server\
cstrike\addons\amxmodx\scripting\medic.sma(12 7) : warning 203: symbol is never u
sed: "VERSION"
//
// 3 Warnings.
// Done.
//
// Compilation Time: 0,11 sec
// ----------------------------------------

Press enter to exit ...
how can i get rid of it (127)=the last }
__________________
- Bye bye!
nightscreem is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 02-18-2005 , 13:16  
Reply With Quote #9

First change this line :
Code:
register_plugin("Medic","0.2","Nightscream")
To this :
Code:
register_plugin(PLUGIN, AUTHOR, VERSION)
And re-compile it.
Peli is offline
Send a message via MSN to Peli
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-18-2005 , 15:27  
Reply With Quote #10

Peli, I think he wants to bind a key to "fullupdate; amx_medicheal", not catch it.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
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 19:23.


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