AlliedModders

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

tripc 02-12-2007 16:55

Headshot plugin
 
i want to made plugin when the cvar "sv_head" is "1"
then set_user_hitzones(0 ,0, 2)

when the cvar is 0 "sv_head" is "0"
then set_user_hitzones(0 ,0, 255)

and when someone connect to server check if the "sv_head" is "1/0"
for set the hitzones

Sry of bad english

[ --<-@ ] Black Rose 02-13-2007 11:03

Re: Headshot plugin
 
make "sv_head" a command and change a variable to enable/disable mod.

tripc 02-13-2007 17:42

Re: Headshot plugin
 
if i was know how to do this
i was do it myself without ask

so i need your help if you can help me

[ --<-@ ] Black Rose 02-13-2007 18:03

Re: Headshot plugin
 
Code:
#include <amxmodx> #include <fun> #define ADMIN_LEVEL ADMIN_KICK new g_maxplayers, g_head new bool:g_restart_attempt[33] public plugin_init() {     register_plugin("", "", "")     register_concmd("sv_head", "cmd_head", ADMIN_LEVEL)         register_event("ResetHUD", "event_hud_reset", "be")     register_clcmd("fullupdate", "clcmd_fullupdate")     register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in")         g_maxplayers = get_maxplayers() } public cmd_head(id) {     if ( ! ( get_user_flags(id) & ADMIN_LEVEL ) )         return PLUGIN_CONTINUE         new arg[2]     read_argv(1, arg, 1)         if ( arg[0] == '1') {         g_head = 1         for ( new i ; i < g_maxplayers ; i++ ) {             if ( is_user_alive(i) )                 set_user_hitzones(i ,0, 2)         }     }         else if ( arg[0] == '0' ) {         g_head = 0         for ( new i ; i < g_maxplayers ; i++ ) {             if ( is_user_alive(i) )                 set_user_hitzones(i ,0, 255)         }     }         return PLUGIN_HANDLED } public clcmd_fullupdate() {     return PLUGIN_HANDLED } public event_restart_attempt() {     new players[32], num     get_players(players, num, "a")     for ( new i ; i < num ; ++i )         g_restart_attempt[players[i]] = true } public event_hud_reset(id) {     if ( g_restart_attempt[id] ) {         g_restart_attempt[id] = false         return     }     if ( g_head )         set_user_hitzones(id, 0, 2) }

tripc 02-18-2007 15:18

Re: Headshot plugin
 
but its concmd not cvar
this taken from hitbot.sma plugin

but i need with cvar not concmd

[ --<-@ ] Black Rose 02-18-2007 15:57

Re: Headshot plugin
 
why?

Davidos 02-18-2007 16:04

Re: Headshot plugin
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 442175)
why?

because a cvar can be changed <sv_head 0/1>

a concmd can not, apparently that's what he thinks...

tripc 02-19-2007 00:17

Re: Headshot plugin
 
i didnt say concmd can't change,
i want cvar because any admin can do it if he dont have admin in AMXX

now you know why

[ --<-@ ] Black Rose 02-19-2007 02:59

Re: Headshot plugin
 
Quote:

Originally Posted by tripc (Post 442308)
i didnt say concmd can't change,
i want cvar because any admin can do it if he dont have admin in AMXX

now you know why

If he don't have admin in AMXx he is not admin at all.
Just remove the check of admin level then.

tripc 02-21-2007 19:30

Re: Headshot plugin
 
he admin in 'adminmod'
i have adminmod+amxmodx in my server


All times are GMT -4. The time now is 00:45.

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