View Single Post
barbergaming
Member
Join Date: Dec 2019
Location: Search For Me
Old 12-28-2019 , 13:33   Re: vip_knife_menu.amxx v_zoom.mdl wrong version 0 should be 30
Reply With Quote #3

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")
}
barbergaming is offline