RSSy MYGO.pl Opublikowano Grudzień 29, 2020 o 13:08 RSSy Udostępnij Opublikowano Grudzień 29, 2020 o 13:08 i want shop black_pack = 50hp and 100ap start round It ends at death someone help me PHP Code: #include < amxmodx >#include < amxmisc >#include < cstrike >#include < engine >#include < fakemeta >#include < hamsandwich >#include < xs >#include < fun >#include < csx >#define PLUGIN "F & AF SHOP"#define VERSION "1.1"#define AUTHOR "Edited By MR.HaCkER"#define IsPlayer(%0) ( 1 <= %0 <= g_iMaxPlayers )new g_iMaxPlayers;new money [ 6 ]new money1 [ 6 ]new bool: HasKnife [ 33 ]new bool: HasBlack [ 33 ]new bool: HasAk47 [ 33 ]new const Knife [ ] [ ]= { "models/chucky_knifewob.mdl", "models/p_knife.mdl" }new const Black [ ] [ ]= { "models/black_knife.mdl", "models/p_knife.mdl" }new const Ak47 [ ] [ ] = { "models/v_golden_ak47.mdl", "models/p_golden_ak47.mdl" }new const g_weapons [ ] [ ] = { "weapon_m4a1", "weapon_ak47", "weapon_aug", "weapon_sg552", "weapon_famas", "weapon_galil", "weapon_mp5navy", "weapon_p90", "weapon_m3", "weapon_xm1014", "weapon_awp", "weapon_scout", "weapon_tmp", "weapon_mac10", "weapon_m249"}new bloody[32]new g_bk_enabled, g_bk_rndresetpublic plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd( "say", "Func_Say" ); register_clcmd( "say_team", "Func_Say" ); register_clcmd ( "/shop", "CheckAcces" ); register_clcmd ( "shop", "CheckAcces" ); //////////Cvarurile pentru money////////////// money [ 1 ] = register_cvar( "f_item1", "15000" ) money [ 2 ] = register_cvar( "f_item2" ,"3000" ) money [ 3 ] = register_cvar( "f_item3", "3000" ) money [ 4 ] = register_cvar( "f_item4" ,"5000" ) money [ 5 ] = register_cvar( "f_item5" ,"9000" ) money1 [ 1 ] = register_cvar( "af_item1" ,"9000" ) money1 [ 2 ] = register_cvar( "af_item2" ,"300" ) money1 [ 3 ] = register_cvar( "af_item3" ,"3000" ) money1 [ 4 ] = register_cvar( "af_item4" ,"5000" ) money1 [ 5 ] = register_cvar( "af_item5" ,"3000" ) ///////////////////////////////////////////////////////// //////////////////////////////////////////Events/////////////////// g_bk_enabled=register_cvar("bk_enabled","1") g_bk_rndreset=register_cvar("bk_rndreset","0") register_event("CurWeapon","wpnchange","be","1=1") g_iMaxPlayers = get_maxplayers ( ) register_event ( "CurWeapon", "Current_Weapon", "be", "1=1" ); RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" ); RegisterHam ( Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true ); RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1) ////////////////////////////////////////////////////////////////////// }stock ham_strip_weapon(id,weapon[]){ if(!equal(weapon,"weapon_",7)) return 0; new wId = get_weaponid(weapon); if(!wId) return 0; new wEnt; while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {} if(!wEnt) return 0; if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt); if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0; ExecuteHamB(Ham_Item_Kill,wEnt); set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId)); // this block should be used for Counter-Strike: /*if(wId == CSW_C4) { cs_set_user_plant(id,0,0); cs_set_user_bpammo(id,CSW_C4,0); } else if(wId == CSW_SMOKEGRENADE || wId == CSW_FLASHBANG || wId == CSW_HEGRENADE) cs_set_user_bpammo(id,wId,0);*/ return 1;}public plugin_precache( ) { static i; for ( i = 0 ; i < sizeof ( Knife ); i++ ) precache_model ( Knife [ i ] ) for ( i = 0 ; i < sizeof ( Black ); i++ ) precache_model ( Black [ i ] ) for ( i = 0 ; i< sizeof ( Ak47 ) ; i++ ) precache_model ( Ak47 [ i ] ) precache_model ( "models/player/blackfurien/blackfurien.mdl" ); precache_model ( "models/player/blackpackff/blackpackff.mdl" ); precache_model("models/chucky_knife.mdl") precache_sound("misc/chucky.wav") return PLUGIN_CONTINUE}public Ham_CBasePlayer_Killed_Post(id) { HasKnife [ id ] = false bloody[id]=0 HasBlack [ id ] = false cs_reset_user_model(id)}public fwHamPlayerSpawnPost(id) { HasAk47 [ id ] = false bloody[id]=0 if( get_user_team(id) == 2 ) { HasKnife [ id ] = false HasBlack [ id ] = false cs_reset_user_model(id)} }public Func_Say( id ){ new szSaid[ 192 ]; read_args( szSaid, sizeof( szSaid ) -1 ); remove_quotes( szSaid ); if( contain( szSaid, "shop" ) != -1 ) { CheckAcces ( id ) }}public wpnchange(id){ if(get_pcvar_num(g_bk_enabled)){ if(bloody[id]){ chuckyknife(id) } else{ chuckyknifewob(id) } } return PLUGIN_HANDLED}public chuckyknife(id){ new clip, ammo, wpnid = get_user_weapon(id,clip,ammo) if (wpnid == CSW_KNIFE) { if ( HasKnife [ id ] == true ){ entity_set_string(id, EV_SZ_viewmodel, "models/chucky_knife.mdl") } } return PLUGIN_HANDLED}public chuckyknifewob(id){ new clip, ammo, wpnid = get_user_weapon(id,clip,ammo) if (wpnid == CSW_KNIFE) { if ( HasKnife [ id ] == true ){ entity_set_string(id, EV_SZ_viewmodel, "models/chucky_knifewob.mdl") } } return PLUGIN_HANDLED}public client_damage(attacker,victim,damage,wpnindex,hitplace,TA){ if(get_pcvar_num(g_bk_enabled)){ if(wpnindex==CSW_KNIFE){ if ( HasKnife [attacker] == true ) { if(!bloody[attacker])client_cmd(attacker,"spk misc/chucky") bloody[attacker]=1 chuckyknife(attacker) } } } return PLUGIN_CONTINUE}public client_death(killer,victim,wpnindex,hitplace,TK){ bloody[victim]=0 return PLUGIN_CONTINUE}public round_end(){ if(get_pcvar_num(g_bk_rndreset)){ bloody={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } return PLUGIN_CONTINUE}public Current_Weapon ( id ) { new weapon=get_user_weapon(id) if( weapon == CSW_KNIFE ) { if( HasBlack [ id ] == true ) { set_pev ( id, pev_viewmodel2, Black [ 0 ] ); set_pev ( id, pev_weaponmodel2, Black [ 1 ] ); } } if( weapon == CSW_AK47 ) { if( HasAk47 [ id ] == true ) { set_pev ( id, pev_viewmodel2, Ak47 [ 0 ] ); set_pev ( id, pev_weaponmodel2, Ak47 [ 1 ] ); } } }public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage ) { if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasKnife [ iAttacker ] ) { SetHamParamFloat ( 4, fDamage * 2.0 ); return HAM_HANDLED; } if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasBlack [ iAttacker ] ) { SetHamParamFloat ( 4, fDamage * 1.0 ); return HAM_HANDLED; } if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasAk47[ iAttacker ] ) { SetHamParamFloat ( 4, fDamage * 1.5 ); return HAM_HANDLED; } return HAM_IGNORED; }public CheckAcces ( id ) { if( is_user_alive ( id ) ) { if ( get_user_team ( id ) == 1 ) ShowMenu ( id ) if ( get_user_team ( id ) == 2 ) ShowMenu1 ( id ) } }public ShowMenu( id ){ new menu = menu_create( "rFurien Shop By MR.HaCkER", "furien_handler" ); menu_additem(menu, "SuperKnife r15000$", "", 0); menu_additem(menu, "He Grenade r3000$", "", 0); menu_additem(menu, "50 HP r3000$", "", 0); menu_additem(menu, "100 AP + Helment r5000$", "", 0); menu_additem(menu, "Black Pack r9000$", "", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_setprop(menu, MPROP_NOCOLORS, 1); menu_setprop(menu, MPROP_NUMBER_COLOR, "r"); menu_display(id, menu, 0); return PLUGIN_HANDLED;}public furien_handler(id, menu, item){ if(item == MENU_EXIT) { return PLUGIN_HANDLED; } if(get_user_team(id) != 1) return PLUGIN_HANDLED; new command[6], name[64], access, callback new price price = cs_get_user_money( id ) menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback); switch(item) { case 0: { if(price>=get_pcvar_num(money[ 1 ])) { if ( HasKnife [ id ] == false ) { cs_set_user_money( id, price-get_pcvar_num(money [ 1 ] )) ColorChat(id,"^x04[Furien OdSchool v1.4]^x01 You Bought ^x03 SuperKnife!") cs_set_user_model ( id , "blackfurien" ); set_pev ( id, pev_viewmodel2, Knife [ 0 ] ); set_pev ( id, pev_weaponmodel2, Knife [ 1 ] ); HasBlack [ id ] = false HasKnife [ id ] = true } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You Already Have^x03 SuperKnife!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 SuperKnife!") } case 1: { if( price >=get_pcvar_num( money [ 2 ] )) { if( ! user_has_weapon ( id , CSW_HEGRENADE ) ) { cs_set_user_money( id, price-get_pcvar_num(money [ 2 ] )) give_item(id,"weapon_hegrenade") ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You bought ^x03 He Grenade!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You Already Have ^x03 He Grenade!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 He Grenade!") } case 2: { if( price >=get_pcvar_num( money [ 3 ] )) { if( get_user_health ( id ) < 200 ) { cs_set_user_money( id,price- get_pcvar_num(money [ 3 ])) set_user_health ( id, get_user_health ( id ) + 50 ) ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You Bought ^x03 50 HP!") } else ColorChat(id,"^x04[[Furien oldschool v1.4]^x01 You have already reached the limit of ^x03 200 HP !") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 50 HP!") } case 3: { if( price >= get_pcvar_num(money [ 4 ]) ) { if( get_user_armor ( id ) < 100 ) { cs_set_user_money( id,price- get_pcvar_num( money [ 4 ] )) give_item(id,"item_kevlar") give_item(id, "item_assaultsuit") ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You bought^x03 100 AP + Helmet!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You have already reached the limit of ^x03 100 AP!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 100 AP + Helmet!") } case 4: { if(price>=get_pcvar_num(money[ 5 ])) { if ( HasBlack [ id ] == false ) { cs_set_user_money( id, price-get_pcvar_num(money [ 5 ] )) ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You bought ^x03 Black Pack!") cs_set_user_model ( id , "blackpackff" ); set_user_armor ( id, get_user_armor ( id ) + 50 ) set_user_armor ( id, get_user_armor ( id ) + 50 ) set_user_health ( id, get_user_health ( id ) + 50 ) set_pev ( id, pev_viewmodel2, Black [ 0 ] ); set_pev ( id, pev_weaponmodel2, Black [ 1 ] ); give_item(id,"item_kevlar") give_item(id, "item_assaultsuit") HasKnife [ id ] = false HasBlack [ id ] = true } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You Already Have ^x03 Black Pack!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 Black Pack!") } } menu_destroy(menu); return PLUGIN_HANDLED; }public ShowMenu1(id){ new menu2 = menu_create("rAnti-Furien Shop By MR.HaCkER", "af_menu"); menu_additem(menu2, "Golden AK47 r9000$", "", 0); menu_additem(menu2, "Defuse Kit r300$", "", 0); menu_additem(menu2, "50 HP r3000$", "", 0); menu_additem(menu2, "100 AP + Helmet r5000$", "", 0); menu_additem(menu2, "Ammo r3000$", "", 0); menu_setprop(menu2, MPROP_EXIT, MEXIT_ALL); menu_setprop(menu2, MPROP_NOCOLORS, 1); menu_display(id, menu2, 0); return PLUGIN_HANDLED;}public af_menu(id, menu2, item){ if(item == MENU_EXIT) { return PLUGIN_HANDLED; } if(get_user_team(id) != 2) return PLUGIN_HANDLED; new command[6], name[64], access, callback,price price=cs_get_user_money(id) menu_item_getinfo(menu2, item, access, command, sizeof command - 1, name, sizeof name - 1, callback); switch(item) { case 0: { if( price >= get_pcvar_num(money1 [ 1 ]) ) { if ( HasAk47 [ id ] == false ) { cs_set_user_money( id,price-get_pcvar_num(money1 [ 1 ] )) for ( new i ; i < sizeof ( g_weapons ) ; i ++ ) ham_strip_weapon(id, g_weapons [ i ]) give_item(id,"weapon_ak47") set_pev ( id, pev_viewmodel2, Ak47 [ 0 ] ); set_pev ( id, pev_weaponmodel2, Ak47 [ 1 ] ); cs_set_user_bpammo(id,CSW_AK47,250) ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You bought ^x03 Golden AK47!") HasAk47 [ id ] = true } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You Already Have ^x03 Golden AK47!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 Golden AK47!") } case 1: { if( price >=get_pcvar_num( money1 [ 2 ]) ) { if ( ! cs_get_user_defuse ( id ) ) { cs_set_user_money( id, price-get_pcvar_num(money1 [ 2 ] )) cs_set_user_defuse(id,1) ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You bought ^x03 DefuseKit!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You Already Have ^x03 DefuseKit!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 DefuseKit!") } case 2: { if( price >= get_pcvar_num(money1 [ 3 ]) ) { if( get_user_health ( id ) < 200 ) { cs_set_user_money( id, price-get_pcvar_num(money1 [ 3 ]) ) set_user_health(id,get_user_health(id)+50) ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You bought ^x03 50 HP!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You have reached the limit of ^x03 200 HP!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 50 HP!") } case 3: { if( price >= get_pcvar_num(money1 [ 4 ] )) { if( get_user_armor ( id ) < 100 ) { cs_set_user_money( id, price-get_pcvar_num(money1 [ 4 ] )) give_item(id,"item_kevlar") give_item(id, "item_assaultsuit") ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You bought ^x03 100 AP + Helmet!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You have already reached the limit of ^x03 100 AP!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 100 AP + Helmet!") } case 4: { if( price >= get_pcvar_num(money1 [ 5 ]) ) { cs_set_user_money( id,price-get_pcvar_num( money1 [ 5 ] )) cs_set_user_bpammo ( id ,CSW_M4A1, 250 ) cs_set_user_bpammo ( id ,CSW_AK47, 250 ) cs_set_user_bpammo ( id ,CSW_AUG, 250 ) cs_set_user_bpammo ( id ,CSW_SG552, 250 ) cs_set_user_bpammo ( id ,CSW_FAMAS, 250 ) cs_set_user_bpammo ( id ,CSW_GALIL, 250 ) cs_set_user_bpammo ( id ,CSW_MP5NAVY, 250 ) cs_set_user_bpammo ( id ,CSW_P90, 250 ) cs_set_user_bpammo ( id ,CSW_M3, 250 ) cs_set_user_bpammo ( id ,CSW_XM1014, 250 ) cs_set_user_bpammo ( id ,CSW_AWP, 250 ) cs_set_user_bpammo ( id ,CSW_SCOUT, 250 ) cs_set_user_bpammo ( id ,CSW_TMP, 250 ) cs_set_user_bpammo ( id ,CSW_MAC10, 250 ) cs_set_user_bpammo ( id ,CSW_DEAGLE, 250 ) ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You bought ^x03 Ammo (250 gloante)!") } else ColorChat(id,"^x04[Furien oldschool v1.4]^x01 You don't have enough money to buy ^x03 Ammo (250 gloante)!") } } menu_destroy(menu2); return PLUGIN_HANDLED; }public client_putinserver( id ){ HasKnife [ id ] = false HasBlack [ id ] = false cs_reset_user_model(id)}stock ColorChat(const id, const input[], any:...) { new count = 1, players[32]; static msg[191]; vformat(msg, 190, input, 3); replace_all(msg, 190, "!x04", "^4"); replace_all(msg, 190, "!x01", "^1"); replace_all(msg, 190, "!x03", "^3"); if(id) players[0] = id; else get_players(players, count, "ch"); { for(new i = 0; i < count; i++) { if(is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]); write_byte(players[i]); write_string(msg); message_end(); } } } }/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE*{ rtf1 ansi deff0{ fonttbl{ f0 fnil Tahoma;}}n viewkind4 uc1 pard lang1033 f0 fs16 n par }*/ Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi