Converted FG-LAUNCHER ( Cool Extra Item )

Zombies/Humans Extra-Items
User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 10 times
Contact:

FG-LAUNCHER ( Cool Extra Item )

#1

Post by SexY DeviL CJ » 1 Year Ago

ZE EXTRA FG-LAUNCHER
Description:-

So Basically What This Plugin Does Is Shoot A Rocket On Zombies Original Idea From ZP Now Converted To ZE.
[NOTE]:- I Only Converted It This Plugin Is Not Tested But I am Sure It Will Work Normal As It Was Compiled With No Errors If You Found One Please Tell Me I'll Fix It :)

Proof Of Compiling Plugin:-
Image


Screenshots:-
Well I Only Have One
Image

Downloads:-
[ ZE ] Extra İtem Fglauncher.rar
(1.41 MiB) Downloaded 41 times
[ ZE ] Extra İtem Fglauncher.rar
(1.41 MiB) Downloaded 41 times
These users thanked the author SexY DeviL CJ for the post:
Jack GamePlay (1 Year Ago)
......Devil Was Here......

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#2

Post by johnnysins2000 » 1 Year Ago

Nice.... But if u have time you should also test and post some pics of ze as well !
Nobody Is That Busy If They Make Time :roll:

User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 10 times
Contact:

#3

Post by SexY DeviL CJ » 1 Year Ago

johnnysins2000 wrote:
1 Year Ago
Nice.... But if u have time you should also test and post some pics of ze as well !
Yea brother i always post pics but today i was busy with some other work so i didnt tested anyways thanks for your opinion :)
......Devil Was Here......

Rain1153
Senior Member
Senior Member
India
Posts: 277
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#4

Post by Rain1153 » 1 Year Ago

Bro, if your plugin is same as this https://escapers-zone.net/viewtopic.php?f=14&t=269 then there is a major bug in the plugin
LOL

User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 10 times
Contact:

#5

Post by SexY DeviL CJ » 1 Year Ago

Rain1153 wrote:
1 Year Ago
Bro, if your plugin is same as this https://escapers-zone.net/viewtopic.php?f=14&t=269 then there is a major bug in the plugin
what bug are u getting ?
......Devil Was Here......

Rain1153
Senior Member
Senior Member
India
Posts: 277
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#6

Post by Rain1153 » 1 Year Ago

i forgot i tested it last year
LOL

User avatar
SexY DeviL CJ
Mod Tester
Mod Tester
Posts: 73
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 10 times
Contact:

#7

Post by SexY DeviL CJ » 1 Year Ago

Rain1153 wrote:
1 Year Ago
i forgot i tested it last year
xD
......Devil Was Here......

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 507
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

#8

Post by czirimbolo » 1 Year Ago

its bugged, when you type /get, you will get that weapon, even in you are a zombie ;)
Image

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 577
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 47 times
Age: 19
Contact:

#9

Post by Jack GamePlay » 1 Year Ago

