AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   vip_knife_menu.amxx v_zoom.mdl wrong version 0 should be 30 (https://forums.alliedmods.net/showthread.php?t=320500)

barbergaming 12-24-2019 22:39

vip_knife_menu.amxx v_zoom.mdl wrong version 0 should be 30
 
Hello guys i just need to remove the "zoom.mdl" knife model and recomplie this plugin im tired from searshing and edditing plzz if someone know how this is the sma note=i dont know if the sma right but try to do your best and thanx :bacon:
this is the link from where i get this plugin = https://forum.kgb-hosting.com/showthread.php?t=91985

new TeamName[4][0] =
{
{
0, ...
},
{
84, ...
},
{
67, ...
},
{
83, ...
}
};
new VERSION[4] =
{
49, 46, 48, 0
};
new COLOR[2] =
{
4, 0
};
new CONTACT[1];
new pcvar_on;
new maxplayers;
new gmsgSayText;
new pcvar_obavestenje;
new jumpnum[33];
new bool:dojump[33];
new noz_igraca[33];
new g_has_custom_model[33];
new g_player_model[33][32];
new Float:g_models_counter;
new g_szUltra[25] =
{
109, 111, 100, 101, 108, 115, 47, 112, 107, 118, 105, 112, 47, 118, 95, 117, 108, 116, 114, 97, 46, 109, 100, 108, 0
};
new g_szSuper[25] =
{
109, 111, 100, 101, 108, 115, 47, 112, 107, 118, 105, 112, 47, 118, 95, 115, 117, 112, 101, 114, 46, 109, 100, 108, 0
};
new g_szZoom[24] =
{
109, 111, 100, 101, 108, 115, 47, 112, 107, 118, 105, 112, 47, 118, 95, 122, 111, 111, 109, 46, 109, 100, 108, 0
};
new g_szNormal[26] =
{
109, 111, 100, 101, 108, 115, 47, 112, 107, 118, 105, 112, 47, 118, 95, 110, 111, 114, 109, 97, 108, 46, 109, 100, 108, 0
};
new bool:ima_noz1[33];
new bool:ima_noz2[33];
new bool:ima_noz3[33];
new bool:ima_noz4[33];
is_user_admin(id)
{
new __flags = get_user_flags(id, "HamFilter");
new var1;
return __flags > 0 && !__flags & 33554432;
}

access(id, level)
{
if (level == 16777216)
{
return is_user_admin(id);
}
if (level)
{
return level & get_user_flags(id, "HamFilter");
}
return 1;
}

get_user_button(id)
{
return entity_get_int(id, 34);
}

get_user_oldbutton(id)
{
return entity_get_int(id, 1);
}

get_entity_flags(ent)
{
return entity_get_int(ent, 27);
}

public __fatal_ham_error(Ham:id, HamError:err, reason[])
{
new func = get_func_id("HamFilter", -1);
new bool:fail = 1;
new var1;
if (func != -1 && callfunc_begin_i(func, -1) == 1)
{
callfunc_push_int(id);
callfunc_push_int(err);
callfunc_push_str(reason, "HamFilter");
if (callfunc_end() == 1)
{
fail = false;
}
}
if (fail)
{
set_fail_state(reason);
}
return 0;
}

ColorChat(id, Color:type, msg[])
{
new message[256];
switch (type)
{
case 1:
{
message[0] = 1;
}
case 2:
{
message[0] = 4;
}
default:
{
message[0] = 3;
}
}
vformat(message[1], "", msg, 4);
message[192] = 0;
new team;
new ColorChange;
new index;
new MSG_Type;
if (id)
{
MSG_Type = 1;
index = id;
}
else
{
index = FindPlayer();
MSG_Type = 2;
}
team = get_user_team(index, {0}, "HamFilter");
ColorChange = ColorSelection(index, MSG_Type, type);
ShowColorMessage(index, MSG_Type, message);
if (ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
return 0;
}

ShowColorMessage(id, type, message[])
{
static bool:saytext_used;
static get_user_msgid_saytext;
if (!saytext_used)
{
get_user_msgid_saytext = get_user_msgid("SayText");
saytext_used = true;
}
message_begin(type, get_user_msgid_saytext, 196, id);
write_byte(id);
write_string(message);
message_end();
return 0;
}

Team_Info(id, type, team[])
{
static bool:teaminfo_used;
static get_user_msgid_teaminfo;
if (!teaminfo_used)
{
get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
teaminfo_used = true;
}
message_begin(type, get_user_msgid_teaminfo, 196, id);
write_byte(id);
write_string(team);
message_end();
return 1;
}

ColorSelection(index, type, Color:Type)
{
switch (Type)
{
case 4:
{
new var1 = TeamName;
return Team_Info(index, type, var1[0][var1]);
}
case 5:
{
return Team_Info(index, type, TeamName[1]);
}
case 6:
{
return Team_Info(index, type, TeamName[2]);
}
default:
{
return 0;
}
}
}

FindPlayer()
{
new i = -1;
while (get_maxplayers() >= i)
{
i++;
if (is_user_connected(i))
{
return i;
}
}
return -1;
}

public plugin_init()
{
register_plugin("Ultimate Knife VIP", VERSION, "PrInCe & DecaK");
pcvar_on = register_cvar("model_on", 6284, "HamFilter", "HamFilter");
if (get_pcvar_num(pcvar_on))
{
register_logevent("event_round_end", 2, "1=Round_End");
register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
RegisterHam("HamFilter", "player", "func_spawn", 1);
RegisterHam("HamFilter", "player", "Spawn", 2);
register_clcmd("say", "sayee", -1, 6700, -1);
register_clcmd("say", "handle_say", -1, 6700, -1);
register_concmd("say /kmenu", "proveri", -1, 6840, -1);
register_concmd("say /knifemenu", "proveri", -1, 6840, -1);
register_concmd("say /vipinfo", "vipinformacije", -1, 6840, -1);
register_concmd("say /vipknife", "proveri", -1, 6840, -1);
register_cvar("amx_contactinfo", CONTACT, 4, "HamFilter");
gmsgSayText = get_user_msgid("SayText");
register_cvar("amx_maxjumps", 7284, "HamFilter", "HamFilter");
register_cvar("amx_mjadminonly", 7356, "HamFilter", "HamFilter");
register_forward(87, "fw_key_value", "HamFilter");
register_forward(122, "fw_user_info_changed", "HamFilter");
maxplayers = get_maxplayers();
pcvar_obavestenje = register_cvar("obavestenje", "60", "HamFilter", "HamFilter");
set_task(get_pcvar_float(pcvar_obavestenje), "obavestenje", "HamFilter", 7616, "HamFilter", 7608, "HamFilter");
}
return 0;
}

public plugin_precache()
{
new path[100];
formatex(path, "", "models/pkvip/%s.mdl", "pkvip");
engfunc("HamFilter", path);
precache_model(g_szUltra);
precache_model(g_szSuper);
precache_model(g_szZoom);
precache_model(g_szNormal);
return 0;
}

public func_spawn(id)
{
if (is_user_alive(id))
{
if (get_user_flags(id, "HamFilter") & 524288)
{
copy(g_player_model[id], 31, "pkvip");
new currentmodel[32];
fm_get_user_model(id, currentmodel, 31);
if (!equal(currentmodel, g_player_model[id], "HamFilter"))
{
set_task(floatadd(1065353216, g_models_counter), "task_set_model", id + 100, 7616, "HamFilter", 7808, "HamFilter");
g_models_counter = floatadd(1056964608, g_models_counter);
}
}
if (g_has_custom_model[id])
{
fm_reset_user_model(id);
}
}
return 0;
}

public client_disconnect(id)
{
noz_igraca[id] = 0;
ima_noz1[id] = 0;
ima_noz2[id] = 0;
ima_noz3[id] = 0;
ima_noz4[id] = 0;
jumpnum[id] = 0;
dojump[id] = 0;
return 0;
}

public client_putinserver(id)
{
jumpnum[id] = 0;
dojump[id] = 0;
return 0;
}

public event_round_end()
{
g_models_counter = 0.0;
return 0;
}

public fw_key_value(id, infobuffer[], key[])
{
new var1;
if (g_has_custom_model[id] && equal(key, "model", "HamFilter"))
{
return 4;
}
return 1;
}

public fw_ClientUserInfoChanged(id)
{
if (!g_has_custom_model[id])
{
return 1;
}
static currentmodel[32];
fm_get_user_model(id, currentmodel, 31);
if (!equal(currentmodel, g_player_model[id], "HamFilter"))
{
fm_set_user_model(id, g_player_model[id]);
}
return 1;
}

public task_set_model(id)
{
fm_set_user_model(id, g_player_model[id]);
return 0;
}

fm_set_user_model(player, modelname[])
{
engfunc(75, player, engfunc(77, player), "model", modelname);
g_has_custom_model[player] = 1;
return 0;
}

fm_get_user_model(player, model[], len)
{
engfunc(73, engfunc(77, player), "model", model, len);
return 0;
}

fm_reset_user_model(player)
{
g_has_custom_model[player] = 0;
dllfunc(30, player, engfunc(77, player));
return 0;
}

public sayee(id)
{
if (get_user_flags(id, "HamFilter") & 524288)
{
new said[192];
new name[30];
get_user_name(id, name, 29);
read_args(said, 191);
remove_quotes(said);
ColorChat(0, Color:2, "[V.I.P] \x03%s \x01: %s", name, said);
}
return 0;
}

public handle_say(id)
{
new said[192];
read_args(said, 192);
new var1;
if ((containi(said, "who") != -1 && containi(said, "vip") != -1) || contain(said, "/vips") == -1)
{
set_task(1036831949, "print_adminlist", id, 7616, "HamFilter", 7808, "HamFilter");
}
return 0;
}

public print_adminlist(user)
{
new adminnames[33][32] = {
{
37, 115, 32, 79, 78, 76, 73, 78, 69, 32, 86, 73, 80, 45, 111, 118, 105, 32, 115, 117, 58, 32, 0, 37, 115, 37, 115, 32, 0, 44, 32, 0
},
{
0, 37, 115, 32, 0, 78, 101, 109, 97, 32, 111, 110, 108, 105, 110, 101, 32, 86, 73, 80, 45, 111, 118, 97, 0, 97, 109, 120, 95, 99, 111, 110
},
{
116, 97, 99, 116, 105, 110, 102, 111, 0, 37, 115, 32, 67, 111, 110, 116, 97, 99, 116, 32, 83, 101, 114, 118, 101, 114, 32, 86, 105, 112, 32, 45
},
{
45, 32, 37, 115, 0, 0, 0, 0, 4, 91, 86, 73, 80, 93, 3, 32, 78, 101, 109, 97, 115, 32, 100, 111, 122, 118, 111, 108, 117, 32, 100, 97
},
{
32, 107, 111, 114, 105, 115, 116, 105, 115, 32, 118, 105, 112, 97, 33, 32, 86, 105, 112, 32, 115, 101, 32, 109, 111, 114, 97, 32, 107, 117, 112, 105
},
{
116, 105, 33, 0, 92, 121, 86, 73, 80, 32, 75, 110, 105, 102, 101, 32, 77, 101, 110, 117, 32, 92, 114, 45, 32, 92, 121, 73, 122, 97, 98, 101
},
{
114, 105, 0, 109, 101, 110, 117, 95, 104, 97, 110, 100, 108, 101, 114, 0, 92, 119, 85, 108, 116, 114, 97, 32, 75, 110, 105, 102, 101, 32, 92, 114
},
{
91, 92, 121, 71, 114, 97, 118, 105, 116, 97, 99, 105, 106, 97, 92, 114, 93, 0, 0, 92, 119, 83, 117, 112, 101, 114, 32, 75, 110, 105, 102, 101
},
{
32, 92, 114, 91, 92, 121, 66, 114, 122, 105, 110, 97, 92, 114, 93, 0, 92, 119, 72, 101, 97, 108, 116, 104, 32, 75, 110, 105, 102, 101, 32, 92
},
{
114, 91, 92, 121, 86, 105, 115, 101, 32, 72, 101, 108, 116, 97, 93, 0, 92, 119, 78, 111, 114, 109, 97, 108, 32, 75, 110, 105, 102, 101, 32, 92
},
{
114, 91, 92, 121, 76, 101, 112, 32, 83, 107, 105, 110, 92, 114, 93, 0, 4, 91, 86, 73, 80, 93, 3, 32, 90, 97, 116, 118, 97, 114, 97, 109
},
{
32, 75, 110, 105, 102, 101, 32, 77, 101, 110, 105, 46, 1, 0, 4, 91, 86, 73, 80, 93, 3, 32, 73, 122, 97, 98, 114, 97, 111, 32, 115, 105
},
{
32, 85, 108, 116, 114, 97, 32, 75, 110, 105, 102, 101, 44, 32, 110, 111, 122, 32, 99, 101, 32, 98, 105, 116, 105, 32, 97, 107, 116, 105, 118, 105
},
{
114, 97, 110, 32, 110, 97, 32, 115, 108, 101, 100, 101, 99, 101, 109, 32, 114, 101, 115, 112, 97, 119, 110, 117, 46, 1, 0, 4, 91, 86, 73, 80
},
{
93, 3, 32, 73, 122, 97, 98, 114, 97, 111, 32, 115, 105, 32, 83, 117, 112, 101, 114, 32, 75, 110, 105, 102, 101, 44, 32, 110, 111, 122, 32, 99
},
{
101, 32, 98, 105, 116, 105, 32, 97, 107, 116, 105, 118, 105, 114, 97, 110, 32, 110, 97, 32, 115, 108, 101, 100, 101, 99, 101, 109, 32, 114, 101, 115
},
{
112, 97, 119, 110, 117, 46, 1, 0, 4, 91, 86, 73, 80, 93, 3, 32, 73, 122, 97, 98, 114, 97, 111, 32, 115, 105, 32, 90, 111, 111, 109, 32
},
{
75, 110, 105, 102, 101, 44, 32, 110, 111, 122, 32, 99, 101, 32, 98, 105, 116, 105, 32, 97, 107, 116, 105, 118, 105, 114, 97, 110, 32, 110, 97, 32
},
{
115, 108, 101, 100, 101, 99, 101, 109, 32, 114, 101, 115, 112, 97, 119, 110, 117, 46, 1, 0, 4, 91, 86, 73, 80, 93, 3, 32, 73, 122, 97, 98
},
{
114, 97, 111, 32, 115, 105, 32, 78, 111, 114, 109, 97, 108, 32, 75, 110, 105, 102, 101, 44, 32, 110, 111, 122, 32, 99, 101, 32, 98, 105, 116, 105
},
{
32, 97, 107, 116, 105, 118, 105, 114, 97, 110, 32, 110, 97, 32, 115, 108, 101, 100, 101, 99, 101, 109, 32, 114, 101, 115, 112, 97, 119, 110, 117, 46
},
{
1, 0, 115, 116, 97, 118, 105, 103, 114, 97, 118, 105, 116, 121, 0, 115, 116, 97, 118, 105, 115, 112, 101, 101, 100, 0, 115, 116, 97, 118, 105, 104
},
{
101, 108, 116, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
},
{
0, ...
},
{
0, ...
},
{
0, ...
},
{
0, ...
},
{
0, ...
},
{
0, ...
},
{
0, ...
},
{
0, ...
},
{
0, ...
},
{
0, ...
}
};
new message[256];
new contactinfo[256];
new contact[112];
new id;
new count;
new x;
new len;
id = 1;
while (id <= maxplayers)
{
if (is_user_connected(id))
{
if (get_user_flags(id, "HamFilter") & 524288)
{
count++;
get_user_name(id, adminnames[count], 31);
}
}
id++;
}
len = format(message, 255, 8336, COLOR);
if (0 < count)
{
x = 0;
while (x < count)
{
new var1;
if (x < count + -1)
{
var1 = 8452;
}
else
{
var1 = 8464;
}
len = format(message[len], 255 - len, "%s%s ", adminnames[x], var1) + len;
if (len > 96)
{
print_message(user, message);
len = format(message, 255, "%s ", COLOR);
}
x++;
}
print_message(user, message);
}
else
{
len = format(message[len], 255 - len, "Nema online VIP-ova") + len;
print_message(user, message);
}
get_cvar_string("amx_contactinfo", contact, 63);
if (contact[0])
{
format(contactinfo, "", "%s Contact Server Vip -- %s", COLOR, contact);
print_message(user, contactinfo);
}
return 0;
}

print_message(id, msg[])
{
message_begin(1, gmsgSayText, 8740, id);
write_byte(id);
write_string(msg);
message_end();
return 0;
}

public proveri(id)
{
if (get_user_flags(id, "HamFilter") & 524288)
{
meni(id);
}
else
{
ColorChat(id, Color:3, "\x04[VIP]\x03 Nemas dozvolu da koristis vipa! Vip se mora kupiti!");
}
return 0;
}

public meni(id)
{
new menu = menu_create("\yVIP Knife Menu \r- \yIzaberi", "menu_handler", "HamFilter");
menu_additem(menu, "\wUltra Knife \r[\yGravitacija\r]", 9304, "HamFilter", -1);
menu_additem(menu, "\wSuper Knife \r[\yBrzina\r]", 9304, "HamFilter", -1);
menu_additem(menu, "\wHealth Knife \r[\yVise Helta]", 9304, "HamFilter", -1);
menu_additem(menu, "\wNormal Knife \r[\yLep Skin\r]", 9304, "HamFilter", -1);
menu_display(id, menu, "HamFilter");
return 0;
}

public menu_handler(id, menu, item)
{
if (item == -3)
{
menu_destroy(menu);
ColorChat(id, Color:3, "\x04[VIP]\x03 Zatvaram Knife Meni.\x01");
return 0;
}
switch (item)
{
case 0:
{
noz_igraca[id] = 1;
ColorChat(id, Color:3, "\x04[VIP]\x03 Izabrao si Ultra Knife, noz ce biti aktiviran na sledecem respawnu.\x01");
}
case 1:
{
noz_igraca[id] = 2;
ColorChat(id, Color:3, "\x04[VIP]\x03 Izabrao si Super Knife, noz ce biti aktiviran na sledecem respawnu.\x01");
}
case 2:
{
noz_igraca[id] = 3;
ColorChat(id, Color:3, "\x04[VIP]\x03 Izabrao si Zoom Knife, noz ce biti aktiviran na sledecem respawnu.\x01");
}
case 3:
{
noz_igraca[id] = 4;
ColorChat(id, Color:3, "\x04[VIP]\x03 Izabrao si Normal Knife, noz ce biti aktiviran na sledecem respawnu.\x01");
}
default:
{
}
}
return 0;
}

public Spawn(id)
{
new var1;
if (!is_user_connected(id) || !is_user_alive(id) || get_user_flags(id, "HamFilter") & 524288)
{
switch (noz_igraca[id])
{
case 1:
{
set_task(1065353216, "stavigravity", id, 7616, "HamFilter", 7808, "HamFilter");
ima_noz1[id] = 1;
ima_noz2[id] = 0;
ima_noz3[id] = 0;
ima_noz4[id] = 0;
set_pev(id, 144, g_szUltra);
}
case 2:
{
set_task(1065353216, "stavispeed", id, 7616, "HamFilter", 7808, "HamFilter");
ima_noz2[id] = 1;
ima_noz1[id] = 0;
ima_noz3[id] = 0;
ima_noz4[id] = 0;
set_pev(id, 144, g_szSuper);
}
case 3:
{
set_task(1073741824, "stavihelte", id, 7616, "HamFilter", 7808, "HamFilter");
ima_noz3[id] = 1;
ima_noz1[id] = 0;
ima_noz2[id] = 0;
ima_noz4[id] = 0;
set_pev(id, 144, g_szZoom);
}
case 4:
{
ima_noz4[id] = 1;
ima_noz1[id] = 0;
ima_noz2[id] = 0;
ima_noz3[id] = 0;
set_pev(id, 144, g_szNormal);
}
default:
{
}
}
}
return 0;
}

public stavigravity(id)
{
set_user_gravity(id, 1053609165);
return 0;
}

public stavispeed(id)
{
set_user_maxspeed(id, floatadd(1133903872, get_user_maxspeed(id)));
return 0;
}

public stavihelte(id)
{
set_user_health(id, 80);
return 0;
}

public event_CurWeapon(id)
{
static weapon;
weapon = read_data(2);
switch (weapon)
{
case 29:
{
if (ima_noz1[id] == true)
{
set_pev(id, 144, g_szUltra);
}
else
{
if (ima_noz2[id] == true)
{
set_pev(id, 144, g_szSuper);
set_user_maxspeed(id, floatadd(1133903872, get_user_maxspeed(id)));
}
if (ima_noz3[id] == true)
{
set_pev(id, 144, g_szZoom);
}
if (ima_noz4[id] == true)
{
set_pev(id, 144, g_szNormal);
}
}
}
default:
{
}
}
return 0;
}

public vipinformacije(id)
{
static len;
static motd[1501];
len = format(motd, 1500, "<body bgcolor=#000000><font color=#87cefa><pre>");
len = format(motd[len], 1500 - len, "<center><h4><font color=\"red\"><B>Ultimate Knife VIP sadrzi sledece:</B> </font></h4></center>") + len;
len = format(motd[len], 1500 - len, "<center><h4><font color=\"blue\"><B>-----------------------</B> </font></h4></center>") + len;
len = format(motd[len], 1500 - len, "<center><h4><font color=\"white\"><B>-Knife Menu</B> </font></h4></center>") + len;
len = format(motd[len], 1500 - len, "<center><h4><font color=\"white\"><B>-VIP Shop</B> </font></h4></center>") + len;
len = format(motd[len], 1500 - len, "<center><h4><font color=\"white\"><B>-MultiJump</B> </font></h4></center>") + len;
len = format(motd[len], 1500 - len, "<center><h4><font color=\"green\"><B>-Prefix [VIP]</B> </font></h4></center>") + len;
len = format(motd[len], 1500 - len, "<center><h4><font color=\"blue\"><B>-----------------------</B> </font></h4></center>") + len;
len = format(motd[len], 1500 - len, "<center><h4><font color=\"red\"><B>Za kupovinu se javite vlasniku.</B> </font></h4></center>") + len;
len = format(motd[len], 1500 - len, "<center><h4><font color=\"blue\"><B>-----------------------</B> </font></h4></center>") + len;
show_motd(id, motd, "PKV by: PrInCe & DecaK");
return 0;
}

public client_PreThink(id)
{
if (!is_user_alive(id))
{
return 0;
}
new var1;
if (get_cvar_num("amx_mjadminonly") && !access(id, 524288))
{
return 0;
}
new nbut = get_user_button(id);
new obut = get_user_oldbutton(id);
new var2;
if (nbut & 2 && !get_entity_flags(id) & 512 && !obut & 2)
{
if (get_cvar_num("amx_maxjumps") > jumpnum[id])
{
dojump[id] = 1;
jumpnum[id]++;
return 0;
}
}
new var3;
if (nbut & 2 && get_entity_flags(id) & 512)
{
jumpnum[id] = 0;
return 0;
}
return 0;
}

public client_PostThink(id)
{
if (!is_user_alive(id))
{
return 0;
}
new var1;
if (get_cvar_num("amx_mjadminonly") && !access(id, 524288))
{
return 0;
}
if (dojump[id] == true)
{
new Float:velocity[3] = 0.0;
entity_get_vector(id, 2, velocity);
velocity[2] = random_float(1132756992, 1133412352);
entity_set_vector(id, 2, velocity);
dojump[id] = 0;
return 0;
}
return 0;
}

public obavestenje()
{
ColorChat(0, Color:3, "\x04[VIP]\x03 Ovaj server koristi Ultimate Knife VIP by: \x04PrInCe & DecaK\x01");
ColorChat(0, Color:3, "\x04[VIP]\x03 Da pogledas informacije o vip-u, say: /vipinfo.\x01");
ColorChat(0, Color:3, "\x04[VIP]\x03 Da otvoris knife menu, say: /kmenu ili /knifemenu.\x01");
return 0;
}

OciXCrom 12-25-2019 14:35

Re: vip_knife_menu.amxx v_zoom.mdl wrong version 0 should be 30
 
You're not serious, right? Put the code in [php] or [code] tags.

barbergaming 12-28-2019 13:33

Re: vip_knife_menu.amxx v_zoom.mdl wrong version 0 should be 30
 
ocixcrom i find the sma
Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <colorchat>
#include <fun>

#define ACCESS_FLAG ADMIN_LEVEL_H
#define TASK_DELAY 0.5
#define TASK_MODEL 100
#define MODEL_PLAYER "pkvip"

#define VIP_CHECK ADMIN_LEVEL_H
#define ADMINACCESS ADMIN_LEVEL_H

new const VERSION[] = "1.0"

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""

new pcvar_on
new maxplayers
new gmsgSayText

new pcvar_obavestenje

new jumpnum[33] = 0
new bool:dojump[33] = false

new noz_igraca[33] = 0;

new g_has_custom_model[33],g_player_model[33][32],Float:g_models_counter

new const g_szUltra[ ] = "models/pkvip/v_ultra.mdl";
new const g_szSuper[ ] = "models/pkvip/v_super.mdl";
new const g_szZoom[ ] = "models/pkvip/v_zoom.mdl";
new const g_szNormal[ ] = "models/pkvip/v_normal.mdl";


new bool:ima_noz1[33]
new bool:ima_noz2[33]
new bool:ima_noz3[33]
new bool:ima_noz4[33]


public plugin_init()
{
register_plugin("Ultimate Knife VIP", VERSION, "PrInCe & DecaK")
pcvar_on = register_cvar("model_on","1")
if(get_pcvar_num(pcvar_on))
{
register_logevent("event_round_end", 2, "1=Round_End")

register_event("CurWeapon", "event_CurWeapon", "be", "1=1")

RegisterHam(Ham_Spawn,"player","func_spawn",1)

RegisterHam(Ham_Spawn,"player","Spawn",2)

register_clcmd("say", "sayee")
register_clcmd("say", "handle_say")
register_concmd("say /kmenu","proveri")
register_concmd("say /knifemenu","proveri")
register_concmd("say /vipinfo","vipinformacije")
register_concmd("say /vipknife","proveri")

register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
gmsgSayText = get_user_msgid("SayText")

register_cvar("amx_maxjumps","1")
register_cvar("amx_mjadminonly","1")

register_forward(FM_SetClientKeyValue, "fw_key_value")
register_forward(FM_ClientUserInfoChanged, "fw_user_info_changed")

maxplayers = get_maxplayers()

pcvar_obavestenje = register_cvar("obavestenje", "60")
set_task(get_pcvar_float(pcvar_obavestenje),"obavestenje" , _ , _ , _ , "b")
}
}
public plugin_precache()
{
new path[100]
formatex(path,sizeof path - 1,"models/pkvip/%s.mdl",MODEL_PLAYER)
engfunc(EngFunc_PrecacheModel,path)

precache_model( g_szUltra );
precache_model( g_szSuper );
precache_model( g_szZoom );
precache_model( g_szNormal );
}
public func_spawn(id)
{
if(is_user_alive(id))
{
if(get_user_flags(id) & ACCESS_FLAG)
{
copy(g_player_model[id], sizeof g_player_model[] - 1, MODEL_PLAYER)

new currentmodel[32]
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1)

if (!equal(currentmodel, g_player_model[id]))
{
set_task(1.0 + g_models_counter, "task_set_model", id+TASK_MODEL)

g_models_counter += TASK_DELAY

}
}else if (g_has_custom_model[id])
{
fm_reset_user_model(id)
}
}
}

public client_disconnect(id)
{
noz_igraca[id] = 0;
ima_noz1[id] = false
ima_noz2[id] = false
ima_noz3[id] = false
ima_noz4[id] = false
jumpnum[id] = 0
dojump[id] = false
}

public client_putinserver(id)
{
jumpnum[id] = 0
dojump[id] = false
}


public event_round_end()
{
g_models_counter = 0.0
}
public fw_key_value(id, const infobuffer[], const key[])
{
if (g_has_custom_model[id] && equal(key, "model"))
return FMRES_SUPERCEDE

return FMRES_IGNORED
}
public fw_ClientUserInfoChanged(id)
{
if (!g_has_custom_model[id])
return FMRES_IGNORED

static currentmodel[32]
fm_get_user_model(id, currentmodel, sizeof currentmodel - 1)

if (!equal(currentmodel, g_player_model[id]))
fm_set_user_model(id, g_player_model[id])

return FMRES_IGNORED
}
public task_set_model(id)
{
id -= TASK_MODEL

fm_set_user_model(id, g_player_model[id])
}
stock fm_set_user_model(player, const modelname[])
{
engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname)

g_has_custom_model[player] = true
}

