AlliedModders

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

nightscreem 02-17-2005 13:21

medic
 
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 }

XxAvalanchexX 02-17-2005 15:04

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.

nightscreem 02-17-2005 16:49

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

nightscreem 02-18-2005 10:42

HELP :!: :!:

NiGHTFiRE 02-18-2005 11:52

sorry but how do you quote and it says small?

nightscreem 02-18-2005 12:28

type [ small] [/small] or pick the button right of the url button
can someone help me

Peli 02-18-2005 12:37

Would this work? :
Code:
register_clcmd("fullupdate; amx_medicheal","Function",0,"Description")

nightscreem 02-18-2005 12:47

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 }

Peli 02-18-2005 13:16

First change this line :
Code:
register_plugin("Medic","0.2","Nightscream")
To this :
Code:
register_plugin(PLUGIN, AUTHOR, VERSION)
And re-compile it.

XxAvalanchexX 02-18-2005 15:27

Peli, I think he wants to bind a key to "fullupdate; amx_medicheal", not catch it.


All times are GMT -4. The time now is 19:23.

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