Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <engine>
- #include <fakemeta>
- #include <fakemeta_util>
- #include <hamsandwich>
- #define PLUGIN "BonusBox"
- #define VERSION "1.0"
- #define AUTHOR "Aragon*"
- //#define GOLD_SISTEM
- #if defined GOLD_SISTEM
- #include <furien30_shop>
- #endif
- #define BB_CLASS "Death_BonusBox"
- #define BB_FURIEN_MODEL "models/www_gamezeer_ro/w_gift.mdl"
- #define BB_ANTIFURIEN_MODEL "models/www_gamezeer_ro/w_gift.mdl"
- //#define SPAWNBOX_SOUND "Furien/BonusBoxSpawn.wav"
- //#define TAKEBOX_SOUND "Furien/BonusBoxGet.wav"
- static const ServerLicensedIp[ ] = "89.40.233.137";
- //DANE EDIT
- new Kills[33],
- bool: MultiJump[33],
- bool: HaveMultiJump[33],
- bool: TakenGift[33],
- JumpNum[33]
- new const restricted_maps[][] = {
- "35hp",
- "35hp_2",
- "css_bycadust",
- "fy_snow",
- "awp_garden",
- "awp_bycastor32",
- "awp_zigzag",
- "awp_bucuresti",
- "35hp_32",
- "awp_bycastor",
- "awp_india"
- }
- native set_user_puncte(INDDEX, PUNCTE)
- native get_user_puncte(INDEX)
- native set_user_key(INDEX, KEY)
- native get_user_key(INDEX)
- native set_user_chest(INDEX, CHEST)
- native get_user_chest(INDEX)
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- new ServerIp[20];
- get_user_ip(0, ServerIp, charsmax(ServerIp), 1);
- if(equal(ServerIp, ServerLicensedIp)) {
- new MapName[32]
- get_mapname(MapName, sizeof MapName - 1)
- for(new i; i < sizeof restricted_maps; i++) {
- if(!equal(MapName, restricted_maps[i]))
- plugin_init2()
- else
- pause("ade");
- }
- }
- else
- pause("ade");
- }
- public plugin_init2() {
- register_logevent("LOGEVENT_RoundStart",2,"1=Round_Start")
- register_event("DeathMsg", "EVENT_Death", "a")
- register_think(BB_CLASS,"BonusBox_Think")
- register_touch(BB_CLASS, "*", "BonusBox_Touch")
- register_forward(FM_PlayerPreThink, "FWD_PlayerPreThink");
- }
- public plugin_precache() {
- precache_model(BB_FURIEN_MODEL)
- precache_model(BB_ANTIFURIEN_MODEL)
- //precache_sound(SPAWNBOX_SOUND)
- // precache_sound(TAKEBOX_SOUND)
- }
- public client_putinserver(id) {
- JumpNum[id] = 0
- MultiJump[id] = false
- HaveMultiJump[id] = false
- TakenGift[id] = false
- }
- public FWD_PlayerPreThink(id) {
- if(is_user_connected(id) && is_user_alive(id)) {
- if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP) && HaveMultiJump[id]) {
- if(JumpNum[id] < 2) {
- MultiJump[id] = true
- JumpNum[id]++
- }
- }
- if((get_user_button(id) & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
- JumpNum[id] = 0
- }
- }
- public client_PostThink(id) {
- if(is_user_connected(id) && is_user_alive(id) && MultiJump[id]) {
- 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)
- MultiJump[id] = false
- }
- }
- public LOGEVENT_RoundStart()
- remove_entity_name(BB_CLASS)
- public EVENT_Death() {
- new victim = read_data(2);
- new attacker = read_data(1)
- if(is_user_connected(victim) && cs_get_user_team(victim) != CS_TEAM_SPECTATOR && is_user_connected(attacker) && attacker != victim) {
- Kills[attacker]++
- if(Kills[attacker] == 9)
- GiftTaken[id] = true;
- if(GiftTaken[id]) {
- new ent, Float:Origin[3], Float:Angles[3];
- ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
- engfunc(EngFunc_GetAttachment, victim, 0, Origin, Angles);
- pev(victim, pev_angles, Angles);
- set_pev(ent, pev_origin, Origin);
- set_pev(ent, pev_angles, Angles);
- set_pev(ent, pev_solid, SOLID_BBOX);
- set_pev(ent, pev_movetype, MOVETYPE_PUSHSTEP);
- set_pev(ent, pev_classname, BB_CLASS);
- switch(get_user_team(victim)) {
- case 1: {
- entity_set_model(ent, BB_ANTIFURIEN_MODEL);
- entity_set_int(ent, EV_INT_team, 2);
- }
- case 2: {
- entity_set_model(ent, BB_FURIEN_MODEL);
- entity_set_int(ent, EV_INT_team, 1);
- }
- }
- engfunc(EngFunc_SetSize, ent, Float:{-10.0, -10.0, -25.0},Float:{10.0, 10.0, 25.0})
- set_pev(ent, pev_animtime, get_gametime());
- set_pev(ent, pev_framerate, 1.0);
- set_pev(ent, pev_nextthink, halflife_time() + 0.01);
- Kills[attacker] = 0
- GiftTaken[id] = false
- }
- else
- remove_entity(attacker)
- }
- }
- public BonusBox_Think(entity) {
- if(is_valid_ent(entity)) {
- switch(pev(entity, pev_team)) {
- case 1: {
- Light(entity, 4, 200, 0, 0)
- }
- case 2: {
- Light(entity, 4, 0, 0, 200)
- }
- }
- set_pev(entity, pev_nextthink, halflife_time() + 0.01);
- }
- }
- public BonusBox_Touch(box, touch) {
- if(is_valid_ent(box)) {
- if(is_user_connected(touch) && pev(box, pev_team) == get_user_team(touch)) {
- switch (random_num(1, 5)) {
- case 1: {
- HaveMultiJump[touch] = true;
- Print(touch, "^x03[XMAS Gifts]^x04 Mosul^x01 ti-a oferit^x04 MULTI-JUMP");
- remove_entity(box);
- //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "No Recoil^nDescriere: Gloantele nu mai sar." );
- }
- case 2: {
- set_user_puncte(touch, get_user_puncte(touch) + 100)
- Print( touch,"^x03[XMAS Gifts]^x04 Mosul^x01 ti-a oferit^x04 100 PUNCTE" );
- remove_entity(box);
- //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "Unlimited Clip^nDescriere: AI PRIMIT 100 PUNCTE" );
- }
- case 3: {
- set_user_key(touch, get_user_key(touch) + 1)
- Print ( touch, "^x03[XMAS Gifts]^x04 Mosul^x01 ti-a oferit^x04 1 KEY" );
- remove_entity(box);
- //formatex ( GiftName [ touch ], charsmax ( GiftName [ ] ), "Unlimited Clip^nDescriere: AI PRIMIT 1 KEY" );
- }
- case 4: {
- set_user_chest(touch, get_user_chest(touch) + 1)
- Print ( touch, "^x03[XMAS Gifts]^x04 Mosul^x01 ti-a oferit^x04 1 CHEST" );
- remove_entity(box);
- //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "Unlimited Clip^nDescriere: AI PRIMIT 1 CHEST" );
- }
- case 5: {
- cs_set_user_money ( touch, 16000 );
- Print ( touch, "^x03[XMAS Gifts]^x04 Mosul^x01 ti-a darut niste bani!" );
- remove_entity(box);
- //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "Full Money^nDescriere: 16k$" );
- }
- }
- remove_entity(box)
- }
- }
- }
- stock Light(entity, radius, red, green, blue) {
- if(is_valid_ent(entity)) {
- static Float:origin[3]
- pev(entity, pev_origin, origin)
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY, _, entity);
- write_byte(TE_DLIGHT)
- engfunc(EngFunc_WriteCoord, origin[0])
- engfunc(EngFunc_WriteCoord, origin[1])
- engfunc(EngFunc_WriteCoord, origin[2])
- write_byte(radius)
- write_byte(red)
- write_byte(green)
- write_byte(blue)
- write_byte(1)
- write_byte(0)
- message_end();
- }
- }
- stock Print(const id, const input[], any:...) {
- new count = 1, players[32];
- static msg[191];
- vformat(msg, 190, input, 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 }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement