Raised This Month: $51 Target: $400
 12% 

Suggestion / Subplugin Request [REQ]Adapt 2 plugins to ZA


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bruniiz09
Junior Member
Join Date: Mar 2014
Old 03-29-2014 , 12:44   [REQ]Adapt 2 plugins to ZA
Reply With Quote #1

Hi!, i want adapt 2 plugins to ZA, i try with the tutorial in the original post but i can't get the grenade when i buy the item.
The plugins are
https://forums.alliedmods.net/showthread.php?p=1123983 and https://forums.alliedmods.net/showth...12408?p=612408. The original post is this: https://forums.alliedmods.net/showthread.php?t=207308

I try with this:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>
#include <zombieapocalypse>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>

#define PLUGIN "New Plug-In"
#define VERSION 
#define AUTHOR 

new const NameItem[] = "Drug nade"
const LevelItem 7
const CostItem 15
const TeamItem ZP_TEAM_HUMAN

new gNewItem

new g_trailSprg_exploSpr;
new 
gmsg_SetFOV;

new 
Pcvar_tRed;
new 
Pcvar_tGreen;
new 
Pcvar_tBlue;

new 
Pcvar_bRed;
new 
Pcvar_bGreen;
new 
Pcvar_bBlue;

new const 
spr_grenade_ring[] = { "sprites/shockwave.spr" }
new const 
spr_grenade_trail[] = { "sprites/plasma.spr" }

