Witam mam problem z komplikacją menu.
kod
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <vault>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "killer_cyc[DDS]"
new knife_model[33]
new g_Menu
public plugin_init() {
g_Menu = register_menuid("Noze")
register_menucmd(g_Menu, 1023, "knifemenu")
register_clcmd("say /knife", "display_knife)
public plugin_precache() {
precache_model("models/noze/v_karambit.mdl")
precache_model("models/v_knife.mdl")
precache_model("models/p_knife.mdl")
}
public display_knife(id) {
new menuBody[512]
add(menuBody, 511, "\rWybierz noz\w^n^n")
add(menuBody, 511, "1. Karambit Marble Fade ^n")
add(menuBody, 511, "2. Podstawowy noz \w^n^n")
add(menuBody, 511, "0. Exit^n")
new keys = ( 1<<0 | 1<<1 | 1<<2 )
show_menu(id, keys, menuBody, -1, "Knife Mod")
}
public knifemenu(id, key) {
switch(key)
{
case 0: SetKnife(id , 4)
case 1: 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/v_knife.mdl")
format(pModel,55,"models/p_knife.mdl")
}
case 1: {
format(vModel,55,"models/noze/v_karambit.mdl")
}
}
entity_set_string(id, EV_SZ_viewmodel, vModel)
entity_set_string(id, EV_SZ_weaponmodel, pModel)
return PLUGIN_HANDLED;
}
public client_disconnect(id) {
if(task_exists(id)) remove_task(id)
}
public kmodmsg() {
client_print(0,print_chat,"[AMXX] Wpisz /noz by wybrac swoj skin")
}
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)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Błąd
// C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(24) : warning 217: loose indentation // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(24) : error 029: invalid expression, assumed zero // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(24) : error 004: function "plugin_precache" is not implemented // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(31) : error 029: invalid expression, assumed zero // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(31) : error 017: undefined symbol "display_knife" // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(39) : error 017: undefined symbol "id" // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(39) : warning 215: expression has no effect // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(39) : warning 215: expression has no effect // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(39) : warning 215: expression has no effect // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(39) : warning 215: expression has no effect // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(39) : error 001: expected token: ";", but found ")" // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(39) : error 029: invalid expression, assumed zero // C:\Users\Killer\Desktop\scripting WINDOWS Ś codmod\noze.sma(39) : fatal error 107: too many error messages on one line


Dodatki SourceMod














