|
Junior Member
|

10-25-2011
, 17:12
Need Help
|
#1
|
Hi! I want to compile this sma, but i have some problems 
When i compiling sma i have this:
//// deathrun_alls.sma
//C:\Users\elving\Desktop\scripting\deathrun_al ls.sma(1) : error(1): invalid function or declaration
//
// 1 Error
// Could not locate output file C:\Users\elving\Desktop\scripting\compiled\de athrun_alls.amx (compile failed).
Here is code
PHP Code:
#include <amxmisc> #include <amxmodx> #include <engine> #include <fun> #include <cstrike> #include <deathrun_assist> #include <fakemeta_util> #include <hamsandwich>
#define FL_WATERJUMP (1<<11) #define FL_ONGROUND (1<<9)
#define TITLE "[Deathrun Assist]" #define MAXPLAYERS 32 + 1
#define ASSIST_MENU_ID 101204 #define SPAWN_TASK 101205
#define CANT_RELOAD_BITSUM ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
new teamInfo new CONFIG_HP = 100, CONFIG_ARMOR = 200, CONFIG_HPARMOR_COST = 5200, CONFIG_GRAVITY_COST = 6000, CONFIG_RUN_COST = 6000, CONFIG_STEALTH_COST = 11488, CONFIG_DEAGLE_COST = 12460, CONFIG_LIVE_COST = 16000; new Activated_HPARMOR[MAXPLAYERS]; new Activated_Gravity[MAXPLAYERS]; new Activated_Run[MAXPLAYERS]; new Activated_Stealth[MAXPLAYERS]; new Activated_Deagle[MAXPLAYERS];
new bool:Mode_ON, MODE_Num; new bool:timer[33] = false
new Ticks, i_Menu; #include "colors.inl"
#define ZOMBIE_PAIN 2 new pain_zombie[ZOMBIE_PAIN][] = { "la2zombie_source/zombie_pain1.wav", "la2zombie_source/zombie_pain2.wav" }
#define ZOMBIE_DEATH 2 new death_zombie[ZOMBIE_DEATH][] = { "la2zombie_source/zombie_die1.wav", "la2zombie_source/zombie_die2.wav" }
new MODE[][100] = { "FreeRound!", "Neviditelnost", "Zombie", "Rembo", "Klasicky" }
new Float: Origin[MAXPLAYERS][3];
public plugin_init() { register_plugin("Death Run Assistant", "1.0", "Good Hash") register_dictionary("deathrun_assist.txt") register_clcmd("say /menu", "Deathrun_Assist_Menu", ADMIN_ALL) register_clcmd("say menu", "Deathrun_Assist_Menu", ADMIN_ALL) register_clcmd("say_team menu", "Deathrun_Assist_Menu", ADMIN_ALL) register_clcmd("say_team /menu", "Deathrun_Assist_Menu", ADMIN_ALL) register_clcmd("menu", "Deathrun_Assist_Menu") register_clcmd("say", "CMD_modes", ADMIN_ALL) register_event("HLTV", "eventRoundStart", "a", "1=0", "2=0") register_event("DeathMsg","death_msg","a") register_event("CurWeapon","switchweapon","be","1=1","2!29") // Deathrun FreeRun RegisterHam(Ham_Use, "func_button", "fwdUse") RegisterHam(Ham_Touch, "weaponbox", "fwdTouch") RegisterHam(Ham_Touch, "armoury_entity", "fwdTouch") // Deathrun FreeRun register_clcmd("jointeam", "cmdJoinTeam"); register_clcmd("chooseteam", "cmdJoinTeam"); server_cmd ( "sv_maxspeed 999" ); teamInfo = get_user_msgid ("TeamInfo") Mode_ON = false; Ticks = 25 //register_clcmd("say drplus" , "SetLivesNative", ADMIN_ALL) }
public plugin_precache() { precache_model("models/player/zombie_source/zombie_source.mdl") precache_sound("la2zombie_source/zombie_infec.wav") new i; for (i = 0; i < ZOMBIE_PAIN; i++) precache_sound(pain_zombie[i]) for (i = 0; i < ZOMBIE_DEATH; i++) precache_sound(death_zombie[i]) return PLUGIN_CONTINUE }
public HamTakeDamage(victim, inflictor, attacker, id) { if(cs_get_user_team(attacker)==CS_TEAM_T && Mode_ON ) { if (is_user_alive(attacker) && MODE_Num == 2) { if( cs_get_user_team(victim)==CS_TEAM_T ) { return 1 }
entity_get_vector(victim, EV_VEC_origin, Origin[victim]); Origin[victim][2] += 0.0; set_task( 0.1, "Respawn", ( victim + SPAWN_TASK ) ); emit_sound(id, CHAN_VOICE, "la2zombie_source/zombie_infec.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) user_kill(victim) cs_set_user_model(victim, "zombie_source") cs_set_user_team( victim, CS_TEAM_T ) static name[32] get_user_name(victim, name, sizeof name -1) ChatColor(0, "%L",0,"CT_ZOMBI_CHAT", name) set_hudmessage(225, 0, 25, -1.0, 0.25, 1, 0.0, 2.0, 1.0, 1.0, -1) show_hudmessage(0, "%L",0,"CT_ZOMBI_HUD", name) } } if(cs_get_user_team(attacker)==CS_TEAM_CT && Mode_ON ) { if (is_user_alive(victim) && MODE_Num == 2) { emit_sound(id, CHAN_VOICE, pain_zombie[random_num(0, ZOMBIE_PAIN - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) } } return PLUGIN_CONTINUE }
public switchweapon(id) { if ( !Mode_ON ) return PLUGIN_CONTINUE
if(cs_get_user_team(id)==CS_TEAM_T && MODE_Num == 2) { engclient_cmd(id,"weapon_knife") } if(cs_get_user_team(id)==CS_TEAM_T && MODE_Num == 3) { if( CANT_RELOAD_BITSUM & (1<<read_data(2)) || read_data(3) > 1 ) return PLUGIN_CONTINUE
set_pdata_int(get_pdata_cbase(id, 373), 51, 100, 4) } return PLUGIN_CONTINUE }
public Respawn(id) { if ( id > SPAWN_TASK ) id -= SPAWN_TASK if(is_user_connected(id) && Mode_ON && MODE_Num == 2 ) { ExecuteHamB(Ham_CS_RoundRespawn, id); set_user_health( id, 1000 ) entity_set_origin(id, Origin[id]); } }
public fwdUse(ent, idcaller, idactivator, use_type, Float:value) { if (is_user_alive(idactivator) && Mode_ON && get_user_team(idactivator) == 1 ) { switch ( MODE_Num ) { case 0: { client_print(idactivator, print_center, "Vybrali jste %s!", MODE[MODE_Num] ) return HAM_SUPERCEDE } case 1: { client_print(idactivator, print_center, "Vybrali jste %s", MODE[MODE_Num]) return HAM_SUPERCEDE } case 2: { client_print(idactivator, print_center, "Vybrali jste %s", MODE[MODE_Num]) return HAM_SUPERCEDE } case 3: { client_print(idactivator, print_center, "Vybrali jste %s", MODE[MODE_Num]) return HAM_SUPERCEDE } } }
return HAM_IGNORED }
public fwdTouch(ent, id) { if ( is_user_alive(id) && MODE_Num == 0 && Mode_ON ) return HAM_SUPERCEDE
return HAM_IGNORED }
public CMD_modes(id, level, cid) {
if( !timer[id] ) { if ( get_user_team(id) != 1 || Mode_ON ) { client_print(id, print_center, "") return PLUGIN_CONTINUE } new message[192]; read_args(message, 191) remove_quotes(message) if ( containi( message, "/free" ) != -1 || contain(message, "free") != -1 ) { MODE_Num = 0; Mode_ON = true timer[id] = false; set_hudmessage( 0, 255, 0, 0.02, -1.0, 0, 6.0, 12.0, 0.1, 0.2, -1 ) show_hudmessage(0, "%L",0,"FREE_GO") set_user_health( id, 100 ) new i for ( i = 1; i < 33; i++ ) { if ( is_user_alive ( i ) ) { strip_user_weapons ( i) give_item( i, "weapon_knife" ) } } } if ( containi( message, "/invis" ) != -1 || contain(message, "invis" ) != -1 ) { MODE_Num = 1; Mode_ON = true timer[id] = false; set_hudmessage( 0, 255, 0, 0.02, -1.0, 0, 6.0, 12.0, 0.1, 0.2, -1 ) show_hudmessage(0, "%L",0,"INVISE_GO") set_user_health( id, 250 ) set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 ) } if ( containi( message, "/zombie" ) != -1 || contain(message, "zombie") != -1 || contain(message, "/zm") != -1 ) { MODE_Num = 2; Mode_ON = true timer[id] = false; cs_set_user_model(id, "zombie_source") set_user_health( id, 1000 ) set_hudmessage( 0, 255, 0, 0.02, -1.0, 0, 6.0, 12.0, 0.1, 0.2, -1 ) show_hudmessage(0, "%L",0,"ZOMBI_GO") } if ( containi( message, "/rembo" ) != -1 || contain(message, "rembo") != -1 ) { MODE_Num = 3; Mode_ON = true timer[id] = false; set_hudmessage( 0, 0, 2555, 0.02, -1.0, 0, 6.0, 12.0, 0.1, 0.2, -1 ) show_hudmessage(0, "%L",0,"REMBO_GO") new i; for (i = 1; i < 33; i++) { if ( is_user_alive ( i ) ) { strip_user_weapons ( i ); set_user_health( i , get_user_health( i ) + 50 ) set_user_rendering( i, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 ) give_item( i, "weapon_knife") give_item( i, "weapon_shield") give_item( i, "weapon_glock18") cs_set_user_bpammo( i, CSW_GLOCK18, 220) } } set_user_health( id , get_user_health( id ) + 200 ) strip_user_weapons ( id ); set_user_rendering( id ); give_item(id, "weapon_knife") give_item(id, "weapon_m249") cs_set_user_bpammo(id, CSW_M249, 250) set_user_gravity(id, 0.9) set_user_maxspeed(id, 500.0) } if ( containi( message, "/class1c" ) != -1 ) { MODE_Num = -1; Mode_ON = true timer[id] = false; set_hudmessage( 0, 255, 0, 0.02, -1.0, 0, 6.0, 12.0, 0.1, 0.2, -1 ) show_hudmessage(0, "%L",0,"CLASSIC_GO") } } else { client_print( id,print_chat, "%s Время выбора раунда прошло!", TITLE ) client_print(0,print_chat, "%L",0,"CLASSIC_GO") } return PLUGIN_CONTINUE }
public eventRoundStart(id) { new i Mode_ON = false MODE_Num = -1; Ticks = 25 for(i=1;i<= 33;i++) { if(is_user_connected(i)) { timer[i] = false cs_reset_user_model(i) set_user_rendering( i ) if ( cs_get_user_team(i)==CS_TEAM_T && !is_user_bot ( i ) ) set_task ( 1.0, "T_Menu_Try", i + 41292, _, _, "a", Ticks ); } } }
public T_Menu_Try ( id ) { if ( id > 41292 ) id -= 41292 Ticks -= 1; if ( Ticks < 1 ) { if ( task_exists ( id + 41292 ) ) { remove_task ( id + 41292 ); } timer[id] = true } if ( is_user_connected ( id ) ) if ( !Mode_ON ) T_Menu ( id ) else menu_destroy( i_Menu ) }
public death_msg() { new id = read_data(2) if ( Mode_ON && MODE_Num == 2 ) if ( cs_get_user_team(id)==CS_TEAM_T ) emit_sound(id, CHAN_VOICE, death_zombie[random_num(0, ZOMBIE_PAIN - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM) Activated_HPARMOR[id] = 0; Activated_Gravity[id] = 0; Activated_Run[id] = 0; Activated_Stealth[id] = 0; Activated_Deagle[id] = 0; }
public client_putinserver ( id ) client_cmd(id, "bind F3 menu") public cmdJoinTeam(id) { Deathrun_Assist_Menu ( id ); set_task ( 0.1, "Deathrun_Assist_Menu", id + ASSIST_MENU_ID ); }
public Deathrun_Assist_Menu ( id ) { if ( id > ASSIST_MENU_ID ) id -= ASSIST_MENU_ID new menuTitle[127], main1[127], main2[127], main3[127], NEXT[20], BACK[20], EXIT[20]; formatex(menuTitle, charsmax(menuTitle), "%L", id, "MENU_TITLE_MAIN"); formatex(main1, charsmax(main1), "%L", id, "MENU_MAIN_FREE"); formatex(main2, charsmax(main2), "%L", id, "MENU_MAIN_OPERATIONS"); formatex(main3, charsmax(main3), "%L", id, "MENU_MAIN_BLACK"); formatex(NEXT, charsmax(NEXT), "%L", id, "NEXT"); formatex(BACK, charsmax(BACK), "%L", id, "BACK"); formatex(EXIT, charsmax(EXIT), "%L", id, "EXIT"); i_Menu = menu_create(menuTitle, "__Deathrun_Assist_Menu") menu_additem(i_Menu, main1, "1", 0) menu_additem(i_Menu, main2, "2", 0) menu_additem(i_Menu, main3, "3", 0) menu_addblank(i_Menu, 7) menu_addblank(i_Menu, 8) menu_addblank(i_Menu, 9) menu_setprop(i_Menu, MPROP_NEXTNAME, NEXT) menu_setprop(i_Menu, MPROP_BACKNAME, BACK) menu_setprop(i_Menu, MPROP_EXITNAME, EXIT) menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, i_Menu, 0) }
public resetspeed(who) entity_set_float( who, EV_FL_maxspeed, float(250) ) public set_stealth ( id ) { if ( is_user_alive( id ) && Activated_Stealth[id] ) { set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture, 1 ) } } public TestLivesNative ( id ) { new lives = get_user_lives ( id ); client_print( id, print_chat, "%s lives are %i", TITLE, lives ) }
public SetLivesNative ( id ) { new lives = get_user_lives ( id ); set_user_lives ( id, lives + 2 ); lives = get_user_lives ( id ); client_print( id, print_chat, "%s lives are %i", TITLE, lives ) }
public client_PreThink(id) { /* [ Bunny Hop Production ] */ entity_set_float(id, EV_FL_fuser2, 0.0)
if (entity_get_int(id, EV_INT_button) & 2) {
new flags = entity_get_int(id, EV_INT_flags)
if (flags & FL_WATERJUMP) return PLUGIN_CONTINUE if ( entity_get_int(id, EV_INT_waterlevel) >= 2 ) return PLUGIN_CONTINUE if ( !(flags & FL_ONGROUND) ) return PLUGIN_CONTINUE
new Float:velocity[3]; entity_get_vector(id, EV_VEC_velocity, velocity) velocity[2] += 250.0 entity_set_vector(id, EV_VEC_velocity, velocity) entity_set_int(id, EV_INT_gaitsequence, 6) //new Float:speed = get_user_maxspeed(id) + 5.0; //set_user_maxspeed(id , speed); set_user_maxspeed(id , float ( 999) ); } else resetspeed ( id ); if (is_user_alive(id)) { set_stealth(id); if ( Activated_Run[id] ) { set_user_maxspeed(id, float(400)) } } /* [ Bunny Hop Production ] */ return PLUGIN_CONTINUE }
public T_Menu ( id ) { new menuTitle[127], main1[127], main2[127], main3[127], main4[127], main5[127], NEXT[20], BACK[20], EXIT[20]; formatex(menuTitle, charsmax(menuTitle), "%L", id, "MENU_TITLE_T", Ticks ); formatex(main1, charsmax(main1), "%s", MODE[0] ) formatex(main2, charsmax(main2), "%s", MODE[1] ) formatex(main3, charsmax(main3), "%s", MODE[2] ) formatex(main4, charsmax(main4), "%s", MODE[3] ) formatex(main5, charsmax(main5), "%s", MODE[4] ) formatex(NEXT, charsmax(NEXT), "%L", id, "NEXT"); formatex(BACK, charsmax(BACK), "%L", id, "BACK"); formatex(EXIT, charsmax(EXIT), "%L", id, "EXIT"); i_Menu = menu_create(menuTitle, "__T_Menu") menu_additem(i_Menu, main1, "1", 0) menu_additem(i_Menu, main2, "2", 0) menu_additem(i_Menu, main3, "3", 0) menu_additem(i_Menu, main4, "4", 0) menu_additem(i_Menu, main5, "5", 0) menu_addblank(i_Menu, 7) menu_addblank(i_Menu, 8) menu_addblank(i_Menu, 9) menu_setprop(i_Menu, MPROP_NEXTNAME, NEXT) menu_setprop(i_Menu, MPROP_BACKNAME, BACK) menu_setprop(i_Menu, MPROP_EXITNAME, EXIT) menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, i_Menu, 0) return; }
public __T_Menu(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } if ( Mode_ON || timer[id] == true ) { menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Key = str_to_num(s_Data)
if ( task_exists ( id + 41292 ) ) { remove_task ( id + 41292 ); } switch(i_Key) { case 1: { client_cmd ( id, "say /free" ); } case 2: { client_cmd ( id, "say /invise" ); } case 3: { client_cmd ( id, "say /zm" ); } case 4: { client_cmd ( id, "say /rembo" ); } case 5: { client_cmd ( id, "say /class1c" ); } }
menu_destroy(menu) return PLUGIN_HANDLED }
public __Deathrun_Assist_Menu(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED }
new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Key = str_to_num(s_Data)
switch(i_Key) { case 1: { Free_Menu(id) } case 2: { PayMent_Menu(id) } case 3: { Black_Fun_Menu(id) } }
menu_destroy(menu) return PLUGIN_HANDLED }
public Black_Fun_Menu ( id ) { new menuTitle[127], main1[127], main2[127], NEXT[20], BACK[20], EXIT[20]; formatex(menuTitle, charsmax(menuTitle), "%L", id, "MENU_TITLE_BLACK"); formatex(main1, charsmax(main1), "%L", id, "MENU_BLACK_LIVE_BUY", 1 ); formatex(main2, charsmax(main2), "%L", id, "MENU_BLACK_LIVE_SELL", CONFIG_GRAVITY_COST ); formatex(NEXT, charsmax(NEXT), "%L", id, "NEXT"); formatex(BACK, charsmax(BACK), "%L", id, "BACK"); formatex(EXIT, charsmax(EXIT), "%L", id, "EXIT"); i_Menu = menu_create(menuTitle, "__Black_Fun_Menu") menu_additem(i_Menu, main1, "100", 0) menu_additem(i_Menu, main2, "101", 0) menu_addblank(i_Menu, 7) menu_addblank(i_Menu, 8) menu_addblank(i_Menu, 9) menu_setprop(i_Menu, MPROP_NEXTNAME, NEXT) menu_setprop(i_Menu, MPROP_BACKNAME, BACK) menu_setprop(i_Menu, MPROP_EXITNAME, EXIT) menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, i_Menu, 0) }
public PayMent_Menu ( id ) { new menuTitle[127], main1[127], main2[127], main3[127], main4[127], main5[127], NEXT[20], BACK[20], EXIT[20]; formatex(menuTitle, charsmax(menuTitle), "%L", id, "MENU_TITLE_PAY"); formatex(main1, charsmax(main1), "%L", id, "MENU_PAY_HPARMOR", CONFIG_HP, CONFIG_ARMOR, CONFIG_HPARMOR_COST ); formatex(main2, charsmax(main2), "%L", id, "MENU_PAY_GRAVITY", CONFIG_GRAVITY_COST ); formatex(main3, charsmax(main3), "%L", id, "MENU_PAY_RUN", CONFIG_RUN_COST ); formatex(main4, charsmax(main4), "%L", id, "MENU_PAY_STEALTH", CONFIG_STEALTH_COST ); formatex(main5, charsmax(main5), "%L", id, "MENU_PAY_DEAGLE", CONFIG_DEAGLE_COST ); formatex(NEXT, charsmax(NEXT), "%L", id, "NEXT"); formatex(BACK, charsmax(BACK), "%L", id, "BACK"); formatex(EXIT, charsmax(EXIT), "%L", id, "EXIT"); i_Menu = menu_create(menuTitle, "__PayMent_Menu") menu_additem(i_Menu, main1, "1", 0) menu_additem(i_Menu, main2, "2", 0) menu_additem(i_Menu, main3, "3", 0) menu_additem(i_Menu, main4, "4", 0) menu_additem(i_Menu, main5, "5", 0) menu_addblank(i_Menu, 7) menu_addblank(i_Menu, 8) menu_addblank(i_Menu, 9) menu_setprop(i_Menu, MPROP_NEXTNAME, NEXT) menu_setprop(i_Menu, MPROP_BACKNAME, BACK) menu_setprop(i_Menu, MPROP_EXITNAME, EXIT) menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, i_Menu, 0) }
public Free_Menu ( id ) { new menuTitle[127], main1[127], main2[127], NEXT[20], BACK[20], EXIT[20]; formatex(menuTitle, charsmax(menuTitle), "%L", id, "MENU_TITLE_MAIN"); formatex(main1, charsmax(main1), "%L", id, "MENU_FREE_TRAIL"); formatex(main2, charsmax(main2), "%L", id, "MENU_TRAIL_OFF"); formatex(NEXT, charsmax(NEXT), "%L", id, "NEXT"); formatex(BACK, charsmax(BACK), "%L", id, "BACK"); formatex(EXIT, charsmax(EXIT), "%L", id, "EXIT"); i_Menu = menu_create(menuTitle, "__Free_Menu") menu_additem(i_Menu, main1, "1", 0) menu_additem(i_Menu, main2, "2", 0) menu_addblank(i_Menu, 7) menu_addblank(i_Menu, 8) menu_addblank(i_Menu, 9) menu_setprop(i_Menu, MPROP_NEXTNAME, NEXT) menu_setprop(i_Menu, MPROP_BACKNAME, BACK) menu_setprop(i_Menu, MPROP_EXITNAME, EXIT) menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, i_Menu, 0) }
public __Black_Fun_Menu(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED }
new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Key = str_to_num(s_Data)
Buy_Something ( id, i_Key )
menu_destroy(menu) return PLUGIN_HANDLED }
public __Free_Menu(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED }
new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Key = str_to_num(s_Data)
switch(i_Key) { case 1: { client_cmd ( id, "say trail random" ); client_print(id, print_chat, "%L", id, "MENU_FREE_TRAIL", TITLE ); } case 2: { client_cmd ( id, "say trail off" ); } }
menu_destroy(menu) return PLUGIN_HANDLED }
public __PayMent_Menu(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED }
new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Key = str_to_num(s_Data)
Buy_Something ( id, i_Key )
menu_destroy(menu) return PLUGIN_HANDLED }
public Buy_Something ( id, ItemID ) { new returntext[147]; if ( !is_user_alive(id) ) { formatex(returntext, charsmax(returntext), "%L", id, "DEAD_TRY_BUY", TITLE); colored_message( id, returntext,4 ) return PLUGIN_HANDLED } new money = cs_get_user_money(id) switch(ItemID) { case 1: { if (Activated_HPARMOR[id] >= 1) { return PLUGIN_HANDLED; } if ( money >= CONFIG_HPARMOR_COST ) { cs_set_user_money(id, money - CONFIG_HPARMOR_COST, 0) Activated_HPARMOR[id] += 1; cs_set_user_armor(id, 200, CS_ARMOR_VESTHELM); set_user_health(id, get_user_health ( id ) + 100 ); formatex(returntext, charsmax(returntext), "%L", id, "BOUGHT_HP_ARMOR", TITLE); colored_message( id, returntext,3 ) } else { formatex(returntext, charsmax(returntext), "%L", id, "NOT_ENOUGH_MONEY", TITLE); colored_message( id, returntext,4 ) } } case 2: { if (Activated_Gravity[id] >= 1) { return PLUGIN_HANDLED; } if (money >= CONFIG_GRAVITY_COST) { cs_set_user_money(id, money - CONFIG_GRAVITY_COST, 0) Activated_Gravity[id] += 1; SetGravity( id ) formatex(returntext, charsmax(returntext), "%L", id, "BOUGHT_GRAVITY", TITLE); colored_message( id, returntext,3 ) } else { formatex(returntext, charsmax(returntext), "%L", id, "NOT_ENOUGH_MONEY", TITLE); colored_message( id, returntext,4 ) } } case 3: { if (Activated_Run[id] >= 1) { return PLUGIN_HANDLED; } if (money >= CONFIG_RUN_COST) { cs_set_user_money(id, money - CONFIG_RUN_COST, 0) Activated_Run[id] += 1; formatex(returntext, charsmax(returntext), "%L", id, "BOUGHT_RUN", TITLE); colored_message( id, returntext,3 ) } else { formatex(returntext, charsmax(returntext), "%L", id, "NOT_ENOUGH_MONEY", TITLE); colored_message( id, returntext,4 ) } } case 4: { if (Activated_Stealth[id] >= 1) { return PLUGIN_HANDLED; } if (money >= CONFIG_STEALTH_COST) { cs_set_user_money(id, money - CONFIG_STEALTH_COST, 0) Activated_Stealth[id] += 1; formatex(returntext, charsmax(returntext), "%L", id, "BOUGHT_STEALTH", TITLE); colored_message( id, returntext,3 ) } else { formatex(returntext, charsmax(returntext), "%L", id, "NOT_ENOUGH_MONEY", TITLE); colored_message( id, returntext,4 ) } } case 5: { if ( Mode_ON && MODE_Num == 3 ) { formatex(returntext, charsmax(returntext), "%L", id, "ZOMBI_NO_WEAPON", TITLE); colored_message( id, returntext,4 ) return PLUGIN_HANDLED; } if (Activated_Deagle[id] >= 1) { return PLUGIN_HANDLED; } if (money >= CONFIG_DEAGLE_COST) { cs_set_user_money(id, money - CONFIG_DEAGLE_COST, 0) strip_user_weapons ( id ); give_item ( id, "weapon_deagle" ); give_item ( id, "weapon_knife" ); formatex(returntext, charsmax(returntext), "%L", id, "BOUGHT_DEAGLE", TITLE); colored_message( id, returntext,3 ) Activated_Deagle[id] += 1; } else { formatex(returntext, charsmax(returntext), "%L", id, "NOT_ENOUGH_MONEY", TITLE); colored_message( id, returntext,4 ) } } case 100: { if (money >= CONFIG_LIVE_COST) { cs_set_user_money(id, money - CONFIG_LIVE_COST, 0) new lives = get_user_lives ( id ); set_user_lives ( id, lives + 1 ); formatex(returntext, charsmax(returntext), "%L", id, "BOUGHT_LIVE", TITLE, lives + 1 ); colored_message( id, returntext,3 ) } else { formatex(returntext, charsmax(returntext), "%L", id, "NOT_ENOUGH_MONEY", TITLE); colored_message( id, returntext,4 ) } } case 101: { new lives = get_user_lives ( id ); if ( lives >= 1 ) { set_user_lives ( id, lives - 1 ); cs_set_user_money(id, money + CONFIG_LIVE_COST-2500, 1) formatex(returntext, charsmax(returntext), "%L", id, "SELL_LIVE", TITLE, lives - 1 ); colored_message( id, returntext,3 ) } else { formatex(returntext, charsmax(returntext), "%L", id, "NOT_ENOUGH_SOULS", TITLE); colored_message( id, returntext,4 ) } } } return PLUGIN_CONTINUE; }
public SetGravity( id ) {
if ( !is_user_alive(id) ) { return; }
if ( Activated_Gravity[id] ) { set_user_gravity( id, 0.4)//get_cvar_float ("jump_high")); } else set_user_gravity( id, 1.0)
return; }
Anybody can fix this, please  or what is problem?
Sorry for my bad English
Last edited by Qifi; 10-25-2011 at 17:14.
|
|