Post by tousif on Jan 20, 2015 10:51:50 GMT
[pre]Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team
nm_shopmenu.sma(99) : error 008: must be a constant expression; assumed zero
nm_shopmenu.sma(99) : error 036: empty statement
nm_shopmenu.sma(105) : error 017: undefined symbol "cash"
nm_shopmenu.sma(105) : warning 215: expression has no effect
nm_shopmenu.sma(105) : error 001: expected token: ";", but found "]"
nm_shopmenu.sma(105) : error 029: invalid expression, assumed zero
nm_shopmenu.sma(105) : fatal error 107: too many error messages on one line
Compilation aborted.
6 Errors.
Could not locate output file nm_shopmenu.amx (compile failed).[/pre]
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <fakemeta>
#define PLUGIN "NM Shop Menu"
#define VERSION "1.0"
#define AUTHOR "Gullu Bhai"
new pEnabled
new jumpnum[33] = 0
new bool:dojump[33] = false
new g_hMenu;
new const silver_knife[] = "models/shop/v_silver"
new const gold_knife[] = "models/shop/v_gold"
new const hammer_knife[] = "models/shop/v_hammer"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /shop", "cmdshopmenu");
pEnabled = register_cvar("nm_shop", "1");
register_cvar("amx_maxjumps","1");
RegisterHam( Ham_Spawn, "player", "Forward__PlayerSpawn_Post", 1 );
}
plugin_precache()
{
precache_model(silver_knife);
precache_model(gold_knife);
precache_model(hammer_knife);
}
public client_putinserver(id)
{
jumpnum[id] = 0
dojump[id] = false
}
public client_disconnect(id)
{
jumpnum[id] = 0
dojump[id] = false
}
public plugin_cfg(){
g_hMenu = menu_create("SHOP Menu","mHandler");
menu_additem(g_hMenu,"\wBuy Health \r(80 Hp) \y(Price:1000$)");
menu_additem(g_hMenu,"\wBuy Gravity \r(Low Gravity) \y(Price:500$)");
menu_additem(g_hMenu,"\wBuy Multijump \r(3 Jumps) \y(Price:2000$)");
menu_additem(g_hMenu,"\wBuy Armour \r(50 Ap) \y(Price:500$)");
menu_additem(g_hMenu,"\wBuy Leap Jump \r(1 Big Jump When Press Ctrl+Space) \y(Price:4000$)");
menu_additem(g_hMenu,"\wBuy Silver knife \r(Knife & Model with +20hp Damage) \y(Price:2000$)");
menu_additem(g_hMenu,"\wBuy gold knife \r(Knife & Model with +30hp Damage) \y(Price:3000$)");
menu_additem(g_hMenu,"\wBuy hammer \r(Hammer with +50hp damage and 3 Jumps) \y(Price:4000$)");
menu_additem(g_hMenu,"\wBuy flash bangs 2 \r(Get 2 Flash grenades) \y(Price:1000$)");
menu_additem(g_hMenu,"\wBuy he grenades 2 \r(Get 2 He grenade.) \y(Price:1000$)");
menu_additem(g_hMenu,"\wBuy GOD MOD \r(Get God Mode) \y(Price:16000$)");
}
public cmdshopmenu(client)
{
if (is_user_alive( client ))
{
menu_display(client,g_hMenu);
menu_setprop( g_hMenu, MPROP_EXIT, MEXIT_ALL );
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public mHandler(client,menu,item)
{
if (!is_user_alive(client) && !get_pcvar_num(pEnabled))
return PLUGIN_HANDLED;
new cash[0] = cs_get_user_money(0);
switch(item)
{
case 0:
{
if(cash[0] > 1000)
{
set_user_health(client, get_user_health(client) + 80);
cs_set_user_money(client, cash[id] - 1000);
client_print(client, print_chat, "[NM] You Have Got 80HP!");
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 1:
{
if(cash[id] > 500)
{
set_user_gravity(client, 0.5);
cs_set_user_money(client, cash[id] - 500);
client_print(client, print_chat, "[NM] You Have Got Low Gravity!");
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 3:
{
if(cash[id] > 2000)
{
multijump(client);
cs_set_user_money(client, cash[id] - 2000);
client_print(client, print_chat, "[NM] You Have Got MultiJump,Use it carefully. You have 3 Chance!");
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 4:
{
if(cash[id] > 500)
{
set_user_armor(client, get_user_armor(client) + 50);
cs_set_user_money(client, cash[id] - 500);
client_print(client, print_chat, "[NM] You Have Got 50AP!");
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 5:
{
//leap jump
}
case 6:
{
if(cash[id] > 2000)
{
cs_set_user_model(client, silver_knife);
cs_set_user_money(client, cash[id] - 2000);
client_print(client, print_chat, "[NM] You Have Got Silver Knife!");
//extra damage +20 damage
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 7:
{
if(cash[id] > 3000)
{
cs_set_user_model(client, gold_knife);
cs_set_user_money(client, cash[id] - 3000);
client_print(client, print_chat, "[NM] You Have Got Gold Knife!");
//extra damage +30 dmage
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 8:
{
if(cash[id] > 5000)
{
cs_set_user_model(client, hammer_knife);
cs_set_user_money(client, cash[id] - 5000);
client_print(client, print_chat, "[NM] You Have Hammer!");
//extra damage +50 and multijump 3 times
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 9:
{
if(cash[id] > 1000)
{
give_item(client, weapon_flashbang);
cs_set_user_bpammo(client, CSW_FLASHBANG, 2)
cs_set_user_money(client, cash[id] - 1000);
client_print(client, print_chat, "[NM] You Got 2 FlashBangs!");
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 10:
{
if(cash[id] > 1000)
{
give_item(client, weapon_hegrenade);
cs_set_user_bpammo(client, CSW_HEGRENADE, 2);
cs_set_user_money(client, cash[id] - 1000);
client_print(client, print_chat, "[NM] You Got 2 Grenades!")
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
case 11:
{
if(cash[id] = 16000)
{
Forward__PlayerSpawn_Post( client )
cs_set_user_money(client, cash[id] - 16000);
client_print(client, print_chat, "[NM] You Got GodMode!")
}
else
{
client_print(client, print_chat, "[NM] You Dont Have Enough Of Funds!");
}
}
}
}
multijump(client)
{
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
}
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
}
}
Forward__PlayerSpawn_Post( client )
{
if( !is_user_alive( client ) || !IsPlayer( client ) )
return;
set_user_godmode( client, 1 );
}
Just made this plugin and these error
2. Iwant when new round starts this must reset means every new round every thing must become normal
3. I want to set jump only 3 times when used multijump command after that it must become : false
4. how could i set extra damage on weapon
5. I want to set leap jump and iam not getting its code