Cześć, coś tam się bawiłem z pluginem i teraz mi crashuje serwer tz. wyłącza się i włącza jest to tak gdy kliknie ktoś na Zółty scyzoryk
Sprawdził by ktoś co jest nie tak i pomógł naprawić ? Z góry dziękuje .Sma daje w załączniku
Spoiler
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <vault>
#include <fun>
#pragma semicolon 0
#define PLUGIN "Knife Mod"
#define VERSION "1.0"
#define AUTHOR "spunko"
new knife_model[33]
new g_Menu
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon","CurWeapon","be","1=1")
g_Menu = register_menuid("Knife Mod")
register_menucmd(g_Menu, 1023, "knifemenu")
register_clcmd("say /kosy", "display_knife")
set_task(480.0, "kmodmsg", 0, _, _, "b")
}
public plugin_precache() {
precache_model("models/Andros/v_lowca.mdl")
precache_model("models/Andros/p_lowca.mdl")
precache_model("models/Andros/v_blue.mdl")
precache_model("models/Andros/p_blue.mdl")
precache_model("models/Andros/v_tiki.mdl")
precache_model("models/Andros/p_tiki.mdl")
precache_model("models/Andros/v_yelow.mdl")
precache_model("models/Andros/p_yelow.mdl")
precache_model("models/Andros/v_swieta.mdl")
precache_model("models/Andros/p_swieta.mdl")
}
public display_knife(id) {
new menuBody[512]
add(menuBody, 511, "\rMenu Nozy\w^n^n")
add(menuBody, 511, "1. Niebiski Scyzoryk\w^n^n")
add(menuBody, 511, "2. Zolty Scyzoryk\w^n^n")
add(menuBody, 511, "3. TikiTaki\w^n^n")
add(menuBody, 511, "4. Noz Lowcy\w^n^n")
add(menuBody, 511, "5. Swiateczny Noz\w^n^n")
add(menuBody, 511, "0. Exit^n")
new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<9 )
show_menu(id, keys, menuBody, -1, "Knife Mod")
}
public knifemenu(id, key) {
switch(key)
{
case 0: SetKnife(id , 4)
case 1: SetKnife(id , 2)
case 2: SetKnife(id , 3)
case 3: SetKnife(id , 1)
case 4: SetKnife(id , 0)
default: return PLUGIN_HANDLED
}
SaveData(id)
return PLUGIN_HANDLED
}
public SetKnife(id , Knife) {
knife_model[id] = Knife
new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)
if ( Weapon != CSW_KNIFE )
return PLUGIN_HANDLED
new vModel[56],pModel[56]
switch(Knife)
{
case 0: {
format(vModel,55,"models/Andros/v_swieta.mdl")
format(pModel,55,"models/Andros/p_swieta.mdl")
}
case 1: {
format(vModel,55,"models/Andros/v_lowca.mdl")
format(pModel,55,"models/Andros/p_lowca.mdl")
}
case 2: {
format(vModel,55,"models/Andros/v_tiki")
format(pModel,55,"models/Andros/p_tiki")
}
case 3: {
format(vModel,55,"models/Andros/v_yelow.mdl")
format(pModel,55,"models/Andros/p_yelow.mdl")
}
case 4: {
format(vModel,55,"models/Andros/v_blue.mdl")
format(pModel,55,"models/Andros/p_blue.mdl")
}
}
entity_set_string(id, EV_SZ_viewmodel, vModel)
entity_set_string(id, EV_SZ_weaponmodel, pModel)
return PLUGIN_HANDLED;
}
public CurWeapon(id){
SetKnife(id, knife_model[id])
}
public kmodmsg() {
client_print(0,print_chat,"")
}
public client_authorized(id){
LoadData(id)
}
SaveData(id)
{
new authid[32]
get_user_authid(id, authid, 31)
new vaultkey[64]
new vaultdata[64]
format(vaultkey, 63, "KMOD_%s", authid)
format(vaultdata, 63, "%d", knife_model[id])
set_vaultdata(vaultkey, vaultdata)
}
LoadData(id)
{
new authid[32]
get_user_authid(id,authid,31)
new vaultkey[64], vaultdata[64]
format(vaultkey, 63, "KMOD_%s", authid)
get_vaultdata(vaultkey, vaultdata, 63)
knife_model[id] = str_to_num(vaultdata)
}
Oraz tu
Załączone pliki
-
knifemod.sma 3,6 KB 68 Ilość pobrań
knifemod.amxx