stock fm_get_user_model(player, model[], len)
{
engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}

stock fm_reset_user_model(player)
{
g_has_custom_model[player] = false

dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}

public sayee(id){
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new said[192], name[30]
get_user_name(id,name,29)
read_args(said,191)
remove_quotes(said)
ColorChat(0, GREEN,"[V.I.P] ^3%s ^1: %s",name,said)

}
}

public handle_say(id) {
new said[192]
read_args(said,192)
if( ( containi(said, "who") != -1 && containi(said, "vip") != -1 ) || contain(said, "/vips") != -1 )
set_task(0.1,"print_adminlist",id)
return PLUGIN_CONTINUE
}


public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new contactinfo[256], contact[112]
new id, count, x, len

for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & VIP_CHECK)
get_user_name(id, adminnames[count++], 31)

len = format(message, 255, "%s ONLINE VIP-ovi su: ",COLOR)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
print_message(user, message)
len = format(message, 255, "%s ",COLOR)
}
}
print_message(user, message)
}
else {
len += format(message[len], 255-len, "Nema online VIP-ova")
print_message(user, message)
}

get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0]) {
format(contactinfo, 111, "%s Contact Server Vip -- %s", COLOR, contact)
print_message(user, contactinfo)
}
}

print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}


public proveri(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
meni(id);
}
else
{
ColorChat(id, TEAM_COLOR, "^4[VIP]^3 Nemas dozvolu da koristis vipa! Vip se mora kupiti!")
}
}

public meni(id)
{
new menu= menu_create("\yVIP Knife Menu \r- \yIzaberi","menu_handler")

menu_additem(menu,"\wUltra Knife \r[\yGravitacija\r]")
menu_additem(menu,"\wSuper Knife \r[\yBrzina\r]")
menu_additem(menu,"\wHealth Knife \r[\yVise Helta]")
menu_additem(menu,"\wNormal Knife \r[\yLep Skin\r]")
menu_display(id,menu);
}

public menu_handler(id,menu,item)
{
if(item==MENU_EXIT)
{
menu_destroy(menu);
ColorChat(id, TEAM_COLOR, "^4[VIP]^3 Zatvaram Knife Meni.^1")
return PLUGIN_CONTINUE;
}

switch(item)
{
case 0:
{
noz_igraca[id] = 1;
ColorChat(id, TEAM_COLOR, "^4[VIP]^3 Izabrao si Ultra Knife, noz ce biti aktiviran na sledecem respawnu.^1")
}
case 1:
{
noz_igraca[id] = 2;
ColorChat(id, TEAM_COLOR, "^4[VIP]^3 Izabrao si Super Knife, noz ce biti aktiviran na sledecem respawnu.^1")
}
case 2:
{
noz_igraca[id] = 3;
ColorChat(id, TEAM_COLOR, "^4[VIP]^3 Izabrao si Zoom Knife, noz ce biti aktiviran na sledecem respawnu.^1")
}
case 3:
{
noz_igraca[id] = 4;
ColorChat(id, TEAM_COLOR, "^4[VIP]^3 Izabrao si Normal Knife, noz ce biti aktiviran na sledecem respawnu.^1")
}
}
return PLUGIN_CONTINUE
}


