[ New Updates · Members · Rules · Search · RSS ]
Page 1 of 11
Forum » DevCen (Developer Center) » AMX Mod X » [Ask] Bagaimana script menambah mode tambahan pada weapon?
[Ask] Bagaimana script menambah mode tambahan pada weapon?
kenc0d3rDate: Saturday, 01 Nov 2014, 11:51 PM | Message # 1
New Member
Group: Member
Messages: 10
Awards: 0
Reputation: 0
Status: Offline
Permisi para mas[TER], ane pemula nih upset   Ane mau nanya seputar script.

Jadi ceritanya gini gan, ane punya plugin show HUD tga, asli buatannya Mr. Bone [CS china community]. Saat ini saya sudah berhasil memperbaiki bugnya yang tidak memunculkan jumlah armor ketika menambah armor dengan cara klik [<], sekarang plugin tersebut sudah dapat berjalan cukup normal sampai akhirnya saya mendapati plugin tersebut crash dan membuat CS editan saya kembali kemenu awal karena pada weapon saya terdapat mode tambahan yaitu sight/zoom mode. Pertanyaan-nya, bagaimana script-nya membuat plugin show HUD tga ini bisa berjalan normal dengan adanya mode tambahan itu?
 
DavidJrDate: Sunday, 02 Nov 2014, 11:21 AM | Message # 2
CEO
Group: Executive Team
Messages: 471
Awards: 0
Reputation: 224
Status: Offline
Coba post scriptnya disini, pakai tag [*code][*/code] tanpa bintang

Auto Aim Bot Detector: http://youtu.be/NiKY0rG7cNg
 
kenc0d3rDate: Sunday, 02 Nov 2014, 2:41 PM | Message # 3
New Member
Group: Member
Messages: 10
Awards: 0
Reputation: 0
Status: Offline
Ini bang.. Oh iya, setelah pasang nih plugin layar ane malah kedip-kedip.  upset Tolong bantu koreksi juga itu bang. Itu udah ane edit dikit [dikitnya pake banget] dari source asliya, mungkin masih sangat berantakan bagi siapa aja yang liat [malu2 ane].. Tapi paling tidak saya sudah mengupayakan agar paradigma para mas  [TER]tentang pendatang baru di forum hanya bisa minta.  angle  

Code
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <acg>

#define TGA_Weapon 4
#define TGA_Player 5
#define TGA_Ammo 6
#define TGA_NewView 7
#define TEXT_HP_AC 1
#define TEXT_Ammo 2

new g_second=59,g_minute,Float:g_time,g_endround

new const msa_wpn[][]={"ak47","aug","awp","c4","deagle","elite","famas","fiveseven","flashbang","g3sg1","galil","glock18","hegrenade","knife","m3","m4a1","m249", "mac10","mp5","p90","p228","scout","sg550","sg552","smokegrenade","tmp","ump45","usp","xm1014"}
new const msa_player[][]={"arctic","gign","gsg9","guerilla","leet","sas","terror","urban","vip"}
new const msa_ui[][]={"ammo","NewView"}

public plugin_precache()
{
    for(new i;i<sizeof msa_wpn;i++)
    {
       new msb_wpn[64]
       format(msb_wpn,63,"gfx/UI/WPN/%s.tga",msa_wpn[i])
       precache_generic(msb_wpn)
    }
    for(new i;i<sizeof msa_player;i++)
    {
    new msb_player[64]
    format(msb_player,63,"gfx/UI/player/%s.tga",msa_player[i])
    precache_generic(msb_player)
    }
    for(new i;i<sizeof msa_ui;i++)
    {
       new msb_ui[64]
       format(msb_ui,63,"gfx/UI/%s.tga",msa_ui[i])
       precache_generic(msb_ui)
    }
}

public plugin_init()
{
    register_event("HLTV","Event_HLTV","a","1=0","2=0")
    register_logevent("logevent_round_end",2,"1=Round_End")
    g_minute=floatround(get_cvar_float("mp_roundtime"),floatround_tozero)-1
    register_forward(FM_PlayerPreThink,"Fm_PlayerPreThink")
    register_forward(FM_PlayerPostThink,"Fm_PlayerPostThink_Post",1)
    register_message(get_user_msgid("CurWeapon"),"Message_CurWeapon_AmmoX")
    register_message(get_user_msgid("AmmoX"),"Message_CurWeapon_AmmoX")
    register_message(get_user_msgid("Health"),"Message_Health_Battery")
    register_message(get_user_msgid("Battery"),"Message_Health_Battery")
    RegisterHam(Ham_Spawn,"player","HAM_Spawn_Post",1)
    RegisterHam(Ham_Killed,"player","HAM_Killed")
}

