AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ts mod plug in needs "menu" help, please!! (https://forums.alliedmods.net/showthread.php?t=57875)

theSpecialist 07-13-2007 09:50

Ts mod plug in needs "menu" help, please!!
 
Hi,

Well basically its a plug-in called potti & I have modified it to work with TS mod, but I have too many commands people have to bind to make it work etc..


example of what i would like to do to it: say /x2menu

To have all the commands on screen something like this:


amx_botadd <name> - create a new bot
amx_botexec <cmd> - execute a command on your bot
amx_botmove <0> - off
amx_botmove <1> -copy your movements
amx_botmove <2> -same as #1 + aim the same spot when shooting
amx_botmove <3> -look the opposite way and do the opposite moves
amx_botcmds <0> - all owner commands are sent to his/her bot
amx_botcmds <1> - disable all owner commands are sent to his/her bot
amx_botdel - kick your bot off the server


Instead of how i have it now in its beta state where I have people on server binded all the commands to keys F5 thru like F11

========================


#include <amxmodx>
#include <amxmisc>
#include <fun>

new adrenaline_multiplier
new adrenaline_max
new adrenaline_toggle
new adrenaline_speed
new adrenaline_sound1
new adrenaline_sound2

new bool:playsound1
new bool:playsound2


new sound1[64] = "adrenaline_booster.wav"
new sound2[64] = "adrenaline_full.wav"
new sound1b[64] = "sound/adrenaline_booster.wav"
new sound2b[64] = "sound/adrenaline_full.wav"

new adrenaline[33]
new ability[33]
new grav[33]

new bool:restarting
new bool:freezetime

public plugin_init()
{
register_plugin("Adrenaline Mod","1.0","GHW_Chronic")

adrenaline_multiplier = register_cvar("adrenaline_amount","10")
adrenaline_max = register_cvar("adrenaline_max","100")
adrenaline_toggle = register_cvar("adrenaline_toggle","1")
adrenaline_speed = register_cvar("adrenaline_speed","950.0")

register_clcmd("say /theone","menu_cmd")

register_event("CurWeapon","CurWeapon","be")
register_event("DeathMsg","DeathMsg","a")

new name[32]
get_modname(name,31)
if(equali(name,"cstrike") || equali(name,"czero"))
{
register_logevent("game_restart2",2,"1=Round_ Start")
register_logevent("game_end",2,"1=Round_End")
}
register_event("TextMsg","game_restart1","a", "2=#Game_will_restart_in")
register_event("TextMsg","game_restart1","a", "2=#Game_Commencing")

register_menu("adrenaline_menu",(1<<0)|(1<<1) |(1<<2)|(1<<9),"menu_press")
}

public game_end()
{
new players[32], num
get_players(players,num,"h")
for(new i=0;i<num;i++)
{
ability[players[i]]=0
set_user_gravity(players[i])
}
freezetime=true
}

public game_restart1()
{
restarting = true
new players[32], num
get_players(players,num,"h")
for(new i=0;i<num;i++)
{
adrenaline[players[i]]=0
ability[players[i]]=0
set_user_gravity(players[i])
}
}

public game_restart2()
{
if(restarting && get_pcvar_num(adrenaline_toggle))
{
restarting=false
new players[32], num
get_players(players,num,"h")
for(new i=0;i<num;i++)
{
adrenaline[players[i]]=0
ability[players[i]]=0
set_user_gravity(players[i])
}
}
freezetime=false
}

public plugin_precache()
{
adrenaline_sound1 = register_cvar("adrenaline_sound1","1")
adrenaline_sound2 = register_cvar("adrenaline_sound2","1")
if(get_pcvar_num(adrenaline_sound1) && file_exists(sound1b))
{
playsound1=true
precache_sound(sound1)
}
if(get_pcvar_num(adrenaline_sound2) && file_exists(sound2b))
{
playsound2=true
precache_sound(sound2)
}
}

public DeathMsg()
{
if(get_pcvar_num(adrenaline_toggle) && !restarting)
{
new id = read_data(1)
new target = read_data(2)
ability[target]=0
set_user_gravity(target)
if(get_user_team(id)==get_user_team(target))
{
adrenaline[id] -= get_pcvar_num(adrenaline_multiplier)
if(adrenaline[id]<0) adrenaline[id]=0
}
else
{
new maxad = get_pcvar_num(adrenaline_max)
if(adrenaline[id]!=maxad)
{
adrenaline[id] += get_pcvar_num(adrenaline_multiplier)
if(adrenaline[id]>=maxad)
{
adrenaline[id]=maxad
if(playsound2) emit_sound(id,CHAN_VOICE,sound2,VOL_NORM,ATTN _NORM,0,PITCH_NORM)
client_print(id,print_chat,"[AMXX] Adrenaline Full! Type /theone to activate.")
}
}
}
}
}

public client_connect(id)
{
adrenaline[id]=0
ability[id]=0
grav[id]=0
set_task(0.5,"adrenaline_hud",id,"",0,"b")
}

public client_disconnect(id) remove_task(id)

public adrenaline_hud(id)
{
if(get_pcvar_num(adrenaline_toggle) && is_user_alive(id))
{
if(ability[id])
{
if(adrenaline[id]<=0)
{
ability[id]=0
set_user_gravity(id)
}
else adrenaline[id] -= 2
}

if(ability[id]==2 && get_user_health(id)<254) set_user_health(id,get_user_health(id) + 5)
else if(ability[id]==3 && grav[id])
{
grav[id] -= 5
set_user_gravity(id,250.0)
}

if(adrenaline[id]!=get_pcvar_num(adrenaline_max))
{
set_hudmessage(255, 255, 0, 0.90, 0.02, 0, 6.0, 1.0)
show_hudmessage(id,"--^n| %d^n--",adrenaline[id])
}
else
{
set_hudmessage(random_num(70,255), random_num(70,255), 0, 0.90, 0.02, 0, 6.0, 1.0)
show_hudmessage(id,"--^n| %d^n--",adrenaline[id])
}
}
}

public menu_cmd(id)
{
if(get_pcvar_num(adrenaline_toggle) && adrenaline[id]>=get_pcvar_num(adrenaline_max) && !restarting && !freezetime)
{
new message[1024]
new len = format(message,1023,"Booster Menu^n^n")
len += format(message[len],1023-len,"1. Speed^n")
len += format(message[len],1023-len,"2. Health^n")
len += format(message[len],1023-len,"3. Gravity^n^n")
len += format(message[len],1023-len,"0. Exit")
show_menu(id,(1<<0)|(1<<1)|(1<<2)|(1<<9),mess age,-1,"adrenaline_menu")
}
}

public menu_press(id,key)
{
if(get_pcvar_num(adrenaline_toggle) && !restarting && !freezetime)
{
switch(key)
{
case 0:
{
ability[id]=1
set_user_maxspeed(id,500.0)
}
case 1: ability[id]=2
case 2:
{
ability[id]=3
set_user_gravity(id,250.0)
grav[id] = 30
}
}
if(playsound1 && key!=9) emit_sound(id,CHAN_VOICE,sound1,VOL_NORM,ATTN _NORM,0,PITCH_NORM)
}
return PLUGIN_HANDLED
}

public CurWeapon(id)
{
if(get_pcvar_num(adrenaline_toggle) && !freezetime)
{
if(ability[id]==1)
{
client_cmd(id,"cl_forwardspeed 400;cl_backspeed 400;cl_sidespeed 400")
set_user_maxspeed(id,get_pcvar_float(adrenali ne_speed))
}
if(ability[id]==3 && grav[id]<200)
{
grav[id] += 20
set_user_gravity(id,250.0)
}
}
}

Drak 07-15-2007 06:40

Re: Ts mod plug in needs "menu" help, please!!
 
You can start by using tags ([code] [small],etc,etc). So the code is atleast readable.

I would also assume this thread belongs in "Suggestions/Requests" Since you don't need help, you want something.

theSpecialist 07-15-2007 11:13

Re: Ts mod plug in needs "menu" help, please!!
 
Thanks! I gave you some good karma points for your help! :shock::up:


All times are GMT -4. The time now is 21:33.

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