Now i am camping with a new problem,
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <colorchat>
#include <fakemeta>
#define PLUGIN "Dodgeball"
#define VERSION "1.0"
#define AUTHOR "Bilal"
new const Prefix[] = "[sG]"
new dodgeball[] = "models/sgknife/v_dodgeball.mdl";
new dodgeball2[] = "models/sgknife/p_dodgeball.mdl";
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon", "Knifemodel", "b", "1=1")
register_clcmd("say /menu", "CmdDodgeball")
}
public plugin_precache()
{
precache_model(dodgeball)
precache_model(dodgeball2)
}
public CmdDodgeball(id)
{
new menu = menu_create("Game:", "MenuHandler")
menu_additem(menu, "Dodgeball", "1")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public MenuHandler(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], szName[64], acces, callback
menu_item_getinfo(menu, item, acces, data, charsmax(data), szName, charsmax(szName), callback)
new key = str_to_num(data)
switch(key)
{
case 1: CmdDodgeball2(id)
}
return PLUGIN_HANDLED
}
public CmdDodgeball2(id)
{
new name[32], players[32], iNum
get_user_name(id, name, 31)
get_players(players, iNum, "ch")
for (new i; i <iNum; i++)
{
strip_user_weapons(players[i])
give_item(players[i], "weapon_hegrenade")
set_task(2.0, "GiveBalls", players[i], _,_, "b")
set_pev(players[i], pev_viewmodel2, dodgeball)
set_pev(players[i], pev_weaponmodel2, dodgeball2)
}
ColorChat(id, GREY, "%s ^4%s^1 has started the day: ^4Dodgeball", Prefix, name)
}
public GiveBalls(id)
{
if (is_user_alive(id))
{
give_item(id, "weapon_hegrenade")
}
}
public Knifemodel(id)
{
if (get_user_weapon(id) == CSW_HEGRENADE)
{
set_pev(id, pev_viewmodel2, dodgeball)
set_pev(id, pev_weaponmodel2, dodgeball2)
}
}
The first he which is given is shown as the model i wanted, but after i throw it away i get a new one ofcourse but i wont see the model of it
__________________