public Event_HLTV(id)
{
    g_minute=floatround(get_cvar_float("mp_roundtime"),floatround_tozero)-1
    g_second=59
    g_time=get_gametime()
    g_endround=false
}

public logevent_round_end()
{
    g_endround=true
}

public Fm_PlayerPreThink(id)
{
    if(get_gametime()-0.999999>=g_time)
    {
       if(g_endround)
       {
          g_minute=0
          g_second=0
       }
       if(!g_endround)
       {
          g_second--
       }
       if(!g_endround&&g_second<0)
       {
          g_second=59
          g_minute--
       }
       g_time=get_gametime()
    }
    static buffer[64]
    if(g_second<10)
    {
       formatex(buffer,charsmax(buffer),"%d:0%d",g_minute,g_second)
    }
    if(g_second>=10)
    {
       formatex(buffer,charsmax(buffer),"%d:%d",g_minute,g_second)
    }
    if(is_user_alive(id))
    {
       set_hudmessage(255,255,255,-1.0,0.94,0,0.0,0.1,0.0,0.0,4)
       show_hudmessage(id,"%s^n%d",buffer,get_pdata_int(id,115))
    }
}

public Fm_PlayerPostThink_Post(iPlayer)
    {
       if(is_user_alive(iPlayer))
       {
          new viewmodel[64]
          pev(iPlayer,pev_viewmodel2,viewmodel,charsmax(viewmodel))
          replace(viewmodel,63,".mdl",".tga")
          replace(viewmodel,63,"models/v_","gfx/UI/WPN/")
          acg_drawtga(iPlayer,viewmodel,255,255,255,255,0.75,0.85,0,FX_FADE,0.0,0.4,0.0,-1.0,0,0,TGA_Weapon)
       }
    }

public Message_CurWeapon_AmmoX(msg_id,msg_dest,msg_entity)
{
    if(GetClip(msg_entity)<0)
    {
       acg_removedrawnimage(msg_entity,2,TGA_Ammo)
       acg_removedrawnimage(msg_entity,3,TEXT_Ammo)
       return
    }
    if(is_user_alive(msg_entity))
    {
       new QB_HB[32]
       formatex(QB_HB,31,"%d/%d",GetClip(msg_entity),GetBpAmmo(msg_entity))
       acg_initfont(msg_entity,"",14,1,0,0,TEXT_Ammo)
       acg_drawtext(msg_entity,0.87,0.967,QB_HB,255,255,255,255,0.0,0.0,-1.0,1,TS_BORDER,0,0,TEXT_Ammo)
       acg_drawtga(msg_entity,"gfx/UI/ammo.tga",255,255,255,255,0.75,0.92,0,FX_FADE,0.0,0.0,0.0,-1.0,0,0,TGA_Ammo)
    }
}

public Message_Health_Battery(msg_id,msg_dest,msg_entity)
{
    if(is_user_alive(msg_entity))
    {
       new HP_AC[32]
       formatex(HP_AC,31,"%d^n%d",pev(msg_entity,pev_armorvalue),pev(msg_entity,pev_health))
       acg_initfont(msg_entity,"",14,1,0,0,TEXT_HP_AC)
       acg_drawtext(msg_entity,0.15,0.962,HP_AC,255,255,255,255,0.0,0.0,-1.0,1,TS_BORDER,0,0,TEXT_HP_AC)
    }
}

public HAM_Spawn_Post(id)
{
    if(is_user_alive(id))
    {
       new model[64]
       fm_cs_get_user_model(id,model,charsmax(model))
       new name[64]
       format(name,63,"gfx/UI/player/%s.tga",model)
       acg_drawtga(id,name,255,255,255,255,0.0,0.85,0,FX_FADE,0.0,0.4,0.0,-1.0,0,0,TGA_Player)
       acg_drawtga(id,"gfx/UI/NewView.tga",255,255,255,255,0.1,0.1,0,FX_FADE_INTERVAL,0.0,0.0,0.0,-1.0,1,1,TGA_NewView)
    }
}

public HAM_Killed(victim,attacker,shouldgib)
{
    acg_removedrawnimage(victim,2,TGA_Weapon)
    acg_removedrawnimage(victim,2,TGA_Player)
    acg_removedrawnimage(victim,2,TGA_Ammo)
    acg_removedrawnimage(victim,2,TGA_NewView)
    acg_removedrawnimage(victim,3,TEXT_HP_AC)
    acg_removedrawnimage(victim,3,TEXT_Ammo)
}

stock fm_cs_get_user_model(player,model[],len)
{
    get_user_info(player,"model",model,len)
}

stock GetClip(iPlayer)
{
    new iEntity=get_pdata_cbase(iPlayer,373)
    if(iEntity<=0)
    return-1
    return get_pdata_int(iEntity,51,4)
}