public 
plugin_init() {
    
register_plugin("[ZA] New Extra-Item""1.0""ChileScripting")
    
    
// Add your code here...
    
gNewItem za_register_extra_item(NameItemLevelItemCostItemTeamItem)
            
/* R-G-B Max 255 */
    
Pcvar_tRed register_cvar("amx_trail_red""0"
    
Pcvar_tGreen register_cvar("amx_trail_green","255")
    
Pcvar_tBlue register_cvar("amx_trail_blue""255"
    
    
Pcvar_bRed register_cvar("amx_blast_red""255"
    
Pcvar_bGreen register_cvar("amx_blast_green","0"
    
Pcvar_bBlue register_cvar("amx_blast_blue""0"
    
    
gmsg_SetFOV get_user_msgid("SetFOV")
}

public 
plugin_precache()
{
    
g_exploSpr engfunc(EngFunc_PrecacheModelspr_grenade_ring)
    
g_trailSpr engfunc(EngFunc_PrecacheModelspr_grenade_trail)
}
public 
fw_ThinkGrenade(entity)
{
    static 
Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    if (
dmgtime get_gametime())
        return 
HAM_IGNORED;
    
    
fov_explode(entity)

    return 
HAM_SUPERCEDE;
}
public 
fw_SetModel(entity, const model[])
{
    if (
equal(model[7], "w_he"4))
    {
        
fm_set_rendering(entitykRenderFxGlowShell02000kRenderNormal16);
            
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMFOLLOW// TE id
        
write_short(entity// entity
        
write_short(g_trailSpr// sprite
        
write_byte(10// life
        
write_byte(10// width
        
write_byte(get_pcvar_num(Pcvar_tRed)) // r    /*
        
write_byte(get_pcvar_num(Pcvar_tGreen)) // g    sky-blue
        
write_byte(get_pcvar_num(Pcvar_tBlue)) // b    /*
        
write_byte(500// brightness
        
message_end()
            
        
set_pev(entitypev_flTimeStepSound1111)
    }
}
fov_explode(ent)
{
    static 
Float:originF[3]
    
pev(entpev_originoriginF)
        
    
create_blast(originF)
    
    static 
attacker
    attacker 
pev(entpev_owner)
        
    static 
victim
    victim 
= -1
        
    
new Tvictim get_user_team(victim)
    new 
Tattacker get_user_team(attacker)
         
    while ((
victim engfunc(EngFunc_FindEntityInSpherevictimoriginF240.0)) != 0)
    {
        if(
Tattacker == || Tattacker == 2// is attacker team ct or t
        
{
            if(
Tvictim == || Tvictim == 2// is victim team ct or t
            
{
                
message_beginMSG_ONEgmsg_SetFOV, { 00}, victim// Drugs
                
write_byte180 )
                
message_end( )
            }
        }
    }
    
engfunc(EngFunc_RemoveEntityent)
}
create_blast(const Float:originF[3])
{
    new 
get_pcvar_num(Pcvar_bRed)
    new 
get_pcvar_num(Pcvar_bGreen)
    new 
get_pcvar_num(Pcvar_bBlue)
    
    
// Smallest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+385.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(r// red
    
write_byte(g// green
    
write_byte(b// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(r// red
    
write_byte(g// green
    
write_byte(b// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Largest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+555.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(r// red
    
write_byte(g// green
    
write_byte(b// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
}



public 
zp_extra_item_selected(idITEM)
{
    if(
ITEM == gNewItem// si el item seleccionado es el item gNewItem
    
{
        static 
PlayerName[35// crear variable 35 celdas
        
get_user_name(idPlayerNamecharsmax(PlayerName)) // obtener nombre de id
        
        
entity_set_float(idEV_FL_healthentity_get_float(idEV_FL_health) + HPAMMOUNT// damos health points a id
        
entity_set_float(idEV_FL_armorvalueentity_get_float(idEV_FL_armorvalue) + ARMORAMMOUNT// armor 
        
        
client_print(0print_chat"[BZ] %s ha comprado %s"PlayerNameNameItem// print
        
client_cmd(id"spk items/smallmedkit1.wav"// play the sound (default sound half life)
    
}

but i don't know to give me the item (this is to Drug Nade).
I try with:
PHP Code:
  if(ITEM == gNewItem// si el item seleccionado es el item gNewItem
    
{
        static 
PlayerName[35// crear variable 35 celdas
        
get_user_name(idPlayerNamecharsmax(PlayerName)) // obtener nombre de id
        
        
giveitem("")
        
        
client_print(0print_chat"[BZ] %s ha comprado %s"PlayerNameNameItem// print
        
client_cmd(id"spk items/smallmedkit1.wav"// play the sound (default sound half life)
    

but i don't know what write in the middle of the "".
Sorry for my english, i speak spanish.
Thanks in advance.
bruniiz09 is offline
Old 03-30-2014, 20:02
XDragoon
This message has been deleted by XDragoon. Reason: blabla
bruniiz09
Junior Member
Join Date: Mar 2014
Old 03-30-2014 , 20:52   Re: [REQ]Adapt 2 plugins to ZA
Reply With Quote #2

Quote:
Originally Posted by XDragoon View Post
Not Tested
PD: Your Code Sucks
Thanks for the code, but when i press Drug Nade in the menu of grenades it gives me a he grenade :S

PD: Yes, i know

Last edited by bruniiz09; 03-30-2014 at 20:57.
bruniiz09 is offline
Old 03-31-2014, 17:01
XDragoon
This message has been deleted by XDragoon. Reason: blabla
bruniiz09
Junior Member
Join Date: Mar 2014
Old 03-31-2014 , 17:18   Re: [REQ]Adapt 2 plugins to ZA
Reply With Quote #3

Quote:
Originally Posted by XDragoon View Post
Try Now :z
PD: NOT TESTED Case i Dont Like The ZA
PD2: This Use Default Flashbang Nade Model v and p model
Dont' work :/
bruniiz09 is offline
XDragoon
New Member
Join Date: Dec 2012
Location: Chile
Old 03-31-2014 , 17:54   Re: [REQ]Adapt 2 plugins to ZA
Reply With Quote #4

:l
Is More Easy Making the extra Item Inside the Main Plugin but For some reasons, I cant help you anymore
XDragoon is offline
bruniiz09
Junior Member
Join Date: Mar 2014
Old 03-31-2014 , 18:45   Re: [REQ]Adapt 2 plugins to ZA
Reply With Quote #5

Quote:
Originally Posted by XDragoon View Post
:l
Is More Easy Making the extra Item Inside the Main Plugin but For some reasons, I cant help you anymore
You can help me? :_
bruniiz09 is offline
Old 04-15-2014, 14:29
XDragoon
This message has been deleted by XDragoon. Reason: blabla
Depresie
Veteran Member
Join Date: Nov 2013
Old 05-03-2014 , 14:32   Re: [REQ]Adapt 2 plugins to ZA
Reply With Quote #6

try this, it's like the drug grenade
https://forums.alliedmods.net/showthread.php?t=113328

and for the flares, you can set them to have random colors from the zombie plague cfg
Depresie is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode