i new with variable so always i use variable i have warnings can someone fix my plugin: (3 warnings.)
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
#define PLUGIN "Shop HNS"
#define VERSION "1.0"
#define AUTHOR "/A/"
new cash[33];
new autobhop[33];
new doubleshot[33];
new g_iMaxPlayers;
new silentwalk[33];
public plugin_init() {
register_dictionary("ShopHns.txt")
register_clcmd("say /shop","cmdshop")
RegisterHam( Ham_Spawn, "player", "player_spawn", 1 )
RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage");
g_iMaxPlayers = get_maxplayers();
}
public cmdShop(id)
{
new menu = menu_create("\rShop Menu:", "cmdShop_handler");
menu_additem(menu, "\w50Hp \r(\y2000$\r)", "1", 0);
menu_additem(menu, "\w100Hp \r(\y4000$\r)", "2", 0);
menu_additem(menu, "\w50Armor \r(\y1000$\r)", "3", 0);
menu_additem(menu, "\w100Armor \r(\y2000$\r)", "4", 0);
menu_additem(menu, "\wAuto Bhop \r(\y12000$\r)", "5", 0);
menu_additem(menu, "\wHe Grenade \r(\y1000$\r)", "6", 0);
menu_additem(menu, "\wGravity 400 \r(\y12000$\r)", "7", 0);
menu_additem(menu, "\wSpeed 400 \r(\y10000$\r)", "8", 0);
menu_additem(menu, "\wDouble Shot [Knife] \r(\y12000$\r)", "9", 0);
menu_additem(menu, "\wSilent Walk [CT] \r(\y3000$\r)", "10", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public cmdShop_handler(id, menu, item, index)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
cash[id] = cs_get_user_money(id);
new key = str_to_num(data);
switch(key)
{
case 1:
{
if(cash[id] > 2000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_50HP")
cs_set_user_money(id, cash[id] - 2000);
set_user_health(id, get_user_health(id) + 50)
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_50HP")
}
}
case 2:
{
if(cash[id] > 4000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_100HP")
cs_set_user_money(id, cash[id] - 4000);
set_user_health(id, get_user_health(id) + 100)
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_100HP")
}
}
case 3:
{
if(cash[id] > 1000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_50ARMOR")
cs_set_user_money(id, cash[id] - 1000);
set_user_armor(id, get_user_armor(id) + 50)
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_50ARMOR")
}
}
case 4:
{
if(cash[id] > 2000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_100ARMOR")
cs_set_user_money(id, cash[id] - 2000);
set_user_armor(id, get_user_armor(id) + 100)
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_100ARMOR")
}
}
case 5:
{
if(cash[id] > 12000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_AUTOBHOP")
cs_set_user_money(id, cash[id] - 12000);
autobhop[id] = true
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_AUTOBHOP")
autobhop[id] = false
}
}
case 6:
{
if(cash[id] > 1000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_HE")
cs_set_user_money(id, cash[id] - 1000);
give_item(id,"weapon_hegrenade")
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_HE")
}
}
case 7:
{
if(cash[id] > 12000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_GRAVITY")
cs_set_user_money(id, cash[id] - 12000);
set_user_gravity ( index, 0.5)
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_GRAVITY")
}
}
case 8:
{
if(cash[id] > 10000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_SPEED")
cs_set_user_money(id, cash[id] - 10000);
set_user_maxspeed(id, 400.0)
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_SPEED")
}
}
case 9:
{
if(cash[id] > 12000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_DOUBLESHOT")
cs_set_user_money(id, cash[id] - 12000);
doubleshot[id] = true
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_DOUBLESHOT")
doubleshot[id] = false
}
}
case 10:
{
if(cash[id] > 3000)
{
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"HAVE_MONEY_SILENTWALK")
cs_set_user_money(id, cash[id] - 3000);
silentwalk[id] = true
}
else {
client_print(id, print_chat, "[Shop HNS] %L", LANG_PLAYER,"DONT_HAVE_MONEY_SILENTWALK")
silentwalk[id] = false
}
}
} menu_destroy(menu);
return PLUGIN_HANDLED;
}
public client_PreThink(id)
{
if(autobhop[id] && is_user_alive(id))
{
new oldbuttons = get_user_oldbutton(id);
oldbuttons &= ~IN_JUMP;
entity_set_int(id, EV_INT_oldbuttons, oldbuttons);
}
}
public Player_TakeDamage(id, inflictor, attacker, Float:damage, damagebits)
{
if (doubleshot[id])
if( !(1 <= attacker <= g_iMaxPlayers)
|| attacker != inflictor
|| get_user_weapon(attacker) != CSW_KNIFE )
return HAM_IGNORED;
SetHamParamFloat(4, damage * 2); //Here knife does double damage, ofc you can set it to 0.0 or anything.
return HAM_HANDLED;
}
public player_spawn( id )
{
if( is_user_alive( id ) && silentwalk[id])
{
switch( cs_get_user_team( id ) )
{
case CS_TEAM_CT:
{
set_user_footsteps( id, 1 )
}
}
}
}