stock GetBpAmmo(iPlayer)
{
    new iEntity=get_pdata_cbase(iPlayer,373)
    if(iEntity<=0)
    return-1
    return get_pdata_int(iPlayer,376+get_pdata_int(iEntity,49,4),4)
}
 
DavidJrDate: Sunday, 02 Nov 2014, 3:01 PM | Message # 4
CEO
Group: Executive Team
Messages: 471
Awards: 0
Reputation: 224
Status: Offline
Coba ini drubah jadi:

Code
register_forward(FM_PlayerPostThink,"Fm_PlayerPostThink_Post",1)


->

Code
register_event("CurWeapon","Event_CurWeapon", "b")


Dan

Code
public Fm_PlayerPostThink_Post(iPlayer)  
     {  
        if(is_user_alive(iPlayer))  
        {  
           new viewmodel[64]  
           pev(iPlayer,pev_viewmodel2,viewmodel,charsmax(viewmodel))  
           replace(viewmodel,63,".mdl",".tga")  
           replace(viewmodel,63,"models/v_","gfx/UI/WPN/")  
           acg_drawtga(iPlayer,viewmodel,255,255,255,255,0.75,0.85,0,FX_FADE,0.0,0.4,0.0,-1.0,0,0,TGA_Weapon)  
        }  
     }


->

Code
public Event_CurWeapon(iIndex)  
     {  
        if (!is_user_alive(iIndex))  return;
           new viewmodel[64]  
           pev(iIndex,pev_viewmodel2,viewmodel,charsmax(viewmodel))  
           replace(viewmodel,63,".mdl",".tga")  
           replace(viewmodel,63,"models/v_","gfx/UI/WPN/")  
           acg_drawtga(iIndex,viewmodel,255,255,255,255,0.75,0.85,0,FX_FADE,0.0,0.4,0.0,-1.0,0,0,TGA_Weapon)  
     }


Auto Aim Bot Detector: http://youtu.be/NiKY0rG7cNg
 
kenc0d3rDate: Sunday, 02 Nov 2014, 4:08 PM | Message # 5
New Member
Group: Member
Messages: 10
Awards: 0
Reputation: 0
Status: Offline
Saya test dulu mas  [TER]:kiki:

Added (02 Nov 2014, 4:08 PM)
---------------------------------------------
Tinggal yang kedip-kedipnya tuh bang, ane tidak ngerti.. upset

Message edited by kenc0d3r - Sunday, 02 Nov 2014, 3:20 PM
 
DavidJrDate: Monday, 03 Nov 2014, 9:24 AM | Message # 6
CEO
Group: Executive Team
Messages: 471
Awards: 0
Reputation: 224
Status: Offline
kenc0d3r, yang mana yang kedap kedip?

Auto Aim Bot Detector: http://youtu.be/NiKY0rG7cNg
 
kenc0d3rDate: Monday, 03 Nov 2014, 12:08 PM | Message # 7
New Member
Group: Member
Messages: 10
Awards: 0
Reputation: 0
Status: Offline
Nah itu dia bang, saya malah bingung dibagian mana yang buat script itu kalo udah dicompile dan dipasang ke CS 1.6 malah kedap kedip monitornya [hanya dibagian pinggirnya monitor]. Lucunya kalo tidak dipasangin tuh plugin, CS 16 tetap stabil. Saya masih dalam tahap penyesuaian dalam hal ini bang, tolong dibimbing..  angle
 
DavidJrDate: Thursday, 06 Nov 2014, 4:13 PM | Message # 8
CEO
Group: Executive Team
Messages: 471
Awards: 0
Reputation: 224
Status: Offline
kenc0d3r, ada screenshoot pas kedap kedip?

Auto Aim Bot Detector: http://youtu.be/NiKY0rG7cNg
 
kenc0d3rDate: Saturday, 08 Nov 2014, 9:48 AM | Message # 9
New Member
Group: Member
Messages: 10
Awards: 0
Reputation: 0
Status: Offline


Kedap-kedip yang saya maksud itu bang, ada pada setiap sudut yang saya tandai seperti border itu.
 
DavidJrDate: Saturday, 08 Nov 2014, 3:13 PM | Message # 10
CEO
Group: Executive Team
Messages: 471
Awards: 0
Reputation: 224
Status: Offline
Quote kenc0d3r ()
Kedap-kedip yang saya maksud itu bang, ada pada setiap sudut yang saya tandai seperti border itu.
waduh ane gak bisa deteksi, coba record video saja :)


Auto Aim Bot Detector: http://youtu.be/NiKY0rG7cNg
 
Forum » DevCen (Developer Center) » AMX Mod X » [Ask] Bagaimana script menambah mode tambahan pada weapon?
Page 1 of 11
Search:

Create a free website with uCoz