Každopádne ku novému problému: Keď som nastavil, aby hráč každé nové kolo čo sa spawne mal "ruky" (model som stiahol a pridal na Server), tak po pripojení na Server sa mi nezobrazia žiadne ruky (resp, žiadny knife), takže vidím len Crosshair a HUD, ruky vôbec nevidím. Osobne si myslím, že script mám napísaní správne (žiadne errory, len 4 warny) môžete mi script skontrolovať a prípadne upraviť?
Script:
Kód: Vybrat vše
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
new SetModelMoto[33]
new SetModelMachete[33]
new SetModelHand[33]
new isDamaged_model_Hand[33]
new isDamaged_model_Moto[33]
new isDamaged_model_Machete[33]
new MotoValueDamage = 9999999
new MacheteValueDamage = 60
new HandValueDamage = 12
new const p_ModelMotor[] = "models/shopper/motorovka/motorovka.mdl"
new const v_ModelMotor2[] = "models/shopper/motorovka/motorovka2.mdl"
new const p_ModelMachete[] = "models/shopper/machete/machete.mdl"
new const v_ModelMachete2[] = "models/shopper/machete/machete2.mdl"
new const p_ModelHand[] = "models/shopper/punos/punos.mdl"
new const v_ModelHand2[] = "models/shopper/punos/punos2.mdl"
public plugin_init()
{
register_plugin("Shop", "1.0", "RayCodeCSC")
register_clcmd("say /shopper", "shop_menu")
register_event("CurWeapon", "new_models", "be", "1=1")
RegisterHam(Ham_TakeDamage, "player", "isDamaged")
RegisterHam(Ham_Spawn, "player", "afterSpawn")
}
public plugin_precache()
{
precache_model(p_ModelMotor)
precache_model(v_ModelMotor2)
precache_model(p_ModelMachete)
precache_model(v_ModelMachete2)
precache_model(p_ModelHand)
precache_model(v_ModelHand2)
}
public afterSpawn(id)
{
give_item(id, "weapon_knife")
SetModelHand[id] = 1
SetModelMoto[id] = 0
SetModelMachete[id] = 0
isDamaged_model_Hand[id] = 1
isDamaged_model_Machete[id] = 0
isDamaged_model_Moto[id] = 0
}
public shop_menu(id)
{
new menu = menu_create("Vyber si z menu:", "shop_menu_selection")
menu_additem(menu, "Maceta")
menu_additem(menu, "Motorova pila")
menu_display(id, menu)
}
public shop_menu_selection(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
switch(item)
{
case 0:
{
give_item(id, "weapon_knife")
SetModelMachete[id] = 1
SetModelMoto[id] = 0
SetModelHand[id] = 0
isDamaged_model_Hand[id] = 0
isDamaged_model_Machete[id] = 1
isDamaged_model_Moto[id] = 0
}
case 1:
{
give_item(id, "weapon_knife")
SetModelMoto[id] = 1
SetModelMachete[id] = 0
SetModelHand[id] = 0
isDamaged_model_Hand[id] = 0
isDamaged_model_Moto[id] = 1
isDamaged_model_Machete[id] = 0
}
}
}
public new_models(id)
{
new weapid = read_data(2)
if(weapid == CSW_KNIFE)
{
if(SetModelMoto[id] == 1)
{
set_pev(id, pev_viewmodel2, p_ModelMotor)
set_pev(id, pev_weaponmodel2, v_ModelMotor2)
}
else if(SetModelMachete[id] == 1)
{
set_pev(id, pev_viewmodel2, p_ModelMachete)
set_pev(id, pev_weaponmodel2, v_ModelMachete2)
}
else if(SetModelHand[id] == 1)
{
set_pev(id, pev_weaponmodel2, p_ModelHand)
set_pev(id, pev_viewmodel2, v_ModelHand2)
}
}
}
public isDamaged(victim, attacker, inflictor, Float:damage, damage_bits, id)
{
if(get_user_weapon(id) == CSW_KNIFE)
{
if(isDamaged_model_Moto[id] == 1)
{
SetHamParamFloat(4, MotoValueDamage)
}
else if(isDamaged_model_Machete[id] == 1)
{
SetHamParamFloat(4, MacheteValueDamage)
}
else if(isDamaged_model_Hand[id] == 1)
{
SetHamParamFloat(4, HandValueDamage)
}
}
}