czirimbolo wrote:
1 Year Ago
its bugged, when you type /get, you will get that weapon, even in you are a zombie ;)
When you add a command to a gun & you face a problem like that then the problem is from you.
That command is like a hack.
Also, there is no command like that in the code.
Anyway, try this code:
  1.     #include <zombie_escape>
  2.     #include <cstrike>
  3.     #include <engine>
  4.     #include <fun>
  5.      
  6.     #define PLUGIN "FG-Launcher"
  7.     #define VERSION "1.0"
  8.     #define AUTHOR "SexY DeviL CJ"
  9.      
  10.     #define bpammo 40
  11.     #define clipammo 10
  12.     #define damage 80
  13.     #define fgl "weapon_mp5navy"
  14.     #define CSW_FGLAUNCHER CSW_MP5NAVY
  15.     #define v_model "models/v_fglauncher.mdl"
  16.     #define p_model "models/p_fglauncher.mdl"
  17.     #define w_model "models/w_fglauncher.mdl"
  18.     #define s_model "models/s_fglauncher.mdl"
  19.     #define spark_sprite1 "sprites/spark2.spr"
  20.     #define spark_sprite2 "sprites/spark3.spr"
  21.     #define shoot_sound "weapons/fglauncher-1.wav"
  22.      
  23.     new id
  24.     new bool:gHasFg[33], sTrail, sExplo, gmsgWeaponList, g_iItemID;
  25.      
  26.     public plugin_init() {
  27.         register_plugin(PLUGIN, VERSION, AUTHOR);
  28.         RegisterHam(Ham_Weapon_PrimaryAttack, fgl, "fgl_Pattack");
  29.         RegisterHam(Ham_Item_AddToPlayer, fgl, "fgl_atp");
  30.         register_forward(FM_SetModel, "fgl_setmodel");
  31.         register_forward(FM_UpdateClientData, "client_data_post", 1);
  32.         register_event("CurWeapon","CurrentWeapon","be","1=1")
  33.         RegisterHam(Ham_Item_PostFrame, fgl, "fgl_PostFrame");
  34.         RegisterHam(Ham_Weapon_Reload, fgl, "fgl_Reload");
  35.         RegisterHam(Ham_Weapon_Reload, fgl, "fgl_Reload_Post", 1);
  36.        
  37.         register_clcmd("weapon_fglauncher_cso", "Hook_Select");
  38.        
  39.         register_touch("fgl_grenade", "*", "fgl_touch");
  40.        
  41.         gmsgWeaponList = get_user_msgid("WeaponList");
  42.        
  43.         g_iItemID = ze_register_item("FG-LAUNCHER", 140, 0);
  44.     }
  45.      
  46.     public plugin_precache(){
  47.         precache_model(v_model);
  48.         precache_model(p_model);
  49.         precache_model(w_model);
  50.         precache_model(s_model);
  51.         precache_generic( "sprites/weapon_fglauncher_cso.txt" );
  52.         precache_generic( "sprites/cso/640hud86.spr" );
  53.         precache_generic( "sprites/cso/640hud7x.spr" );
  54.         precache_generic( "sprites/cso/scope_vip_grenade.spr" );
  55.         sTrail = precache_model(spark_sprite2);
  56.         sExplo = precache_model(spark_sprite1);
  57.         precache_sound(shoot_sound);
  58.     }
  59.      
  60.     public ze_select_item_pre(id, itemid)
  61.     {
  62.         // Return Available and we will block it in Post, So it dosen't affect other plugins
  63.         if (itemid != g_iItemID)
  64.             return ZE_ITEM_AVAILABLE
  65.        
  66.         // Available for Humans only, So don't show it for zombies
  67.         if (ze_is_user_zombie(id))
  68.             return ZE_ITEM_DONT_SHOW
  69.        
  70.         return ZE_ITEM_AVAILABLE
  71.     }
  72.      
  73.     public ze_select_item_post(player, itemid)
  74.     {
  75.         if (itemid == g_iItemID)
  76.         {
  77.             fgl_Give(id);
  78.         }
  79.     }
  80.      
  81.     public ze_user_infected(id)
  82.     {
  83.         if (!is_user_alive(id))
  84.             return
  85.      
  86.         if (gHasFg[id])
  87.             fgl_Remove(id)
  88.     }
  89.      
  90.     public fgl_Remove(id)
  91.     {
  92.         gHasFg[id] = false
  93.         Sprite(id, 0)
  94.     }
  95.      
  96.     public Hook_Select(id)
  97.     {
  98.         engclient_cmd(id, fgl);
  99.         return PLUGIN_HANDLED;
  100.     }
  101.      
  102.     public CurrentWeapon(id){
  103.         static lastweapon[33];
  104.         if(gHasFg[id] && get_user_weapon(id) == CSW_FGLAUNCHER){
  105.             if(lastweapon[id] != CSW_FGLAUNCHER) set_pev(id, pev_weaponanim, 3);
  106.             set_pev(id, pev_viewmodel2, v_model);
  107.             set_pev(id, pev_weaponmodel2, p_model);
  108.         }
  109.         lastweapon[id] = get_user_weapon(id);
  110.     }
  111.      
  112.     public fgl_Pattack(weapon){
  113.         new owner = pev(weapon, pev_owner);
  114.        
  115.         if(gHasFg[owner] && cs_get_weapon_ammo(weapon)>0){
  116.             fakeshoot(owner, weapon);
  117.      
  118.             return HAM_SUPERCEDE;
  119.         }
  120.         return HAM_IGNORED;
  121.     }
  122.      
  123.     public fgl_atp(fg, id) {
  124.         if(!is_valid_ent(fg) || !is_user_connected(id)) return HAM_IGNORED;
  125.            
  126.         if(entity_get_int(fg, EV_INT_impulse) == 1431)
  127.         {
  128.             gHasFg[id] = true;
  129.             entity_set_int(fg, EV_INT_impulse, 0);
  130.             Sprite(id);
  131.             return HAM_HANDLED;
  132.         }
  133.         else Sprite(id,0);
  134.        
  135.         return HAM_IGNORED;
  136.     }
  137.      
  138.     public fgl_setmodel(entity, model[])
  139.     {
  140.         if(!is_valid_ent(entity))
  141.             return FMRES_IGNORED;
  142.        
  143.         new cn[33];
  144.         pev(entity, pev_classname, cn, 32);
  145.        
  146.         if(equal(cn, "weaponbox")) {
  147.        
  148.             new owner = pev(entity, pev_owner);
  149.        
  150.             if(equal(model, "models/w_mp5.mdl"))
  151.             {
  152.                 static iStoredFGID;
  153.                 iStoredFGID = find_ent_by_owner(-1, "weapon_mp5navy", entity);
  154.                
  155.                 if(gHasFg[owner] && is_valid_ent(iStoredFGID))
  156.                 {
  157.                     entity_set_int(iStoredFGID, EV_INT_impulse, 1431);
  158.                     gHasFg[owner] = false;
  159.                    
  160.                     entity_set_model(entity, w_model);
  161.                     return FMRES_SUPERCEDE;
  162.                 }
  163.             }
  164.         }
  165.        
  166.         return FMRES_IGNORED;
  167.     }
  168.      
  169.     public fakeshoot(id, weapon){
  170.         new Float:f[3];
  171.         cs_set_weapon_ammo(weapon, cs_get_weapon_ammo(weapon)-1);
  172.         set_pev(id, pev_punchangle, Float:{ -10.0, 0.0, 0.0 });
  173.         UTIL_PlayWeaponAnimation(id, 1);
  174.         emit_sound(id, CHAN_WEAPON, shoot_sound, 1.0, ATTN_NORM, 0, PITCH_NORM);
  175.         set_pdata_float(id, 83, 1.5);
  176.         pev(id, pev_origin, f);
  177.         f[2]+=3.0;
  178.         set_pev(id, pev_origin, f);
  179.         set_task(0.1, "check_stuck", id+121);
  180.        
  181.         create_grenade(id);
  182.     }
  183.      
  184.     public create_grenade(id){
  185.         new grenade = create_entity("info_target"), Float:fOrigin[3], Float:fVelocity[3], Float:fAngles[3];
  186.        
  187.         engfunc(EngFunc_GetAttachment, id, 1, fOrigin, fAngles);
  188.        
  189.         velocity_by_aim(id, 1000, fVelocity);
  190.         fVelocity[2]+=100.0;
  191.        
  192.         pev(id, pev_v_angle, fAngles);
  193.        
  194.         set_pev(grenade, pev_classname, "fgl_grenade");
  195.         set_pev(grenade, pev_origin, fOrigin);
  196.         set_pev(grenade, pev_velocity, fVelocity);
  197.         set_pev(grenade, pev_angles, fAngles);
  198.         set_pev(grenade, pev_movetype, MOVETYPE_TOSS);
  199.         set_pev(grenade, pev_solid, SOLID_BBOX);
  200.         set_pev(grenade, pev_owner, id);
  201.        
  202.         entity_set_model(grenade, s_model);
  203.        
  204.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  205.         write_byte(TE_BEAMFOLLOW);
  206.         write_short(grenade);
  207.         write_short(sTrail);
  208.         write_byte(10);
  209.         write_byte(3);
  210.         write_byte(255);
  211.         write_byte(255);
  212.         write_byte(255);
  213.         write_byte(250);
  214.         message_end();
  215.        
  216.     }
  217.      
  218.     public fgl_touch(ent){
  219.         new Float:originF[3];
  220.         pev(ent, pev_origin, originF);
  221.        
  222.         engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, originF, 0);
  223.         write_byte(TE_WORLDDECAL);
  224.         engfunc(EngFunc_WriteCoord, originF[0]);
  225.         engfunc(EngFunc_WriteCoord, originF[1]);
  226.         engfunc(EngFunc_WriteCoord, originF[2]);
  227.         write_byte(engfunc(EngFunc_DecalIndex,"{scorch3"));
  228.         message_end();
  229.        
  230.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  231.         write_byte(TE_EXPLOSION);
  232.         engfunc(EngFunc_WriteCoord, originF[0]);
  233.         engfunc(EngFunc_WriteCoord, originF[1]);
  234.         engfunc(EngFunc_WriteCoord, originF[2]+60.0);
  235.         write_short(sTrail);
  236.         write_byte(10);
  237.         write_byte(15);
  238.         write_byte(0);
  239.         message_end();
  240.        
  241.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  242.         write_byte(TE_SPRITE);
  243.         engfunc(EngFunc_WriteCoord, originF[0]+random_float(-5.0, 5.0));
  244.         engfunc(EngFunc_WriteCoord, originF[1]+random_float(-5.0, 5.0));
  245.         engfunc(EngFunc_WriteCoord, originF[2]+200.0);
  246.         write_short(sExplo);
  247.         write_byte(15);
  248.         write_byte(200);
  249.         message_end();
  250.                
  251.         new owner = pev(ent, pev_owner);
  252.         new a = FM_NULLENT;
  253.      
  254.         while((a = find_ent_in_sphere(a,originF,300.0)) != 0) {
  255.            
  256.             if(a!=owner && a!=ent && pev(a,pev_takedamage)!=DAMAGE_NO && is_user_connected(a) && ze_is_user_zombie(a)) {
  257.                 ExecuteHamB( Ham_TakeDamage, a ,owner,owner, (damage*60/entity_range(ent,a)), DMG_BULLET);
  258.             }
  259.         }
  260.         remove_entity(ent);
  261.     }
  262.      
  263.     public check_stuck(id){
  264.         id-=121;
  265.         new Float:f[3];
  266.         if(is_player_stuck(id)){
  267.             pev(id, pev_origin, f);
  268.             f[2]-=3.0;
  269.             set_pev(id, pev_origin, f);
  270.         }
  271.     }
  272.      
  273.     public client_data_post(id, SendWeapons, CD_Handle)
  274.     {
  275.         if(is_user_alive(id) && get_user_weapon(id) == CSW_FGLAUNCHER && gHasFg[id])
  276.             set_cd(CD_Handle, CD_flNextAttack, halflife_time () + 0.00001);
  277.     }
  278.      
  279.     public fgl_PostFrame(weapon_entity) {
  280.         new id = pev(weapon_entity, pev_owner);
  281.         if (!is_user_connected(id) || !gHasFg[id])
  282.             return HAM_IGNORED;
  283.      
  284.         new Float:flNextAttack = get_pdata_float(id, 83, 4);
  285.      
  286.         new iClip = get_pdata_int(weapon_entity, 51, 4);
  287.      
  288.         new fInReload = get_pdata_int(weapon_entity, 54, 4) ;
  289.      
  290.         if( fInReload && flNextAttack <= 0.0 )
  291.         {
  292.             new j = min(clipammo - iClip, cs_get_user_bpammo(id, CSW_FGLAUNCHER));
  293.        
  294.             set_pdata_int(weapon_entity, 51, iClip + j, 4);
  295.             cs_set_user_bpammo(id, CSW_FGLAUNCHER, cs_get_user_bpammo(id, CSW_FGLAUNCHER)-j);
  296.            
  297.             set_pdata_int(weapon_entity, 54, 0, 4);
  298.             fInReload = 0;
  299.         }
  300.      
  301.         return HAM_IGNORED;
  302.     }
  303.      
  304.     public fgl_Reload(weapon_entity) {
  305.         new id = pev(weapon_entity, pev_owner);
  306.         if (!is_user_connected(id) || !gHasFg[id])
  307.             return HAM_IGNORED;
  308.      
  309.         new iBpAmmo = cs_get_user_bpammo(id, CSW_FGLAUNCHER);
  310.         new iClip = get_pdata_int(weapon_entity, 51, 4);
  311.      
  312.         if (iBpAmmo <= 0 || iClip >= 10)
  313.             return HAM_SUPERCEDE;
  314.      
  315.      
  316.         return HAM_IGNORED;
  317.     }
  318.      
  319.     public fgl_Reload_Post(weapon_entity) {
  320.         new id = pev(weapon_entity, pev_owner);
  321.        
  322.         if (!is_user_connected(id))
  323.             return HAM_IGNORED;
  324.      
  325.         if (!gHasFg[id])
  326.             return HAM_IGNORED;
  327.      
  328.         set_pdata_float(weapon_entity, 48, 6.0, 4);
  329.      
  330.         set_pdata_float(id, 83, 6.0, 5);
  331.      
  332.         set_pdata_int(weapon_entity, 54, 1, 4);
  333.      
  334.         UTIL_PlayWeaponAnimation(id, 2);
  335.      
  336.         return HAM_IGNORED;
  337.     }
  338.      
  339.     public fgl_Give(id){
  340.        
  341.         gHasFg[id] = true;
  342.         new weapon = give_item(id, fgl);
  343.         cs_set_user_bpammo(id, CSW_FGLAUNCHER, 40);
  344.         cs_set_weapon_ammo(weapon, 10);
  345.         ExecuteHamB(Ham_Item_Deploy, weapon);
  346.         Sprite(id);
  347.        
  348.     }
  349.      
  350.     stock Sprite(id, type=1)
  351.     {
  352.        
  353.         message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id);
  354.         write_string(type?"weapon_fglauncher_cso":fgl);
  355.         write_byte(10);
  356.         write_byte(40);
  357.         write_byte(-1);
  358.         write_byte(-1);
  359.         write_byte(0);
  360.         write_byte(7);
  361.         write_byte(19);
  362.         write_byte(0);
  363.         message_end();
  364.        
  365.     }
  366.      
  367.     stock is_player_stuck(id)
  368.     {
  369.         static Float:originF[3];
  370.         pev(id, pev_origin, originF);
  371.        
  372.         engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0);
  373.        
  374.         if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
  375.             return true;
  376.        
  377.         return false;
  378.     }
  379.      
  380.     stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
  381.     {
  382.         set_pev(Player, pev_weaponanim, Sequence);
  383.            
  384.         message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player);
  385.         write_byte(Sequence);
  386.         write_byte(2);
  387.         message_end();
  388.     }
Not interested in CS/Pawn anymore.
Accepting web projects.

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 507
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

#10

Post by czirimbolo » 1 Year Ago

Ok, its weapon called "Bouncer" makes this problems. All is clear
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest