help me to create a sprite plugin
thanks for all who's help me
PHP Code:
#include <amxmodx>
#include <fun>
public plugin_init()
{
register_clcmd("say /menu", "menu")
}
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
}
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "play sound"
#define VERSION "1.0"
#define AUTHOR "made.tn"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("start",2,"1=Round_Start")
register_logevent("end",2,"1=Round_End")
register_logevent("welcome",2,"1=entered the game")
}
public plugin_precache() {
precache_sound("csound/roundstr.wav")
precache_sound("csound/roundend.wav")
precache_sound("csound/welcome.wav")
return PLUGIN_CONTINUE
}
public start(id) {
set_hudmessage(0, 255, 0, 0.20, -1.0, 0, 3.0, 1.2, 1.3, 1.4)
show_hudmessage(id, "::Round start::")
client_cmd(0, "spk csound/roundstr.wav")
return PLUGIN_CONTINUE
}
public end(id) {
set_hudmessage(55, 200, 0, 0.20, -1.0, 0, 3.0, 1.2, 1.3, 1.4)
show_hudmessage(id, "::round end::")
client_cmd(0, "spk csound/roundend.wav")
return PLUGIN_CONTINUE
}
public welcome(id) {
set_hudmessage(0, 255, 0, 0.20, -1.0, 0, 3.0, 1.2, 1.3, 1.4, 4)
show_hudmessage(id, "Hello client!")
client_cmd(0, "spk csound/welcome.wav")
return PLUGIN_CONTINUE
}
now I'd like to help me to create a plugin:
if the round end a sprite was exected to the Alive players
PHP Code:
#include <amxmodx>
#include <amxmisc>
// if there are others include write it
#define PLUGIN "Round end effect"
#define VERSION "1.0"
#define AUTHOR "made.tn"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("endspr",2,"1=Round_End")
}
public plugin_precache() {
precache_generic("example/example.spr")
return PLUGIN_CONTINUE
}
public endspr()
{
// what i do to exec this spr file "example/example.spr" to the alive Players
}
|