|
發表於 30-4-2008 09:28:17
|
顯示全部樓層
我琅呀,冇樂點啦/* AMX Mod X
* Custom Radio Commands
*
* (c) Copyright 2007 by KaLoSZyFeR
*
* This file is provided as is (no warranties)
*
* DESCRIPTION
* Plugin changes old and adds new customizable menu, allow hear custom radio
* commands, also included something like VEN's Real Radio
*
* FEATURES
* - custom radio commands (sounds and messages)
* - custom menus
* - real radio effect
*
*
* CVARS
* amx_real_radio (0: OFF, 1: ON, default: 1) - disables/enables real radio effect
* amx_radio_info (0: OFF, 1: ON, default: 1) - disables/enables viewing info about
* plugin on start of server
*
* VERSIONS
* 0.3 first release
* 0.4 menu and messages now are customizable
* 0.5 color of menu is customizable
*
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <csx>
#include <fakemeta>
new g_RadioTimer[33]
/* CONFIG SETUP */
new CRcoverme[64]
new CRtakepoint[64]
new CRhposition[64]
new CRregroup[64]
new CRfollowme[64]
new CRfireassis[64]
new CRgo[64]
new CRfallback[64]
new CRsticktog[64]
new CRgetinpos[64]
new CRstormfront[64]
new CRreportin[64]
new CRroger[64]
new CRenemys[64]
new CRbackup[64]
new CRclear[64]
new CRposition[64]
new CRreportingin[64]
new CRgetoutblow[64]
new CRnegative[64]
new CRenemydown[64]
new CRexit[64]
new CRcolortitle[2]
new CRcolormenu[2]
// Radio1 wav files
stock const radio1_spk[6][] ={
"radio/ct_coverme.wav",
"radio/takepoint.wav",
"radio/position.wav",
"radio/regroup.wav",
"radio/followme.wav",
"radio/fireassis.wav"
}
public radio1(id) { // Client used Radio1 commands
if(is_user_alive(id) == 0) return PLUGIN_HANDLED
// What Radio1 menu will look like
new key1 = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<9)
new menu_body1[512]
new len1 = format(menu_body1,511,"\%sRadio Commands A\%s^n\ ", CRcolortitle, CRcolormenu)
len1 += format( menu_body1[len1], 511-len1, "^n\ " )
len1 += format( menu_body1[len1], 511-len1, "1. %s^n\ ", CRcoverme)
len1 += format( menu_body1[len1], 511-len1, "2. %s^n\ ", CRtakepoint)
len1 += format( menu_body1[len1], 511-len1, "3. %s^n\ ", CRhposition)
len1 += format( menu_body1[len1], 511-len1, "4. %s^n\ ", CRregroup)
len1 += format( menu_body1[len1], 511-len1, "5. %s^n\ ", CRfollowme)
len1 += format( menu_body1[len1], 511-len1, "6. %s^n\ ", CRfireassis)
len1 += format( menu_body1[len1], 511-len1, "^n\ " )
len1 += format( menu_body1[len1], 511-len1, "0. %s", CRexit)
show_menu(id,key1,menu_body1) // Show the above menu on screen
return PLUGIN_HANDLED
}
public radio1cmd(id, key1) {
if(is_user_alive(id) == 0) return PLUGIN_HANDLED
if(g_RadioTimer[id] == 1) return PLUGIN_HANDLED
new players[32],total, team_name[10]
get_user_team(id,team_name, 9)
get_players(players, total ,"ce", team_name) // No bots and Match team name
new name[32]
get_user_name(id,name,31)
for(new a=0; a < total; ++a) {
client_cmd(players[a], "spk ^"%s^"", radio1_spk[key1])
if (get_cvar_num("amx_real_radio"))
{
emit_sound(id, CHAN_VOICE, radio1_spk[key1] , 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
}
//client_print(players[a],print_chat,"%s (RADIO): %s",name, radio1_say[key1])
new message1[64]
switch (key1) {
case 0: { // 1
message1 = CRcoverme
}
case 1: { // 2
message1 = CRtakepoint
}
case 2: { // 3
message1 = CRhposition
}
case 3: { // 4
message1 = CRregroup
}
case 4: { // 5
message1 = CRfollowme
}
case 5: { // 6
message1 = CRfireassis
}
}
client_print(players[a],print_chat,"%s (?∠???: %s",name, message1)
g_RadioTimer[id] = 1
set_task(2.0,"radiotimer",id)
}
return PLUGIN_HANDLED
}
// Radio2 wav files
stock const radio2_spk[6][] = {
"radio/com_go.wav",
"radio/fallback.wav",
"radio/sticktog.wav",
"radio/com_getinpos.wav",
"radio/stormfront.wav",
"radio/com_reportin.wav"
}
public radio2(id) { // Client used Radio2 commands
if(is_user_alive(id) == 0) return PLUGIN_HANDLED
// What Radio2 menu will look like
new key2 = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<9)
new menu_body2[512]
new len2 = format(menu_body2,511,"\%sRadio Commands B\%s^n\ ", CRcolortitle, CRcolormenu)
len2 += format( menu_body2[len2], 511-len2, "^n\ " )
len2 += format( menu_body2[len2], 511-len2, "1. %s^n\ ", CRgo)
len2 += format( menu_body2[len2], 511-len2, "2. %s^n\ ", CRfallback)
len2 += format( menu_body2[len2], 511-len2, "3. %s^n\ ", CRsticktog)
len2 += format( menu_body2[len2], 511-len2, "4. %s^n\ ", CRgetinpos)
len2 += format( menu_body2[len2], 511-len2, "5. %s^n\ ", CRstormfront)
len2 += format( menu_body2[len2], 511-len2, "6. %s^n\ ", CRreportin)
len2 += format( menu_body2[len2], 511-len2, "^n\ " )
len2 += format( menu_body2[len2], 511-len2, "0. %s", CRexit)
show_menu(id,key2,menu_body2) // Show the above menu on screen
return PLUGIN_HANDLED
}
public radio2cmd(id, key2) {
if(is_user_alive(id) == 0) return PLUGIN_HANDLED
if(g_RadioTimer[id] == 1) return PLUGIN_HANDLED
new players2[32],total2, team_name2[10] |
|