PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Admin Model Menu"
#define VERSION "1.0"
#define AUTHOR "Dimision"
#define ADMIN_LEVEL_Q ADMIN_LEVEL_C
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /vips", "admin")
}
public plugin_precache()
{
precache_model("models/player/tsw_stalin/tsw_stalin.mdl")
precache_model("models/player/tsw_hitler/tsw_hitler.mdl")
precache_model("models/player/tsw_usaozel/tsw_usaozel.mdl")
precache_model("models/player/tsw_bkomando/tsw_bkomando.mdl")
precache_model("models/player/tsw_zmsoldier/tsw_zmsoldier.mdl")
precache_model("models/player/tsw_zmofficer/tsw_zmofficer.mdl")
precache_model("models/player/tsw_naziozel/tsw_naziozel.mdl")
}
public admin(id)
{
if (get_user_flags(id) & ADMIN_LEVEL_H)
{
model_menu(id)
}
else
{
ChatColor(id, "!g>> !nBu menuye erisim icin !gVIP yetkisine sahip olmalisin !n!")
}
}
public model_menu(id)
{
new menu = menu_create("\r[\wV\rI\yP \wModel\r]\r", "menu_wybierz")
menu_additem(menu, "\wJoseph Stalin \yTakimi \w[\rCT\w]", "1", 0)
menu_additem(menu, "\wAdolf Hitler \yTakimi \w[\rT\w]", "2", 0)
menu_additem(menu, "\wU.S.A Ozel \yTakimi \w[\rCT\w]", "3", 0)
menu_additem(menu, "\wBaris Komandosu \yTakimi \w[\rCT\w]", "4", 0)
menu_additem(menu, "\wZombie Soldier \yTakimi \w[\rT\w]", "5", 0)
menu_additem(menu, "\wZombie Officer \yTakimi \w[\rT\w]", "6", 0)
menu_additem(menu, "\wNazi Ozel \yTakimi \w[\rT\w]", "7", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public menu_wybierz(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new acces, callback
menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1 : cs_set_user_model(id, "tsw_stalin")
case 2 : cs_set_user_model(id, "tsw_hitler")
case 3 : cs_set_user_model(id, "tsw_usaozel")
case 4 : cs_set_user_model(id, "tsw_bkomando")
case 5 : cs_set_user_model(id, "tsw_zmsoldier")
case 6 : cs_set_user_model(id, "tsw_zmofficer")
case 7 : cs_set_user_model(id, "tsw_naziozel")
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
stock ChatColor(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^4"); // Yesil
replace_all(msg, 190, "!n", "^1"); // Sari/Beyaz/Siyah
replace_all(msg, 190, "!t", "^3"); // Kirmizi/Mavi/gri
replace_all(msg, 190, "!t2", "^0"); // Kirmizi2/Mavi2/gri2
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}