Post by smooth on Jul 9, 2023 13:25:36 GMT
Guys, i have found some plugins on the internet that allowes me to change the model of the player for admins (Instantly in the same map), the plugin compiles fine and it works in the game, but when i actually click on it, it doesn't do anything. i open the menu and choose the model i want, but it doesn't register my entry. as if i click 1 nothing happens and so on... could anyone fix it for me?
===================================================================================================================================
#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 /admodels", "admin")
}
public plugin_precache()
{
precache_model("models/player/Asasin/Asasin.mdl")
precache_model("models/player/Death/Death.mdl")
precache_model("models/player/Dobby/Dobby.mdl")
precache_model("models/player/Sonic/Sonic.mdl")
precache_model("models/player/Skeleton/Skeleton.mdl")
precache_model("models/player/Joker/Joker.mdl")
precache_model("models/player/Iron/Iron.mdl")
}
public admin(id)
{
if (get_user_flags(id) & ADMIN_LEVEL_H)
{
model_menu(id)
}
else
{
ChatColor(id, "!g>> !nAceste modele sunt doar pentru !gAdmini !n!")
}
}
public model_menu(id)
{
new menu = menu_create("\r[\wAdmin Models\r]\r", "menu_wybierz")
menu_additem(menu, "\wAsasin", "1", 0)
menu_additem(menu, "\wDeath", "2", 0)
menu_additem(menu, "\wDobby", "3", 0)
menu_additem(menu, "\wSonic", "4", 0)
menu_additem(menu, "\wSkeleton", "5", 0)
menu_additem(menu, "\wJoker", "6", 0)
menu_additem(menu, "\wIron", "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, "Asasin")
case 2 : cs_set_user_model(id, "Death")
case 3 : cs_set_user_model(id, "Dobby")
case 4 : cs_set_user_model(id, "Sonic")
case 5 : cs_set_user_model(id, "Skeleton")
case 6 : cs_set_user_model(id, "Joker")
case 7 : cs_set_user_model(id, "Iron")
}
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"); // verde
replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
write_byte(players);
write_string(msg);
message_end();
}
}
}
}
===================================================================================================================================
#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 /admodels", "admin")
}
public plugin_precache()
{
precache_model("models/player/Asasin/Asasin.mdl")
precache_model("models/player/Death/Death.mdl")
precache_model("models/player/Dobby/Dobby.mdl")
precache_model("models/player/Sonic/Sonic.mdl")
precache_model("models/player/Skeleton/Skeleton.mdl")
precache_model("models/player/Joker/Joker.mdl")
precache_model("models/player/Iron/Iron.mdl")
}
public admin(id)
{
if (get_user_flags(id) & ADMIN_LEVEL_H)
{
model_menu(id)
}
else
{
ChatColor(id, "!g>> !nAceste modele sunt doar pentru !gAdmini !n!")
}
}
public model_menu(id)
{
new menu = menu_create("\r[\wAdmin Models\r]\r", "menu_wybierz")
menu_additem(menu, "\wAsasin", "1", 0)
menu_additem(menu, "\wDeath", "2", 0)
menu_additem(menu, "\wDobby", "3", 0)
menu_additem(menu, "\wSonic", "4", 0)
menu_additem(menu, "\wSkeleton", "5", 0)
menu_additem(menu, "\wJoker", "6", 0)
menu_additem(menu, "\wIron", "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, "Asasin")
case 2 : cs_set_user_model(id, "Death")
case 3 : cs_set_user_model(id, "Dobby")
case 4 : cs_set_user_model(id, "Sonic")
case 5 : cs_set_user_model(id, "Skeleton")
case 6 : cs_set_user_model(id, "Joker")
case 7 : cs_set_user_model(id, "Iron")
}
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"); // verde
replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
write_byte(players);
write_string(msg);
message_end();
}
}
}
}