Raised This Month: $106 Target: $400
 26% 

Knife Menu Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aurelian123
New Member
Join Date: May 2019
Old 05-06-2019 , 12:50   Knife Menu Problem
Reply With Quote #1

Quote:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <colorchat>

#define PLUGIN "VIP_KNIVES"
#define VERSION "1.0"
#define AUTHOR "IzaberiNoz"

new SaveData[33];

new Tribal[33];
new Fire[33];
new Soul[33];

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("say /vipknife", "IzaberiNoz");
register_clcmd("say_team /vipknife", "IzaberiNoz");
register_event("CurWeapon", "postavi_nozeve", "be", "1=1");
}


public plugin_precache() {

precache_model("models/csone/vipknife/v_knife_Tribal.mdl");
precache_model("models/csone/vipknife/v_knife_bayonet.mdl");
precache_model("models/csone/vipknife/v_knife_soul.mdl");

}



public IzaberiNoz(id)
{
if(get_user_flags(id) & (ADMIN_LEVEL_T))
{
new menu = menu_create("\r[CSONE]VIP KNIVES")
menu_additem(menu, "\yTribal ButterFly");
menu_additem(menu, "\yFire Bayonet");
menu_additem(menu, "\yGreen Soul");
menu_display(id, menu);
}
else
{
ColorChat(id, TEAM_COLOR, "^4[CSONE]^3 Trebuie sa fii VIP pentru a utiliza aceste cutite")
return PLUGIN_HANDLED;
}
}

public izaberinoz_Handle(id, iMenu, iItem)
{
switch(iItem)
{
case 0:
{
Tribal[id] = true;
Fire[id] = false;
Soul[id] = false;
ColorChat(id, TEAM_COLOR, "^4[CSONE]^3 Ai ales cutitul^4 Tribal ButterFly");
entity_set_string(id , EV_SZ_viewmodel , "models/csone/vipknife/v_knife_dragon.mdl");
SaveData[id];
return PLUGIN_HANDLED;

}
case 1:
{
Tribal[id] = false;
Fire[id] = true;
Soul[id] = false;
ColorChat(id, TEAM_COLOR, "^4[CSONE]^3 Ai ales cutitul^4 Bayonet Fire");
entity_set_string(id , EV_SZ_viewmodel , "models/csone/vipknife/v_knife_asiimov.mdl");

}
case 2:
{
Tribal[id] = false;
Fire[id] = false;
Soul[id] = true;
ColorChat(id, TEAM_COLOR, "^4[CSONE]^3 Ai ales cutitul^4 Green Soul");
entity_set_string(id , EV_SZ_viewmodel , "models/csone/vipknife/v_knife_soul.mdl");

}
case MENU_EXIT:
{
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}
}

return PLUGIN_CONTINUE;
}

Is my modification,and when I want the compiler to give me the next error, please help, I'm new to this community


Quote:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// vip_knives (1).sma
// C:\Users\Aurelian\Desktop\scripting\include\a mxconst.inc(55) : error 056: arr
ays, local variables and function arguments cannot be public (variable "MapName"
)
// C:\Users\Aurelian\Desktop\scripting\include\a mxconst.inc(60) : error 056: arr
ays, local variables and function arguments cannot be public (variable "NULL_STR
ING")
// C:\Users\Aurelian\Desktop\scripting\include\a mxconst.inc(65) : error 056: arr
ays, local variables and function arguments cannot be public (variable "NULL_VEC
TOR")
// C:\Users\Aurelian\Desktop\scripting\include\s tring_stocks.inc(91) : warning 2
07: unknown #pragma
// C:\Users\Aurelian\Desktop\scripting\include\s tring_stocks.inc(91) : error 038
: extra characters on line
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(17 : warning 207: u
nknown #pragma
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(17 : error 038: ext
ra characters on line
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(2555) : warning 207:
unknown #pragma
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(2555) : error 038: ex
tra characters on line
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(2567) : warning 207:
unknown #pragma
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(2567) : error 038: ex
tra characters on line
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(2615) : warning 207:
unknown #pragma
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(2615) : error 038: ex
tra characters on line
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(2626) : warning 207:
unknown #pragma
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(2626) : error 038: ex
tra characters on line
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(263 : warning 207:
unknown #pragma
// C:\Users\Aurelian\Desktop\scripting\include\a mxmodx.inc(263 : error 038: ex
tra characters on line
// C:\Users\Aurelian\Desktop\scripting\include\a mxmisc.inc(635) : warning 207: u
nknown #pragma
// C:\Users\Aurelian\Desktop\scripting\include\a mxmisc.inc(635) : error 038: ext
ra characters on line
// C:\Users\Aurelian\Desktop\scripting\include\e ngine.inc(1022) : error 008: mus
t be a constant expression; assumed zero
// C:\Users\Aurelian\Desktop\scripting\vip_knive s (1).sma(50) : warning 209: fun
ction "IzaberiNoz" should return a value
// C:\Users\Aurelian\Desktop\scripting\vip_knive s (1).sma(63) : warning 217: loo
se indentation
// C:\Users\Aurelian\Desktop\scripting\vip_knive s (1).sma(63) : warning 215: exp
ression has no effect
//
// 12 Errors.
// Could not locate output file compiled\vip_knives (1).amx (compile failed).
//
// Compilation Time: 0.2 sec
// ----------------------------------------

Press enter to exit ...

Last edited by Aurelian123; 05-06-2019 at 12:51.
Aurelian123 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-06-2019 , 14:19   Re: Knife Menu Problem
Reply With Quote #2

Seems to be a problem with AMX Mod X, not your plugin.
Download and install AMX Mod X from here or here and try again.
__________________




CrazY. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-06-2019 , 15:49   Re: Knife Menu Problem
Reply With Quote #3

You should use this instead of that poorly hardcoded plugin - https://forums.alliedmods.net/showthread.php?t=293632
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SomewhereLost
Senior Member
Join Date: Mar 2014
Location: Tomorrowland
Old 05-06-2019 , 17:41   Re: Knife Menu Problem
Reply With Quote #4

I bothered to fix those errors, compiles, but the thing is its missing savedata function, also curweapon has no meaning either.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <colorchat>

#define PLUGIN "VIP_KNIVES"
#define VERSION "1.0"
#define AUTHOR "IzaberiNoz"

new SaveData[33];

new 
Tribal[33];
new 
Fire[33];
new 
Soul[33];

public 
plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)

register_clcmd("say /vipknife""IzaberiNoz");
register_clcmd("say_team /vipknife""IzaberiNoz"); 
register_event("CurWeapon""postavi_nozeve""be""1=1");
}


public 
plugin_precache() {

precache_model("models/csone/vipknife/v_knife_Tribal.mdl");
precache_model("models/csone/vipknife/v_knife_bayonet.mdl");
precache_model("models/csone/vipknife/v_knife_soul.mdl");

}



public 
IzaberiNoz(id)

if(
get_user_flags(id) & ADMIN_LEVEL_H)

new 
menu menu_create("\r[CSONE]VIP KNIVES""izaberinoz_Handle"
menu_additem(menu"\yTribal ButterFly");
menu_additem(menu"\yFire Bayonet");
menu_additem(menu"\yGreen Soul");
menu_display(idmenu);
}
else 

ColorChat(idTEAM_COLOR"^4[CSONE]^3 Trebuie sa fii VIP pentru a utiliza aceste cutite")
return;
}
}

public 
izaberinoz_Handle(idiMenuiItem)
{
switch(
iItem)
{
case 
0:
{
Tribal[id] = true;
Fire[id] = false;
Soul[id] = false;
ColorChat(idTEAM_COLOR"^4[CSONE]^3 Ai ales cutitul^4 Tribal ButterFly");
entity_set_string(id EV_SZ_viewmodel "models/csone/vipknife/v_knife_dragon.mdl");
SaveData[id];
return 
PLUGIN_HANDLED;

}
case 
1:
{
Tribal[id] = false;
Fire[id] = true;
Soul[id] = false;
ColorChat(idTEAM_COLOR"^4[CSONE]^3 Ai ales cutitul^4 Bayonet Fire");
entity_set_string(id EV_SZ_viewmodel "models/csone/vipknife/v_knife_asiimov.mdl");

}
case 
2:
{
Tribal[id] = false;
Fire[id] = false;
Soul[id] = true;
ColorChat(idTEAM_COLOR"^4[CSONE]^3 Ai ales cutitul^4 Green Soul");
entity_set_string(id EV_SZ_viewmodel "models/csone/vipknife/v_knife_soul.mdl");

}
case 
MENU_EXIT:
{
menu_destroy(iMenu);
return 
PLUGIN_HANDLED;
}
}

return 
PLUGIN_CONTINUE;

Better use OciXCrom-s one as he loves promoting his plugins in every thread.
__________________

Last edited by SomewhereLost; 05-06-2019 at 17:42.
SomewhereLost is online now
Send a message via Skype™ to SomewhereLost
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:54.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode