Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <engine>
- #include <fun>
- #include <superspawns>
- new picked[33] = 0;
- new const wpn_lista[][] = {
- "weapon_p228",
- "weapon_scout",
- "weapon_hegrenade",
- "weapon_xm1014",
- "weapon_mac10",
- "weapon_aug",
- "weapon_elite",
- "weapon_fiveseven",
- "weapon_ump45",
- "weapon_sg550",
- "weapon_galil",
- "weapon_famas",
- "weapon_usp",
- "weapon_glock18",
- "weapon_awp",
- "weapon_mp5navy",
- "weapon_m249",
- "weapon_m3",
- "weapon_m4a1",
- "weapon_tmp",
- "weapon_g3sg1",
- "weapon_deagle",
- "weapon_sg552",
- "weapon_ak47",
- "weapon_p90"
- }
- //new const model[] = "models/box/w_box.mdl"
- new const model[] = "models/w_m4a1.mdl"
- new g_sprite
- public plugin_init() {
- register_plugin("Private JB Game", "1.0", "DecaK / Megastorm")
- register_touch("WPBox", "player", "touchbox");
- register_clcmd("say start", "Start")
- SsInit(3500.0)
- SsScan()
- SsDump()
- }
- public Start(id) {
- new Float:origin[3];
- for(new i = 0;i < 34; i++) if(SsGetOrigin(origin)) create_wpbox(origin)
- SsClean();
- arrayset(picked, 0, 33)
- }
- /*public plugin_precache2()
- {
- precache_model(model)
- g_sprite = precache_model("sprites/box/box_sprite.spr")
- precache_sound("box/touched.wav")
- }*/
- public create_wpbox(Float:Origin[3])
- {
- new ent = create_entity("info_target")
- entity_set_origin(ent, Origin)
- entity_set_string(ent, EV_SZ_classname, "WPBox")
- entity_set_model(ent, model)
- set_rendering ( ent, kRenderFxGlowShell, random_num(128,255),random_num(128,255),random_num(128,255), kRenderFxNone, 255 )
- entity_set_int(ent, EV_INT_solid, SOLID_BBOX)
- entity_set_int(ent, EV_INT_movetype, MOVETYPE_PUSHSTEP)
- entity_set_size(ent,Float:{-2.0,-2.0,-2.0},Float:{5.0,5.0,5.0})
- drop_to_floor(ent)
- /*
- engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0)
- write_byte(TE_BEAMCYLINDER) // TE id
- engfunc(EngFunc_WriteCoord, OriginZrtve[0]) // x
- engfunc(EngFunc_WriteCoord, OriginZrtve[1]) // y
- engfunc(EngFunc_WriteCoord, OriginZrtve[2]) // z
- engfunc(EngFunc_WriteCoord, OriginZrtve[0]) // x axis
- engfunc(EngFunc_WriteCoord, OriginZrtve[1]) // y axis
- engfunc(EngFunc_WriteCoord, OriginZrtve[2]+385.0) // z axis
- write_short(g_sprite) // sprite
- write_byte(0) // startframe
- write_byte(0) // framerate
- write_byte(4) // life
- write_byte(30) // width
- write_byte(0) // noise
- write_byte(250) // red
- write_byte(0) // green
- write_byte(0) // blue
- write_byte(200) // brightness
- write_byte(0) // speed
- message_end()
- */
- }
- public daj_oruzje(id) give_item(id, wpn_lista[random_num(0, sizeof(wpn_lista))])
- public client_connect(id) picked[id] = 0;
- public touchbox(ent, toucher)
- {
- if (!is_user_alive(toucher) || !pev_valid(ent) || picked[toucher] > 3)
- return FMRES_IGNORED
- new classname[32]
- pev(ent, pev_classname, classname, 31)
- if (!equal(classname, "WPBox"))
- return FMRES_IGNORED
- daj_oruzje(toucher)
- picked[toucher]++;
- emit_sound(toucher, CHAN_ITEM, "box/touched.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
- set_pev(ent, pev_effects, EF_NODRAW)
- set_pev(ent, pev_solid, SOLID_NOT)
- if(pev_valid(ent)) engfunc(EngFunc_RemoveEntity, ent)
- return FMRES_IGNORED
- }
Advertisement
Add Comment
Please, Sign In to add comment