Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <csx>
- #include <engine>
- #include <fakemeta>
- #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 userkills[33], bool: MultiJump[33], bool: HaveMultiJump[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)
- new Float:fMaxs[3] = {14.0, 14.0, 35.0};
- new Float:fMins[3] = {-14.0, -14.0, 0.0};
- 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_touch(BB_CLASS, "player", "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
- userkills[id] = 0;
- MultiJump[id] = false
- HaveMultiJump[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 client_death(killer, victim, wpnindex, hitplace, TK)
- {
- if(!killer || is_user_connected(victim) || killer == victim || !is_user_connected(killer))
- return PLUGIN_CONTINUE;
- userkills[killer]++
- client_print(killer, print_center, "Inca %d kill%s pana la cadou!", 5 - userkills[killer], userkills[killer] == 1 ? "" : "-uri");
- if(userkills[killer] == 5)
- {
- client_print(killer, print_center, "Ai dropat cadou!");
- create_present(victim);
- userkills[killer] = 0
- }
- return PLUGIN_CONTINUE
- }
- public create_present(id)
- {
- new iOrigin[3], Float:fOrigin[3];
- new Float:fUserOrigin[3], iUserOrigin[3];
- pev(id, pev_origin, fUserOrigin);
- FVecIVec(fUserOrigin, iUserOrigin);
- iOrigin[0] = iUserOrigin[0];
- iOrigin[1] = iUserOrigin[1];
- iOrigin[2] = iUserOrigin[2];
- IVecFVec(iOrigin, fOrigin);
- new iEnt = create_entity("info_target");
- if(!is_valid_ent(iEnt))
- return 0;
- entity_set_string(iEnt, EV_SZ_classname, BB_CLASS);
- entity_set_origin(iEnt, fOrigin);
- switch(get_user_team(id))
- {
- case 1: entity_set_model(iEnt, BB_ANTIFURIEN_MODEL);
- case 2: entity_set_model(iEnt, BB_FURIEN_MODEL);
- }
- entity_set_int(iEnt, EV_INT_movetype, MOVETYPE_NONE);
- entity_set_int(iEnt, EV_INT_solid, SOLID_BBOX);
- entity_set_size(iEnt, fMins, fMaxs);
- entity_set_edict(iEnt, EV_ENT_owner, id);
- new Float:fVelocity[3];
- fVelocity[0] = (random_float(0.0, 256.0) - 128.0);
- fVelocity[1] = (random_float(0.0, 256.0) - 128.0);
- fVelocity[2] = (random_float(0.0, 300.0) + 75.0);
- entity_set_vector(iEnt, EV_VEC_velocity, fVelocity);
- return 0;
- }
- 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");
- //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" );
- //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" );
- //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!" );
- //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "Full Money^nDescriere: 16k$" );
- }
- }
- entity_set_int(box, EV_INT_solid, SOLID_NOT);
- remove_entity(box);
- return PLUGIN_CONTINUE;
- }
- }
- return PLUGIN_CONTINUE;
- }
- 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();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement