Junior Member
|
11-30-2011
, 07:41
Plugins NEW!
|
#1
|
PLUGIN1: sound player
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "play sound"
#define VERSION "1.0"
#define AUTHOR "Xscript"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("R_start",2,"1=Round_Start")
register_logevent("R_end",2,"1=Round_End")
register_logevent("hello",2,"1=entered the game")
}
public plugin_precache() {
precache_sound("misc/Rstart.wav")
precache_sound("misc/Rend.wav")
precache_sound("misc/hello.wav")
return PLUGIN_CONTINUE
}
public R_start(id) {
set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 3.0, 1.2, 1.3, 1.4)
show_hudmessage(id, "::Round start::")
client_cmd(id, "spk misc/Rstart.wav")
return PLUGIN_CONTINUE
}
public R_end(id) {
set_hudmessage(55, 200, 0, -1.0, -1.0, 0, 3.0, 1.2, 1.3, 1.4)
show_hudmessage(id, "::Round end::")
client_cmd(id, "spk misc/Rend.wav")
return PLUGIN_CONTINUE
}
public hello(id) {
set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 3.0, 1.2, 1.3, 1.4, 4)
show_hudmessage(id, "Hello client!")
client_cmd(id, "spk misc/hello.wav")
return PLUGIN_CONTINUE
}
PLUGIN2: HP Give menu
PHP Code:
#include <amxmodx>
#include <fun>
public plugin_init()
{
register_concmd("amx_hp", "menu", ADMIN_ADMIN)
}
public menu(id)
{
new menu = menu_create("Menu Name", "menu_handler")
menu_additem(menu, "Give 100 hp ", "1")
menu_additem(menu, "Give 500 hp ", "2")
menu_additem(menu, "Give 1000 hp ", "3")
menu_display(id, menu, 0)
}
public menu_handler(id, menu, item)
{
new maxdata[64], maxnames[64], access, callback
menu_item_getinfo(menu, item, access, maxdata, sizeof maxdata - 1, maxnames, sizeof maxnames - 1, callback)
new key = str_to_num(maxdata)
new health = get_user_health(id)
switch (key)
{
case 1:
{
set_user_health(id, health + 100)
}case 2:
{
set_user_health(id, health + 500)
}case 3:
{
set_user_health(id, health + 1000)
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
Plugin3: headshot sound
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
public plugin_init() {
register_plugin("headshot20hp", "1.0", "Xscript")
RegisterHam(Ham_Killed, "player", "PlayerKilledPost", 1)
}
public plugin_precache() {
precache_sound("misc/headshot.wav")
}
public PlayerKilledPost(victim, attacker, shouldgib)
{
if(!is_user_connected(attacker))
return PLUGIN_CONTINUE
if(victim == attacker)
return PLUGIN_CONTINUE
if(get_pdata_int(victim, 75) != HIT_HEAD)
return PLUGIN_CONTINUE
client_cmd(attacker,"spk misc/headshot.wav")
return PLUGIN_HANDLED
}
|
|