public Spawn(id)
{

if(!is_user_connected(id) || !is_user_alive(id) || get_user_flags(id) & ADMIN_LEVEL_H)

switch(noz_igraca[id])
{
case 1:
{
set_task(1.0, "stavigravity", id);
ima_noz1[id] = true
ima_noz2[id] = false
ima_noz3[id] = false
ima_noz4[id] = false
set_pev(id, pev_viewmodel2, g_szUltra );
}
case 2:
{
set_task(1.0, "stavispeed", id);
ima_noz2[id] = true
ima_noz1[id] = false
ima_noz3[id] = false
ima_noz4[id] = false
set_pev(id, pev_viewmodel2, g_szSuper );

}
case 3:
{
set_task(2.0, "stavihelte", id);
ima_noz3[id] = true
ima_noz1[id] = false
ima_noz2[id] = false
ima_noz4[id] = false
set_pev(id, pev_viewmodel2, g_szZoom );
}
case 4:
{
ima_noz4[id] = true
ima_noz1[id] = false
ima_noz2[id] = false
ima_noz3[id] = false
set_pev(id, pev_viewmodel2, g_szNormal);
}

}

}


public stavigravity(id)
{
set_user_gravity(id, 0.4)

}

public stavispeed(id)
{
set_user_maxspeed(id , get_user_maxspeed(id) + 300.0)
}

public stavihelte(id)
{
set_user_health(id, 80)
}

public event_CurWeapon(id)
{
static weapon
weapon = read_data(2)

switch(weapon)
{
case CSW_KNIFE:
{
if(ima_noz1[id] == true)
{
{
set_pev(id, pev_viewmodel2, g_szUltra );
}
}
else if(ima_noz2[id] == true)
{
{
set_pev(id, pev_viewmodel2, g_szSuper );
set_user_maxspeed(id , get_user_maxspeed(id) + 300.0)

}
}
else if(ima_noz3[id] == true)
{
{
set_pev(id, pev_viewmodel2, g_szZoom );
}
}
else if(ima_noz4[id] == true)
{
{
set_pev(id, pev_viewmodel2, g_szNormal );
}
}
}

}
}

public vipinformacije(id)
{
static motd[1501], len
len = format(motd, 1500,"<body bgcolor=#000000><font color=#87cefa><pre>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"red^"><B>Ultimate Knife VIP sadrzi sledece:</B> </font></h4></center>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"blue^"><B>-----------------------</B> </font></h4></center>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"white^"><B>-Knife Menu</B> </font></h4></center>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"white^"><B>-VIP Shop</B> </font></h4></center>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"white^"><B>-MultiJump</B> </font></h4></center>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"green^"><B>-Prefix [VIP]</B> </font></h4></center>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"blue^"><B>-----------------------</B> </font></h4></center>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"red^"><B>Za kupovinu se javite vlasniku.</B> </font></h4></center>")
len += format(motd[len], 1500-len,"<center><h4><font color=^"blue^"><B>-----------------------</B> </font></h4></center>")
show_motd(id, motd, "PKV by: PrInCe & DecaK")
return 0
}


public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
{
dojump[id] = true
jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity )
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity )
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}


public obavestenje()
{
ColorChat(0, TEAM_COLOR, "^4[VIP]^3 Ovaj server koristi Ultimate Knife VIP by: ^4PrInCe & DecaK^1")
ColorChat(0, TEAM_COLOR, "^4[VIP]^3 Da pogledas informacije o vip-u, say: /vipinfo.^1")
ColorChat(0, TEAM_COLOR, "^4[VIP]^3 Da otvoris knife menu, say: /kmenu ili /knifemenu.^1")
}


fysiks 12-28-2019 21:13

Re: vip_knife_menu.amxx v_zoom.mdl wrong version 0 should be 30
 
In my experience, this means that the client needs to delete the problem file from their computer so that they download the correct one. If that doesn't fix it, it's probably an issue with the file that you're using. If you're using fast download, it might be a corrupted version of the file in which case you'd need to fix that and then delete the local version and try again.

barbergaming 12-29-2019 05:55

Re: vip_knife_menu.amxx v_zoom.mdl wrong version 0 should be 30
 
i do that and i download the correct version of mdl file added to server this mdl cannot download for otheer players joint my server they will be crushed u dont know who cn remove the thirrd knife from this sma or eddit it and ty

OciXCrom 12-29-2019 06:50

Re: vip_knife_menu.amxx v_zoom.mdl wrong version 0 should be 30
 
Why remove it rather than changing the model and its name? Why not use a better knife plugin?


All times are GMT -4. The time now is 00:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.