Kullanıcı Tag Listesi

9 sonuçtan 1 ile 9 arası
  1. #1
    cavus er HijyeniK - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    May 2012
    Yer
    Denizli
    Mesajlar
    217
    Bahsedildi
    0 Mesaj
    Etiketlenmiş
    0 Konu
    Tecrübe Puanı
    9

    Exclamation Adminlere özel hook her el bir kere

    Öncelikle merhaba arkadaşlar.
    İstediğim plugin bildiğimiz hook plugini olacak.
    Hook dan ses çıkmasını istemiyorum.
    Sadece adminlerde olmasını istiyorum.
    Her el yanlızca 1 kere atılabilmesini istiyorum.
    Şimdiden teşekkürler iyi forumlar.

    La'brigade # Gaming Bir Gün Değil Her Gün Kral !
    Cs 1.6 Server : CS.LabrigadeGaming.Com
    TeamSpeak3 Server : Ts3.LabrigadeGaming.Com
    Msn :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Facebook :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Skype : HijyeniK


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


  2. #2
    Nemesis* coadmin akcaliberkk - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    Jun 2012
    Yer
    İstanbul
    Mesajlar
    2.027
    Bahsedildi
    105 Mesaj
    Etiketlenmiş
    10 Konu
    Tecrübe Puanı
    10

    Standart Cevap: Adminlere özel hook her el bir kere

    PHP- Kodu:
    #define ADMINLEVEL ADMIN_BAN

    #include <amxmodx>
    #include <amxmisc>
    #include <fakemeta>
    #include <cstrike>
    #include <xs>

    #define message_begin_f(%1,%2,%3,%4) engfunc(EngFunc_MessageBegin, %1, %2, %3, %4)
    #define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1)

    //Cvars
    new pHookpThrowSpeedpSpeedpWidthpSoundpColor
    new pInterruptpAdminpHookSkypOpenDoorspPlayers
    new pUseButtonspHostagepWeaponspInstantpHookNoise
    new pMaxHookspRndStartDelaypCtOnly;
    // Sprite
    new sprBeam

    // Players hook entity
    new Hook[33]

    // MaxPlayers
    new gMaxPlayers

    // some booleans
    new bool:gHooked[33]
    new 
    bool:canThrowHook[33]
    new 
    bool:rndStarted

    // Player Spawn
    new bool:gRestart[33] = {false, ...}
    new 
    bool:gUpdate[33] = {false, ...}

    new 
    gHooksUsed[33// Used with sv_hookmax
    new bool:g_bHookAllowed[33// Used with sv_hookadminonly

    public plugin_init()
    {
        
    register_plugin("Hook""1.5""P34nut")
        
        
    // Hook commands
        
    register_clcmd("+hook""make_hook")
        
    register_clcmd("-hook""del_hook")
        
        
    register_concmd("amx_givehook""give_hook"ADMIN_RCON"<Username> - Give somebody access to the hook")
        
    register_concmd("amx_takehook""take_hook"ADMIN_RCON"<UserName> - Take away somebody his access to the hook")
        
        
    // Events for roundstart
        
    register_event("HLTV""round_bstart""a""1=0""2=0")
        
    register_logevent("round_estart"2"1=Round_Start"
        
        
    // Player spawn stuff
        
    register_event("TextMsg""Restart""a""2=#Game_will_restart_in")
        
    register_clcmd("fullupdate""Update"
        
    register_event("ResetHUD""ResetHUD""b")
        
        
    // Register cvars
        
    register_cvar("sv_amxxhookmod",  "version 1.5"FCVAR_SERVER// yay public cvar
        
    pHook =     register_cvar("sv_hook""1")
        
    pThrowSpeed =     register_cvar("sv_hookthrowspeed""4000")
        
    pSpeed =     register_cvar("sv_hookspeed""600")
        
    pWidth =     register_cvar("sv_hookwidth""16")
        
    pSound =     register_cvar("sv_hooksound""0")
        
    pColor =    register_cvar("sv_hookcolor""0")
        
    pPlayers =     register_cvar("sv_hookplayers""0")
        
    pInterrupt =     register_cvar("sv_hookinterrupt""0")
        
    pAdmin =     register_cvar("sv_hookadminonly",  "1")
        
    pHookSky =     register_cvar("sv_hooksky""1")
        
    pOpenDoors =     register_cvar("sv_hookopendoors""1")
        
    pUseButtons =     register_cvar("sv_hookusebuttons""1")
        
    pHostage =     register_cvar("sv_hookhostflollow""1")
        
    pWeapons =    register_cvar("sv_hookpickweapons""1")
        
    pInstant =    register_cvar("sv_hookinstant""1")
        
    pHookNoise =     register_cvar("sv_hooknoise""0")
        
    pMaxHooks =     register_cvar("sv_hookmax""1")
        
    pRndStartDelay register_cvar("sv_hookrndstartdelay""0.0")
        
    pCtOnly register_cvar("sv_hookctonly""1")
        
        
        
    // Touch forward
        
    register_forward(FM_Touch"fwTouch")
        
        
    // Get maxplayers
        
    gMaxPlayers get_maxplayers()
    }

    public 
    plugin_precache()
    {
        
    // Hook Model
        
    engfunc(EngFunc_PrecacheModel"models/rpgrocket.mdl")
        
        
    // Hook Beam
        
    sprBeam engfunc(EngFunc_PrecacheModel"sprites/zbeam4.spr")
        
        
    // Hook Sounds
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hit1.wav"// good hit
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hit2.wav"// wrong hit
        
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hitbod1.wav"// player hit
        
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_fire1.wav"// deploy
    }


    public 
    make_hook(id)
    {
        
        if (
    get_pcvar_num(pHook) && is_user_alive(id) && canThrowHook[id] && !gHooked[id]) {        
            if (
    get_pcvar_num(pAdmin))
            {
                
    // Only the admins can throw the hook
                // if(is_user_admin(id)) { <- does not work...        
                
    if (!(get_user_flags(id) & ADMINLEVEL) && !g_bHookAllowed[id])
                {
                    
    // Show a message
                    
    client_print(idprint_chat"[Hook] Bunu Kullanmak Icin Yetkiniz Yok")
                    
                    return 
    PLUGIN_HANDLED
                
    }
            }
            if(
    get_pcvar_num(pCtOnly)) {
                if(
    get_user_team(id) != 2) {
                    
    client_print(id,print_chat,"[Hook] Sadece CT Takimi Hook Kullanabilir")
                    return 
    PLUGIN_HANDLED
                
    }
            }
            new 
    iMaxHooks get_pcvar_num(pMaxHooks)
            if (
    iMaxHooks 0)
            {
                if (
    gHooksUsed[id] >= iMaxHooks)
                {
                    
    client_print(idprint_chat"[Hook] Hook Limitin Doldu Artik Hook Kullanamazsin !")
                    
    statusMsg(id"[Hook] %d of %d hooks used."gHooksUsed[id], get_pcvar_num(pMaxHooks))
                    
                    return 
    PLUGIN_HANDLED
                
    }
                else 
                {
                    
    gHooksUsed[id]++
                    
    statusMsg(id"[Hook] %d of %d hooks used."gHooksUsed[id], get_pcvar_num(pMaxHooks))
                }
            }
            new 
    Float:fDelay get_pcvar_float(pRndStartDelay)
            if (
    fDelay && !rndStarted)
                
    client_print(idprint_chat"[Hook] Ilk %0.0f Saniye Boyunca Hook Kullanamazsin !"fDelay)
            
            
    throw_hook(id)
        }
        return 
    PLUGIN_HANDLED
    }

    public 
    del_hook(id)
    {
        
    // Remove players hook
        
    if (!canThrowHook[id])
            
    remove_hook(id)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    round_bstart()
    {
        
    // Round is not started anymore
        
    if (rndStarted)
            
    rndStarted false
        
        
    // Remove all hooks
        
    for (new 1<= gMaxPlayersi++)
        {
            if (
    is_user_connected(i))
            {
                if(!
    canThrowHook[i])
                    
    remove_hook(i)
            }
        }
    }

    public 
    round_estart()
    {
        new 
    Float:fDelay get_pcvar_float(pRndStartDelay)
        if (
    fDelay 0.0)
            
    set_task(fDelay"rndStartDelay")
        else
        {
            
    // Round is started...
            
    if (!rndStarted)
                
    rndStarted true
        
    }
    }

    public 
    rndStartDelay()
    {
        if (!
    rndStarted)
            
    rndStarted true
    }

    public 
    Restart()
    {
        for (new 
    id 0id gMaxPlayersid++)
        {
            if (
    is_user_connected(id))
                
    gRestart[id] = true
        
    }
    }

    public 
    Update(id)
    {
        if (!
    gUpdate[id])
            
    gUpdate[id] = true
        
        
    return PLUGIN_CONTINUE
    }

    public 
    ResetHUD(id)
    {
        if (
    gRestart[id])
        {
            
    gRestart[id] = false
            
    return
        }
        if (
    gUpdate[id])
        {
            
    gUpdate[id] = false
            
    return
        }
        if (
    gHooked[id])
        {
            
    remove_hook(id)
        }
        if (
    get_pcvar_num(pMaxHooks) > 0)
        {
            
    gHooksUsed[id] = 0
            statusMsg
    (0"[Hook] 0 of %d hooks used."get_pcvar_num(pMaxHooks))
        }
    }

    public 
    fwTouch(ptrptd)
    {
        if (!
    pev_valid(ptr))
            return 
    FMRES_IGNORED
        
        
    new id pev(ptrpev_owner)
        
        
    // Get classname
        
    static szPtrClass[32]    
        
    pev(ptrpev_classnameszPtrClasscharsmax(szPtrClass))
        
        if (
    equali(szPtrClass"Hook"))
        {        
            static 
    Float:fOrigin[3]
            
    pev(ptrpev_originfOrigin)
            
            if (
    pev_valid(ptd))
            {
                static 
    szPtdClass[32]
                
    pev(ptdpev_classnameszPtdClasscharsmax(szPtdClass))
                
                if (!
    get_pcvar_num(pPlayers) && /*equali(szPtdClass, "player")*/ is_user_alive(ptd))
                {
                    
    // Hit a player
                    
    if (get_pcvar_num(pSound))
                        
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hitbod1.wav"1.0ATTN_NORM0PITCH_NORM)
                    
    remove_hook(id)
                    
                    return 
    FMRES_HANDLED
                
    }
                else if (
    equali(szPtdClass"hostage_entity"))
                {
                    
    // Makes an hostage follow
                    
    if (get_pcvar_num(pHostage) && get_user_team(id) == 2)
                    {                    
                        
    //cs_set_hostage_foll(ptd, (cs_get_hostage_foll(ptd) == id) ? 0 : id)
                        // With the use function we have the sounds!
                        
    dllfunc(DLLFunc_Useptdid)
                    }
                    if (!
    get_pcvar_num(pPlayers))
                    {
                        if(
    get_pcvar_num(pSound))
                            
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hitbod1.wav"1.0ATTN_NORM0PITCH_NORM)
                        
    remove_hook(id)
                    }
                    return 
    FMRES_HANDLED
                
    }
                else if (
    get_pcvar_num(pOpenDoors) && equali(szPtdClass"func_door") || equali(szPtdClass"func_door_rotating"))
                {
                    
    // Open doors
                    // Double doors tested in de_nuke and de_wallmart
                    
    static szTargetName[32]
                    
    pev(ptdpev_targetnameszTargetNamecharsmax(szTargetName))
                    if (
    strlen(szTargetName) > 0)
                    {    
                        static 
    ent
                        
    while ((ent engfunc(EngFunc_FindEntityByStringent"target"szTargetName)) > 0)
                        {
                            static 
    szEntClass[32]
                            
    pev(entpev_classnameszEntClasscharsmax(szEntClass))
                            
                            if (
    equali(szEntClass"trigger_multiple"))
                            {
                                
    dllfunc(DLLFunc_Touchentid)
                                goto 
    stopdoors // No need to touch anymore
                            
    }
                        }
                    }
                    
                    
    // No double doors.. just touch it
                    
    dllfunc(DLLFunc_Touchptdid)
                    
    stopdoors:                
                }
                else if (
    get_pcvar_num(pUseButtons) && equali(szPtdClass"func_button"))
                {
                    if (
    pev(ptdpev_spawnflags) & SF_BUTTON_TOUCH_ONLY)
                        
    dllfunc(DLLFunc_Touchptdid// Touch only
                    
    else            
                        
    dllfunc(DLLFunc_Useptdid// Use Buttons            
                
    }
            }
            
            
    // If cvar sv_hooksky is 0 and hook is in the sky remove it!
            
    new iContents engfunc(EngFunc_PointContentsfOrigin)
            if (!
    get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
            {
                if(
    get_pcvar_num(pSound))
                    
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM)
                
    remove_hook(id)
                return 
    FMRES_HANDLED
            
    }
            
            
    // Pick up weapons..
            
    if (get_pcvar_num(pWeapons))
            {
                static 
    ent
                
    while ((ent engfunc(EngFunc_FindEntityInSphereentfOrigin15.0)) > 0)
                {
                    static 
    szentClass[32]
                    
    pev(entpev_classnameszentClasscharsmax(szentClass))
                    
                    if (
    equali(szentClass"weaponbox") || equali(szentClass"armoury_entity"))
                        
    dllfunc(DLLFunc_Touchentid)
                }
            }
            
            
    // Player is now hooked
            
    gHooked[id] = true
            
    // Play sound
            
    if (get_pcvar_num(pSound))
                
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hit1.wav"1.0ATTN_NORM0PITCH_NORM)
            
            
    // Make some sparks :D
            
    message_begin_f(MSG_BROADCASTSVC_TEMPENTITYfOrigin0)
            
    write_byte(9// TE_SPARKS
            
    write_coord_f(fOrigin[0]) // Origin
            
    write_coord_f(fOrigin[1])
            
    write_coord_f(fOrigin[2])
            
    message_end()        
            
            
    // Stop the hook from moving
            
    set_pev(ptrpev_velocityFloat:{0.00.00.0})
            
    set_pev(ptrpev_movetypeMOVETYPE_NONE)
            
            
    //Task
            
    if (!task_exists(id 856))
            { 
                static 
    TaskData[2]
                
    TaskData[0] = id
                TaskData
    [1] = ptr
                gotohook
    (TaskData)
                
                
    set_task(0.1"gotohook"id 856TaskData2"b")
            }
        }
        return 
    FMRES_HANDLED
    }

    public 
    hookthink(param[])
    {
        new 
    id param[0]
        new 
    HookEnt param[1]
        
        if (!
    is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id))
        {
            
    remove_task(id 890)
            return 
    PLUGIN_HANDLED
        
    }
        
        
        static 
    Float:entOrigin[3]
        
    pev(HookEntpev_originentOrigin)
        
        
    // If user is behind a box or something.. remove it
        // only works if sv_interrupt 1 or higher is
        
    if (get_pcvar_num(pInterrupt) && rndStarted)
        {
            static 
    Float:usrOrigin[3]
            
    pev(idpev_originusrOrigin)
            
            static 
    tr
            engfunc
    (EngFunc_TraceLineusrOriginentOrigin1, -1tr)
            
            static 
    Float:fFraction
            get_tr2
    (trTR_flFractionfFraction)
            
            if (
    fFraction != 1.0)
                
    remove_hook(id)
        }
        
        
    // If cvar sv_hooksky is 0 and hook is in the sky remove it!
        
    new iContents engfunc(EngFunc_PointContentsentOrigin)
        if (!
    get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
        {
            if(
    get_pcvar_num(pSound))
                
    emit_sound(HookEntCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM)
            
    remove_hook(id)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    gotohook(param[])
    {
        new 
    id param[0]
        new 
    HookEnt param[1]
        
        if (!
    is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id))
        {
            
    remove_task(id 856)
            return 
    PLUGIN_HANDLED
        
    }
        
    // If the round isnt started velocity is just 0
        
    static Float:fVelocity[3]
        
    fVelocity Float:{0.00.01.0}
        
        
    // If the round is started and player is hooked we can set the user velocity!
        
    if (rndStarted && gHooked[id])
        {
            static 
    Float:fHookOrigin[3], Float:fUsrOrigin[3], Float:fDist
            pev
    (HookEntpev_originfHookOrigin)
            
    pev(idpev_originfUsrOrigin)
            
            
    fDist vector_distance(fHookOriginfUsrOrigin)
            
            if (
    fDist >= 30.0)
            {
                new 
    Float:fSpeed get_pcvar_float(pSpeed)
                
                
    fSpeed *= 0.52
                
                fVelocity
    [0] = (fHookOrigin[0] - fUsrOrigin[0]) * (2.0 fSpeed) / fDist
                fVelocity
    [1] = (fHookOrigin[1] - fUsrOrigin[1]) * (2.0 fSpeed) / fDist
                fVelocity
    [2] = (fHookOrigin[2] - fUsrOrigin[2]) * (2.0 fSpeed) / fDist
            
    }
        }
        
    // Set the velocity
        
    set_pev(idpev_velocityfVelocity)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    throw_hook(id)
    {
        
    // Get origin and angle for the hook
        
    static Float:fOrigin[3], Float:fAngle[3],Float:fvAngle[3]
        static 
    Float:fStart[3]
        
    pev(idpev_originfOrigin)
        
        
    pev(idpev_anglesfAngle)
        
    pev(idpev_v_anglefvAngle)
        
        if (
    get_pcvar_num(pInstant))
        {
            
    get_user_hitpoint(idfStart)
            
            if (
    engfunc(EngFunc_PointContentsfStart) != CONTENTS_SKY)
            {
                static 
    Float:fSize[3]
                
    pev(idpev_sizefSize)
                
                
    fOrigin[0] = fStart[0] + floatcos(fvAngle[1], degrees) * (-10.0 fSize[0])
                
    fOrigin[1] = fStart[1] + floatsin(fvAngle[1], degrees) * (-10.0 fSize[1])
                
    fOrigin[2] = fStart[2]
            }
            else
                
    xs_vec_copy(fStartfOrigin)
        }
        
        
        
    // Make the hook!
        
    Hook[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
        
        if (
    Hook[id])
        {
            
    // Player cant throw hook now
            
    canThrowHook[id] = false
            
            
    static const Float:fMins[3] = {-2.840000, -14.180000, -2.840000}
            static const 
    Float:fMaxs[3] = {2.8400000.0200002.840000}
            
            
    //Set some Data
            
    set_pev(Hook[id], pev_classname"Hook")
            
            
    engfunc(EngFunc_SetModelHook[id], "models/rpgrocket.mdl")
            
    engfunc(EngFunc_SetOriginHook[id], fOrigin)
            
    engfunc(EngFunc_SetSizeHook[id], fMinsfMaxs)        
            
            
    //set_pev(Hook[id], pev_mins, fMins)
            //set_pev(Hook[id], pev_maxs, fMaxs)
            
            
    set_pev(Hook[id], pev_anglesfAngle)
            
            
    set_pev(Hook[id], pev_solid2)
            
    set_pev(Hook[id], pev_movetype5)
            
    set_pev(Hook[id], pev_ownerid)
            
            
    //Set hook velocity
            
    static Float:fForward[3], Float:Velocity[3]
            new 
    Float:fSpeed get_pcvar_float(pThrowSpeed)
            
            
    engfunc(EngFunc_MakeVectorsfvAngle)
            
    global_get(glb_v_forwardfForward)
            
            
    Velocity[0] = fForward[0] * fSpeed
            Velocity
    [1] = fForward[1] * fSpeed
            Velocity
    [2] = fForward[2] * fSpeed
            
            set_pev
    (Hook[id], pev_velocityVelocity)
            
            
    // Make the line between Hook and Player
            
    message_begin_f(MSG_BROADCASTSVC_TEMPENTITYFloat:{0.00.00.0}, 0)
            if (
    get_pcvar_num(pInstant))
            {
                
    write_byte(1// TE_BEAMPOINT
                
    write_short(id// Startent
                
    write_coord_f(fStart[0]) // End pos
                
    write_coord_f(fStart[1])
                
    write_coord_f(fStart[2])
            }
            else
            {
                
    write_byte(8// TE_BEAMENTS
                
    write_short(id// Start Ent
                
    write_short(Hook[id]) // End Ent
            
    }
            
    write_short(sprBeam// Sprite
            
    write_byte(1// StartFrame
            
    write_byte(1// FrameRate
            
    write_byte(600// Life
            
    write_byte(get_pcvar_num(pWidth)) // Width
            
    write_byte(get_pcvar_num(pHookNoise)) // Noise
            // Colors now
            
    if (get_pcvar_num(pColor))
            {
                if (
    get_user_team(id) == 1// Terrorist
                
    {
                    
    write_byte(255// R
                    
    write_byte(0)    // G
                    
    write_byte(0)    // B
                
    }
                
    #if defined _cstrike_included
                
    else if(cs_get_user_vip(id)) // vip for cstrike
                
    {
                    
    write_byte(0)    // R
                    
    write_byte(255)    // G
                    
    write_byte(0)    // B
                
    }
                
    #endif // _cstrike_included
                
    else if(get_user_team(id) == 2// CT
                
    {
                    
    write_byte(0)    // R
                    
    write_byte(0)    // G
                    
    write_byte(255)    // B
                
    }
                else
                {
                    
    write_byte(255// R
                    
    write_byte(255// G
                    
    write_byte(255// B
                
    }
            }
            else
            {
                
    write_byte(255// R
                
    write_byte(255// G
                
    write_byte(255// B
            
    }
            
    write_byte(192// Brightness
            
    write_byte(0// Scroll speed
            
    message_end()
            
            if (
    get_pcvar_num(pSound) && !get_pcvar_num(pInstant))
                
    emit_sound(idCHAN_BODY"weapons/xbow_fire1.wav"VOL_NORMATTN_NORM0PITCH_HIGH)
            
            static 
    TaskData[2]
            
    TaskData[0] = id
            TaskData
    [1] = Hook[id]
            
            
    set_task(0.1"hookthink"id 890TaskData2"b")
        }
        else
            
    client_print(idprint_chat"Can't create hook")
    }

    public 
    remove_hook(id)
    {
        
    //Player can now throw hooks
        
    canThrowHook[id] = true
        
        
    // Remove the hook if it is valid
        
    if (pev_valid(Hook[id]))
            
    engfunc(EngFunc_RemoveEntityHook[id])
        
    Hook[id] = 0
        
        
    // Remove the line between user and hook
        
    if (is_user_connected(id))
        {
            
    message_begin(MSG_BROADCASTSVC_TEMPENTITY, {0,0,0}, id)
            
    write_byte(99// TE_KILLBEAM
            
    write_short(id// entity
            
    message_end()
        }
        
        
    // Player is not hooked anymore
        
    gHooked[id] = false
        
    return 1
    }

    public 
    give_hook(idlevelcid)
    {
        if (!
    cmd_access(id ,levelcid1))
            return 
    PLUGIN_HANDLED
        
        
    if (!get_pcvar_num(pAdmin))
        {
            
    console_print(id"[Hook] Sadece-Admin Modu Suan Kapali !")
            return 
    PLUGIN_HANDLED
        
    }
        
        static 
    szTarget[32]
        
    read_argv(1szTargetcharsmax(szTarget))
        
        new 
    iUsrId cmd_target(idszTarget)
        
        if (!
    iUsrId)
            return 
    PLUGIN_HANDLED
        
        
    static szName[32]
        
    get_user_name(iUsrIdszNamecharsmax(szName))
        
        if (!
    g_bHookAllowed[iUsrId])
        {
            
    g_bHookAllowed[iUsrId] = true
            
            console_print
    (id"[Hook] %s Adli Kisiye Hook Verdin !"szName)
        }
        else
            
    console_print(id"[Hook] %s Adli Kisi Zaten Hook'a Sahip !"szName)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    take_hook(idlevelcid)
    {
        if (!
    cmd_access(id ,levelcid1))
            return 
    PLUGIN_HANDLED
        
        
    if (!get_pcvar_num(pAdmin))
        {
            
    console_print(id"[Hook] Sadece-Admin Modu Suan Kapali !")
            return 
    PLUGIN_HANDLED
        
    }
        
        static 
    szTarget[32]
        
    read_argv(1szTargetcharsmax(szTarget))
        
        new 
    iUsrId cmd_target(idszTarget)
        
        if (!
    iUsrId)
            return 
    PLUGIN_HANDLED
        
        
    static szName[32]
        
    get_user_name(iUsrIdszNamecharsmax(szName))
        
        if (
    g_bHookAllowed[iUsrId])
        {
            
    g_bHookAllowed[iUsrId] = false
            
            console_print
    (id"[Hook] %s Adli Kisiden Hook Atma Ozelligini Aldiniz !"szName)
        }
        else
            
    console_print(id"[Hook] %s Adli Kisi Zaten Hook'a Sahip Degil !"szName)
        
        return 
    PLUGIN_HANDLED
    }

    // Stock by Chaosphere
    stock get_user_hitpoint(idFloat:hOrigin[3])
    {
        if (!
    is_user_alive(id))
            return 
    0
        
        
    static Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3]
        static 
    Float:fTemp[3]
        
        
    pev(idpev_originfOrigin)
        
    pev(idpev_v_anglefvAngle)
        
    pev(idpev_view_ofsfvOffset)
        
        
    xs_vec_add(fOriginfvOffsetfvOrigin)
        
        
    engfunc(EngFunc_AngleVectorsfvAnglefeOriginfTempfTemp)
        
        
    xs_vec_mul_scalar(feOrigin8192.0feOrigin)
        
    xs_vec_add(fvOriginfeOriginfeOrigin)
        
        static 
    tr
        engfunc
    (EngFunc_TraceLinefvOriginfeOrigin0idtr)
        
    get_tr2(trTR_vecEndPoshOrigin)
        
    //global_get(glb_trace_endpos, hOrigin)
        
        
    return 1
    }

    stock statusMsg(idszMsg[], {Float,_}:...)
    {
        static 
    iStatusText 
        
    if (!iStatusText)
            
    iStatusText get_user_msgid("StatusText")
        
        static 
    szBuffer[512]
        
    vformat(szBuffercharsmax(szBuffer), szMsg3)
        
        
    message_begin((id == 0) ? MSG_ALL MSG_ONEiStatusText_id)
        
    write_byte(0// Unknown
        
    write_string(szBuffer// Message
        
    message_end()
        
        return 
    1
    }  
    /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
    *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
    */ 
    Yetki: d

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    CS:GO ve CS 1.6 için ücretli eklenti yapılır.
    Plugin yazmak isteyenlere yardımcı olabilirim.
    Skype adresimden ulaşabilirsiniz:
    destek_596
    Steam: http://steamcommunity.com/id/ca-nemesis/


  3. #3
    binbaşı er sefatokgoz - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    Aug 2012
    Yer
    Kocaeli-İzmit
    Mesajlar
    545
    Bahsedildi
    1 Mesaj
    Etiketlenmiş
    0 Konu
    Tecrübe Puanı
    8

    Standart Cevap: Adminlere özel hook her el bir kere

    Aynen iyi olmuş bu
    Konu sefatokgoz tarafından (19-05-13 Saat 18:22 ) değiştirilmiştir.
    Messenger :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    Skype : sefa_tokgoz

  4. #4
    cavus er HijyeniK - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    May 2012
    Yer
    Denizli
    Mesajlar
    217
    Bahsedildi
    0 Mesaj
    Etiketlenmiş
    0 Konu
    Tecrübe Puanı
    9

    Standart Cevap: Adminlere özel hook her el bir kere

    Teşekkürler çözülmüş istekelre taşıyabilirsiniz.
    Konu akcaliberkk tarafından (07-05-13 Saat 18:41 ) değiştirilmiştir.

    La'brigade # Gaming Bir Gün Değil Her Gün Kral !
    Cs 1.6 Server : CS.LabrigadeGaming.Com
    TeamSpeak3 Server : Ts3.LabrigadeGaming.Com
    Msn :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Facebook :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Skype : HijyeniK


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


  5. #5
    Nemesis* coadmin akcaliberkk - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    Jun 2012
    Yer
    İstanbul
    Mesajlar
    2.027
    Bahsedildi
    105 Mesaj
    Etiketlenmiş
    10 Konu
    Tecrübe Puanı
    10

    Standart Cevap: Adminlere özel hook her el bir kere

    Çözülmüş İsteklere taşındı.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    CS:GO ve CS 1.6 için ücretli eklenti yapılır.
    Plugin yazmak isteyenlere yardımcı olabilirim.
    Skype adresimden ulaşabilirsiniz:
    destek_596
    Steam: http://steamcommunity.com/id/ca-nemesis/


  6. #6
    cavus er HijyeniK - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    May 2012
    Yer
    Denizli
    Mesajlar
    217
    Bahsedildi
    0 Mesaj
    Etiketlenmiş
    0 Konu
    Tecrübe Puanı
    9

    Standart Cevap: Adminlere özel hook her el bir kere

    Ya pardon ama yazı ekranda hep kalıyor onun 5 saniye kalıp gitmesi mümkün mü

    La'brigade # Gaming Bir Gün Değil Her Gün Kral !
    Cs 1.6 Server : CS.LabrigadeGaming.Com
    TeamSpeak3 Server : Ts3.LabrigadeGaming.Com
    Msn :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Facebook :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Skype : HijyeniK


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


  7. #7
    Nemesis* coadmin akcaliberkk - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    Jun 2012
    Yer
    İstanbul
    Mesajlar
    2.027
    Bahsedildi
    105 Mesaj
    Etiketlenmiş
    10 Konu
    Tecrübe Puanı
    10

    Standart Cevap: Adminlere özel hook her el bir kere

    PHP- Kodu:
    #define ADMINLEVEL ADMIN_BAN

    #include <amxmodx>
    #include <amxmisc>
    #include <fakemeta>
    #include <cstrike>
    #include <xs>

    #define message_begin_f(%1,%2,%3,%4) engfunc(EngFunc_MessageBegin, %1, %2, %3, %4)
    #define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1)

    //Cvars
    new pHookpThrowSpeedpSpeedpWidthpSoundpColor
    new pInterruptpAdminpHookSkypOpenDoorspPlayers
    new pUseButtonspHostagepWeaponspInstantpHookNoise
    new pMaxHookspRndStartDelaypCtOnly;
    // Sprite
    new sprBeam

    // Players hook entity
    new Hook[33]

    // MaxPlayers
    new gMaxPlayers

    // some booleans
    new bool:gHooked[33]
    new 
    bool:canThrowHook[33]
    new 
    bool:rndStarted

    // Player Spawn
    new bool:gRestart[33] = {false, ...}
    new 
    bool:gUpdate[33] = {false, ...}

    new 
    gHooksUsed[33// Used with sv_hookmax
    new bool:g_bHookAllowed[33// Used with sv_hookadminonly

    public plugin_init()
    {
        
    register_plugin("Hook""1.5""P34nut")
        
        
    // Hook commands
        
    register_clcmd("+hook""make_hook")
        
    register_clcmd("-hook""del_hook")
        
        
    register_concmd("amx_givehook""give_hook"ADMIN_RCON"<Username> - Give somebody access to the hook")
        
    register_concmd("amx_takehook""take_hook"ADMIN_RCON"<UserName> - Take away somebody his access to the hook")
        
        
    // Events for roundstart
        
    register_event("HLTV""round_bstart""a""1=0""2=0")
        
    register_logevent("round_estart"2"1=Round_Start"
        
        
    // Player spawn stuff
        
    register_event("TextMsg""Restart""a""2=#Game_will_restart_in")
        
    register_clcmd("fullupdate""Update"
        
    register_event("ResetHUD""ResetHUD""b")
        
        
    // Register cvars
        
    register_cvar("sv_amxxhookmod",  "version 1.5"FCVAR_SERVER// yay public cvar
        
    pHook =     register_cvar("sv_hook""1")
        
    pThrowSpeed =     register_cvar("sv_hookthrowspeed""4000")
        
    pSpeed =     register_cvar("sv_hookspeed""600")
        
    pWidth =     register_cvar("sv_hookwidth""16")
        
    pSound =     register_cvar("sv_hooksound""0")
        
    pColor =    register_cvar("sv_hookcolor""0")
        
    pPlayers =     register_cvar("sv_hookplayers""0")
        
    pInterrupt =     register_cvar("sv_hookinterrupt""0")
        
    pAdmin =     register_cvar("sv_hookadminonly",  "1")
        
    pHookSky =     register_cvar("sv_hooksky""1")
        
    pOpenDoors =     register_cvar("sv_hookopendoors""1")
        
    pUseButtons =     register_cvar("sv_hookusebuttons""1")
        
    pHostage =     register_cvar("sv_hookhostflollow""1")
        
    pWeapons =    register_cvar("sv_hookpickweapons""1")
        
    pInstant =    register_cvar("sv_hookinstant""1")
        
    pHookNoise =     register_cvar("sv_hooknoise""0")
        
    pMaxHooks =     register_cvar("sv_hookmax""1")
        
    pRndStartDelay register_cvar("sv_hookrndstartdelay""0.0")
        
    pCtOnly register_cvar("sv_hookctonly""1")
        
        
        
    // Touch forward
        
    register_forward(FM_Touch"fwTouch")
        
        
    // Get maxplayers
        
    gMaxPlayers get_maxplayers()
    }

    public 
    plugin_precache()
    {
        
    // Hook Model
        
    engfunc(EngFunc_PrecacheModel"models/rpgrocket.mdl")
        
        
    // Hook Beam
        
    sprBeam engfunc(EngFunc_PrecacheModel"sprites/zbeam4.spr")
        
        
    // Hook Sounds
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hit1.wav"// good hit
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hit2.wav"// wrong hit
        
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hitbod1.wav"// player hit
        
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_fire1.wav"// deploy
    }


    public 
    make_hook(id)
    {
        
        if (
    get_pcvar_num(pHook) && is_user_alive(id) && canThrowHook[id] && !gHooked[id]) {        
            if (
    get_pcvar_num(pAdmin))
            {
                
    // Only the admins can throw the hook
                // if(is_user_admin(id)) { <- does not work...        
                
    if (!(get_user_flags(id) & ADMINLEVEL) && !g_bHookAllowed[id])
                {
                    
    // Show a message
                    
    client_print(idprint_chat"[Hook] Bunu Kullanmak Icin Yetkiniz Yok")
                    
                    return 
    PLUGIN_HANDLED
                
    }
            }
            if(
    get_pcvar_num(pCtOnly)) {
                if(
    get_user_team(id) != 2) {
                    
    client_print(id,print_chat,"[Hook] Sadece CT Takimi Hook Kullanabilir")
                    return 
    PLUGIN_HANDLED
                
    }
            }
            new 
    iMaxHooks get_pcvar_num(pMaxHooks)
            if (
    iMaxHooks 0)
            {
                if (
    gHooksUsed[id] >= iMaxHooks)
                {
                    
    client_print(idprint_chat"[Hook] Hook Limitin Doldu Artik Hook Kullanamazsin !")
                    
    //statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks))
                    
                    
    return PLUGIN_HANDLED
                
    }
                else 
                {
                    
    gHooksUsed[id]++
                    
    //statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks))
                
    }
            }
            new 
    Float:fDelay get_pcvar_float(pRndStartDelay)
            if (
    fDelay && !rndStarted)
                
    client_print(idprint_chat"[Hook] Ilk %0.0f Saniye Boyunca Hook Kullanamazsin !"fDelay)
            
            
    throw_hook(id)
        }
        return 
    PLUGIN_HANDLED
    }

    public 
    del_hook(id)
    {
        
    // Remove players hook
        
    if (!canThrowHook[id])
            
    remove_hook(id)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    round_bstart()
    {
        
    // Round is not started anymore
        
    if (rndStarted)
            
    rndStarted false
        
        
    // Remove all hooks
        
    for (new 1<= gMaxPlayersi++)
        {
            if (
    is_user_connected(i))
            {
                if(!
    canThrowHook[i])
                    
    remove_hook(i)
            }
        }
    }

    public 
    round_estart()
    {
        new 
    Float:fDelay get_pcvar_float(pRndStartDelay)
        if (
    fDelay 0.0)
            
    set_task(fDelay"rndStartDelay")
        else
        {
            
    // Round is started...
            
    if (!rndStarted)
                
    rndStarted true
        
    }
    }

    public 
    rndStartDelay()
    {
        if (!
    rndStarted)
            
    rndStarted true
    }

    public 
    Restart()
    {
        for (new 
    id 0id gMaxPlayersid++)
        {
            if (
    is_user_connected(id))
                
    gRestart[id] = true
        
    }
    }

    public 
    Update(id)
    {
        if (!
    gUpdate[id])
            
    gUpdate[id] = true
        
        
    return PLUGIN_CONTINUE
    }

    public 
    ResetHUD(id)
    {
        if (
    gRestart[id])
        {
            
    gRestart[id] = false
            
    return
        }
        if (
    gUpdate[id])
        {
            
    gUpdate[id] = false
            
    return
        }
        if (
    gHooked[id])
        {
            
    remove_hook(id)
        }
        if (
    get_pcvar_num(pMaxHooks) > 0)
        {
            
    gHooksUsed[id] = 0
            
    //statusMsg(0, "[Hook] 0 of %d hooks used.", get_pcvar_num(pMaxHooks))
        
    }
    }

    public 
    fwTouch(ptrptd)
    {
        if (!
    pev_valid(ptr))
            return 
    FMRES_IGNORED
        
        
    new id pev(ptrpev_owner)
        
        
    // Get classname
        
    static szPtrClass[32]    
        
    pev(ptrpev_classnameszPtrClasscharsmax(szPtrClass))
        
        if (
    equali(szPtrClass"Hook"))
        {        
            static 
    Float:fOrigin[3]
            
    pev(ptrpev_originfOrigin)
            
            if (
    pev_valid(ptd))
            {
                static 
    szPtdClass[32]
                
    pev(ptdpev_classnameszPtdClasscharsmax(szPtdClass))
                
                if (!
    get_pcvar_num(pPlayers) && /*equali(szPtdClass, "player")*/ is_user_alive(ptd))
                {
                    
    // Hit a player
                    
    if (get_pcvar_num(pSound))
                        
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hitbod1.wav"1.0ATTN_NORM0PITCH_NORM)
                    
    remove_hook(id)
                    
                    return 
    FMRES_HANDLED
                
    }
                else if (
    equali(szPtdClass"hostage_entity"))
                {
                    
    // Makes an hostage follow
                    
    if (get_pcvar_num(pHostage) && get_user_team(id) == 2)
                    {                    
                        
    //cs_set_hostage_foll(ptd, (cs_get_hostage_foll(ptd) == id) ? 0 : id)
                        // With the use function we have the sounds!
                        
    dllfunc(DLLFunc_Useptdid)
                    }
                    if (!
    get_pcvar_num(pPlayers))
                    {
                        if(
    get_pcvar_num(pSound))
                            
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hitbod1.wav"1.0ATTN_NORM0PITCH_NORM)
                        
    remove_hook(id)
                    }
                    return 
    FMRES_HANDLED
                
    }
                else if (
    get_pcvar_num(pOpenDoors) && equali(szPtdClass"func_door") || equali(szPtdClass"func_door_rotating"))
                {
                    
    // Open doors
                    // Double doors tested in de_nuke and de_wallmart
                    
    static szTargetName[32]
                    
    pev(ptdpev_targetnameszTargetNamecharsmax(szTargetName))
                    if (
    strlen(szTargetName) > 0)
                    {    
                        static 
    ent
                        
    while ((ent engfunc(EngFunc_FindEntityByStringent"target"szTargetName)) > 0)
                        {
                            static 
    szEntClass[32]
                            
    pev(entpev_classnameszEntClasscharsmax(szEntClass))
                            
                            if (
    equali(szEntClass"trigger_multiple"))
                            {
                                
    dllfunc(DLLFunc_Touchentid)
                                goto 
    stopdoors // No need to touch anymore
                            
    }
                        }
                    }
                    
                    
    // No double doors.. just touch it
                    
    dllfunc(DLLFunc_Touchptdid)
                    
    stopdoors:                
                }
                else if (
    get_pcvar_num(pUseButtons) && equali(szPtdClass"func_button"))
                {
                    if (
    pev(ptdpev_spawnflags) & SF_BUTTON_TOUCH_ONLY)
                        
    dllfunc(DLLFunc_Touchptdid// Touch only
                    
    else            
                        
    dllfunc(DLLFunc_Useptdid// Use Buttons            
                
    }
            }
            
            
    // If cvar sv_hooksky is 0 and hook is in the sky remove it!
            
    new iContents engfunc(EngFunc_PointContentsfOrigin)
            if (!
    get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
            {
                if(
    get_pcvar_num(pSound))
                    
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM)
                
    remove_hook(id)
                return 
    FMRES_HANDLED
            
    }
            
            
    // Pick up weapons..
            
    if (get_pcvar_num(pWeapons))
            {
                static 
    ent
                
    while ((ent engfunc(EngFunc_FindEntityInSphereentfOrigin15.0)) > 0)
                {
                    static 
    szentClass[32]
                    
    pev(entpev_classnameszentClasscharsmax(szentClass))
                    
                    if (
    equali(szentClass"weaponbox") || equali(szentClass"armoury_entity"))
                        
    dllfunc(DLLFunc_Touchentid)
                }
            }
            
            
    // Player is now hooked
            
    gHooked[id] = true
            
    // Play sound
            
    if (get_pcvar_num(pSound))
                
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hit1.wav"1.0ATTN_NORM0PITCH_NORM)
            
            
    // Make some sparks :D
            
    message_begin_f(MSG_BROADCASTSVC_TEMPENTITYfOrigin0)
            
    write_byte(9// TE_SPARKS
            
    write_coord_f(fOrigin[0]) // Origin
            
    write_coord_f(fOrigin[1])
            
    write_coord_f(fOrigin[2])
            
    message_end()        
            
            
    // Stop the hook from moving
            
    set_pev(ptrpev_velocityFloat:{0.00.00.0})
            
    set_pev(ptrpev_movetypeMOVETYPE_NONE)
            
            
    //Task
            
    if (!task_exists(id 856))
            { 
                static 
    TaskData[2]
                
    TaskData[0] = id
                TaskData
    [1] = ptr
                gotohook
    (TaskData)
                
                
    set_task(0.1"gotohook"id 856TaskData2"b")
            }
        }
        return 
    FMRES_HANDLED
    }

    public 
    hookthink(param[])
    {
        new 
    id param[0]
        new 
    HookEnt param[1]
        
        if (!
    is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id))
        {
            
    remove_task(id 890)
            return 
    PLUGIN_HANDLED
        
    }
        
        
        static 
    Float:entOrigin[3]
        
    pev(HookEntpev_originentOrigin)
        
        
    // If user is behind a box or something.. remove it
        // only works if sv_interrupt 1 or higher is
        
    if (get_pcvar_num(pInterrupt) && rndStarted)
        {
            static 
    Float:usrOrigin[3]
            
    pev(idpev_originusrOrigin)
            
            static 
    tr
            engfunc
    (EngFunc_TraceLineusrOriginentOrigin1, -1tr)
            
            static 
    Float:fFraction
            get_tr2
    (trTR_flFractionfFraction)
            
            if (
    fFraction != 1.0)
                
    remove_hook(id)
        }
        
        
    // If cvar sv_hooksky is 0 and hook is in the sky remove it!
        
    new iContents engfunc(EngFunc_PointContentsentOrigin)
        if (!
    get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
        {
            if(
    get_pcvar_num(pSound))
                
    emit_sound(HookEntCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM)
            
    remove_hook(id)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    gotohook(param[])
    {
        new 
    id param[0]
        new 
    HookEnt param[1]
        
        if (!
    is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id))
        {
            
    remove_task(id 856)
            return 
    PLUGIN_HANDLED
        
    }
        
    // If the round isnt started velocity is just 0
        
    static Float:fVelocity[3]
        
    fVelocity Float:{0.00.01.0}
        
        
    // If the round is started and player is hooked we can set the user velocity!
        
    if (rndStarted && gHooked[id])
        {
            static 
    Float:fHookOrigin[3], Float:fUsrOrigin[3], Float:fDist
            pev
    (HookEntpev_originfHookOrigin)
            
    pev(idpev_originfUsrOrigin)
            
            
    fDist vector_distance(fHookOriginfUsrOrigin)
            
            if (
    fDist >= 30.0)
            {
                new 
    Float:fSpeed get_pcvar_float(pSpeed)
                
                
    fSpeed *= 0.52
                
                fVelocity
    [0] = (fHookOrigin[0] - fUsrOrigin[0]) * (2.0 fSpeed) / fDist
                fVelocity
    [1] = (fHookOrigin[1] - fUsrOrigin[1]) * (2.0 fSpeed) / fDist
                fVelocity
    [2] = (fHookOrigin[2] - fUsrOrigin[2]) * (2.0 fSpeed) / fDist
            
    }
        }
        
    // Set the velocity
        
    set_pev(idpev_velocityfVelocity)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    throw_hook(id)
    {
        
    // Get origin and angle for the hook
        
    static Float:fOrigin[3], Float:fAngle[3],Float:fvAngle[3]
        static 
    Float:fStart[3]
        
    pev(idpev_originfOrigin)
        
        
    pev(idpev_anglesfAngle)
        
    pev(idpev_v_anglefvAngle)
        
        if (
    get_pcvar_num(pInstant))
        {
            
    get_user_hitpoint(idfStart)
            
            if (
    engfunc(EngFunc_PointContentsfStart) != CONTENTS_SKY)
            {
                static 
    Float:fSize[3]
                
    pev(idpev_sizefSize)
                
                
    fOrigin[0] = fStart[0] + floatcos(fvAngle[1], degrees) * (-10.0 fSize[0])
                
    fOrigin[1] = fStart[1] + floatsin(fvAngle[1], degrees) * (-10.0 fSize[1])
                
    fOrigin[2] = fStart[2]
            }
            else
                
    xs_vec_copy(fStartfOrigin)
        }
        
        
        
    // Make the hook!
        
    Hook[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
        
        if (
    Hook[id])
        {
            
    // Player cant throw hook now
            
    canThrowHook[id] = false
            
            
    static const Float:fMins[3] = {-2.840000, -14.180000, -2.840000}
            static const 
    Float:fMaxs[3] = {2.8400000.0200002.840000}
            
            
    //Set some Data
            
    set_pev(Hook[id], pev_classname"Hook")
            
            
    engfunc(EngFunc_SetModelHook[id], "models/rpgrocket.mdl")
            
    engfunc(EngFunc_SetOriginHook[id], fOrigin)
            
    engfunc(EngFunc_SetSizeHook[id], fMinsfMaxs)        
            
            
    //set_pev(Hook[id], pev_mins, fMins)
            //set_pev(Hook[id], pev_maxs, fMaxs)
            
            
    set_pev(Hook[id], pev_anglesfAngle)
            
            
    set_pev(Hook[id], pev_solid2)
            
    set_pev(Hook[id], pev_movetype5)
            
    set_pev(Hook[id], pev_ownerid)
            
            
    //Set hook velocity
            
    static Float:fForward[3], Float:Velocity[3]
            new 
    Float:fSpeed get_pcvar_float(pThrowSpeed)
            
            
    engfunc(EngFunc_MakeVectorsfvAngle)
            
    global_get(glb_v_forwardfForward)
            
            
    Velocity[0] = fForward[0] * fSpeed
            Velocity
    [1] = fForward[1] * fSpeed
            Velocity
    [2] = fForward[2] * fSpeed
            
            set_pev
    (Hook[id], pev_velocityVelocity)
            
            
    // Make the line between Hook and Player
            
    message_begin_f(MSG_BROADCASTSVC_TEMPENTITYFloat:{0.00.00.0}, 0)
            if (
    get_pcvar_num(pInstant))
            {
                
    write_byte(1// TE_BEAMPOINT
                
    write_short(id// Startent
                
    write_coord_f(fStart[0]) // End pos
                
    write_coord_f(fStart[1])
                
    write_coord_f(fStart[2])
            }
            else
            {
                
    write_byte(8// TE_BEAMENTS
                
    write_short(id// Start Ent
                
    write_short(Hook[id]) // End Ent
            
    }
            
    write_short(sprBeam// Sprite
            
    write_byte(1// StartFrame
            
    write_byte(1// FrameRate
            
    write_byte(600// Life
            
    write_byte(get_pcvar_num(pWidth)) // Width
            
    write_byte(get_pcvar_num(pHookNoise)) // Noise
            // Colors now
            
    if (get_pcvar_num(pColor))
            {
                if (
    get_user_team(id) == 1// Terrorist
                
    {
                    
    write_byte(255// R
                    
    write_byte(0)    // G
                    
    write_byte(0)    // B
                
    }
                
    #if defined _cstrike_included
                
    else if(cs_get_user_vip(id)) // vip for cstrike
                
    {
                    
    write_byte(0)    // R
                    
    write_byte(255)    // G
                    
    write_byte(0)    // B
                
    }
                
    #endif // _cstrike_included
                
    else if(get_user_team(id) == 2// CT
                
    {
                    
    write_byte(0)    // R
                    
    write_byte(0)    // G
                    
    write_byte(255)    // B
                
    }
                else
                {
                    
    write_byte(255// R
                    
    write_byte(255// G
                    
    write_byte(255// B
                
    }
            }
            else
            {
                
    write_byte(255// R
                
    write_byte(255// G
                
    write_byte(255// B
            
    }
            
    write_byte(192// Brightness
            
    write_byte(0// Scroll speed
            
    message_end()
            
            if (
    get_pcvar_num(pSound) && !get_pcvar_num(pInstant))
                
    emit_sound(idCHAN_BODY"weapons/xbow_fire1.wav"VOL_NORMATTN_NORM0PITCH_HIGH)
            
            static 
    TaskData[2]
            
    TaskData[0] = id
            TaskData
    [1] = Hook[id]
            
            
    set_task(0.1"hookthink"id 890TaskData2"b")
        }
        else
            
    client_print(idprint_chat"Can't create hook")
    }

    public 
    remove_hook(id)
    {
        
    //Player can now throw hooks
        
    canThrowHook[id] = true
        
        
    // Remove the hook if it is valid
        
    if (pev_valid(Hook[id]))
            
    engfunc(EngFunc_RemoveEntityHook[id])
        
    Hook[id] = 0
        
        
    // Remove the line between user and hook
        
    if (is_user_connected(id))
        {
            
    message_begin(MSG_BROADCASTSVC_TEMPENTITY, {0,0,0}, id)
            
    write_byte(99// TE_KILLBEAM
            
    write_short(id// entity
            
    message_end()
        }
        
        
    // Player is not hooked anymore
        
    gHooked[id] = false
        
    return 1
    }

    public 
    give_hook(idlevelcid)
    {
        if (!
    cmd_access(id ,levelcid1))
            return 
    PLUGIN_HANDLED
        
        
    if (!get_pcvar_num(pAdmin))
        {
            
    console_print(id"[Hook] Sadece-Admin Modu Suan Kapali !")
            return 
    PLUGIN_HANDLED
        
    }
        
        static 
    szTarget[32]
        
    read_argv(1szTargetcharsmax(szTarget))
        
        new 
    iUsrId cmd_target(idszTarget)
        
        if (!
    iUsrId)
            return 
    PLUGIN_HANDLED
        
        
    static szName[32]
        
    get_user_name(iUsrIdszNamecharsmax(szName))
        
        if (!
    g_bHookAllowed[iUsrId])
        {
            
    g_bHookAllowed[iUsrId] = true
            
            console_print
    (id"[Hook] %s Adli Kisiye Hook Verdin !"szName)
        }
        else
            
    console_print(id"[Hook] %s Adli Kisi Zaten Hook'a Sahip !"szName)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    take_hook(idlevelcid)
    {
        if (!
    cmd_access(id ,levelcid1))
            return 
    PLUGIN_HANDLED
        
        
    if (!get_pcvar_num(pAdmin))
        {
            
    console_print(id"[Hook] Sadece-Admin Modu Suan Kapali !")
            return 
    PLUGIN_HANDLED
        
    }
        
        static 
    szTarget[32]
        
    read_argv(1szTargetcharsmax(szTarget))
        
        new 
    iUsrId cmd_target(idszTarget)
        
        if (!
    iUsrId)
            return 
    PLUGIN_HANDLED
        
        
    static szName[32]
        
    get_user_name(iUsrIdszNamecharsmax(szName))
        
        if (
    g_bHookAllowed[iUsrId])
        {
            
    g_bHookAllowed[iUsrId] = false
            
            console_print
    (id"[Hook] %s Adli Kisiden Hook Atma Ozelligini Aldiniz !"szName)
        }
        else
            
    console_print(id"[Hook] %s Adli Kisi Zaten Hook'a Sahip Degil !"szName)
        
        return 
    PLUGIN_HANDLED
    }

    // Stock by Chaosphere
    stock get_user_hitpoint(idFloat:hOrigin[3])
    {
        if (!
    is_user_alive(id))
            return 
    0
        
        
    static Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3]
        static 
    Float:fTemp[3]
        
        
    pev(idpev_originfOrigin)
        
    pev(idpev_v_anglefvAngle)
        
    pev(idpev_view_ofsfvOffset)
        
        
    xs_vec_add(fOriginfvOffsetfvOrigin)
        
        
    engfunc(EngFunc_AngleVectorsfvAnglefeOriginfTempfTemp)
        
        
    xs_vec_mul_scalar(feOrigin8192.0feOrigin)
        
    xs_vec_add(fvOriginfeOriginfeOrigin)
        
        static 
    tr
        engfunc
    (EngFunc_TraceLinefvOriginfeOrigin0idtr)
        
    get_tr2(trTR_vecEndPoshOrigin)
        
    //global_get(glb_trace_endpos, hOrigin)
        
        
    return 1

    Yazı tamamen kaldırıldı.

    ---------- Alttaki Mesaj Zamani 19:17 ---------- Önceki Mesaj Zamani 19:17 ----------

    PHP- Kodu:
    #define ADMINLEVEL ADMIN_BAN

    #include <amxmodx>
    #include <amxmisc>
    #include <fakemeta>
    #include <cstrike>
    #include <xs>

    #define message_begin_f(%1,%2,%3,%4) engfunc(EngFunc_MessageBegin, %1, %2, %3, %4)
    #define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1)

    //Cvars
    new pHookpThrowSpeedpSpeedpWidthpSoundpColor
    new pInterruptpAdminpHookSkypOpenDoorspPlayers
    new pUseButtonspHostagepWeaponspInstantpHookNoise
    new pMaxHookspRndStartDelaypCtOnly;
    // Sprite
    new sprBeam

    // Players hook entity
    new Hook[33]

    // MaxPlayers
    new gMaxPlayers

    // some booleans
    new bool:gHooked[33]
    new 
    bool:canThrowHook[33]
    new 
    bool:rndStarted

    // Player Spawn
    new bool:gRestart[33] = {false, ...}
    new 
    bool:gUpdate[33] = {false, ...}

    new 
    gHooksUsed[33// Used with sv_hookmax
    new bool:g_bHookAllowed[33// Used with sv_hookadminonly

    public plugin_init()
    {
        
    register_plugin("Hook""1.5""P34nut")
        
        
    // Hook commands
        
    register_clcmd("+hook""make_hook")
        
    register_clcmd("-hook""del_hook")
        
        
    register_concmd("amx_givehook""give_hook"ADMIN_RCON"<Username> - Give somebody access to the hook")
        
    register_concmd("amx_takehook""take_hook"ADMIN_RCON"<UserName> - Take away somebody his access to the hook")
        
        
    // Events for roundstart
        
    register_event("HLTV""round_bstart""a""1=0""2=0")
        
    register_logevent("round_estart"2"1=Round_Start"
        
        
    // Player spawn stuff
        
    register_event("TextMsg""Restart""a""2=#Game_will_restart_in")
        
    register_clcmd("fullupdate""Update"
        
    register_event("ResetHUD""ResetHUD""b")
        
        
    // Register cvars
        
    register_cvar("sv_amxxhookmod",  "version 1.5"FCVAR_SERVER// yay public cvar
        
    pHook =     register_cvar("sv_hook""1")
        
    pThrowSpeed =     register_cvar("sv_hookthrowspeed""4000")
        
    pSpeed =     register_cvar("sv_hookspeed""600")
        
    pWidth =     register_cvar("sv_hookwidth""16")
        
    pSound =     register_cvar("sv_hooksound""0")
        
    pColor =    register_cvar("sv_hookcolor""0")
        
    pPlayers =     register_cvar("sv_hookplayers""0")
        
    pInterrupt =     register_cvar("sv_hookinterrupt""0")
        
    pAdmin =     register_cvar("sv_hookadminonly",  "1")
        
    pHookSky =     register_cvar("sv_hooksky""1")
        
    pOpenDoors =     register_cvar("sv_hookopendoors""1")
        
    pUseButtons =     register_cvar("sv_hookusebuttons""1")
        
    pHostage =     register_cvar("sv_hookhostflollow""1")
        
    pWeapons =    register_cvar("sv_hookpickweapons""1")
        
    pInstant =    register_cvar("sv_hookinstant""1")
        
    pHookNoise =     register_cvar("sv_hooknoise""0")
        
    pMaxHooks =     register_cvar("sv_hookmax""1")
        
    pRndStartDelay register_cvar("sv_hookrndstartdelay""0.0")
        
    pCtOnly register_cvar("sv_hookctonly""1")
        
        
        
    // Touch forward
        
    register_forward(FM_Touch"fwTouch")
        
        
    // Get maxplayers
        
    gMaxPlayers get_maxplayers()
    }

    public 
    plugin_precache()
    {
        
    // Hook Model
        
    engfunc(EngFunc_PrecacheModel"models/rpgrocket.mdl")
        
        
    // Hook Beam
        
    sprBeam engfunc(EngFunc_PrecacheModel"sprites/zbeam4.spr")
        
        
    // Hook Sounds
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hit1.wav"// good hit
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hit2.wav"// wrong hit
        
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hitbod1.wav"// player hit
        
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_fire1.wav"// deploy
    }


    public 
    make_hook(id)
    {
        
        if (
    get_pcvar_num(pHook) && is_user_alive(id) && canThrowHook[id] && !gHooked[id]) {        
            if (
    get_pcvar_num(pAdmin))
            {
                
    // Only the admins can throw the hook
                // if(is_user_admin(id)) { <- does not work...        
                
    if (!(get_user_flags(id) & ADMINLEVEL) && !g_bHookAllowed[id])
                {
                    
    // Show a message
                    
    client_print(idprint_chat"[Hook] Bunu Kullanmak Icin Yetkiniz Yok")
                    
                    return 
    PLUGIN_HANDLED
                
    }
            }
            if(
    get_pcvar_num(pCtOnly)) {
                if(
    get_user_team(id) != 2) {
                    
    client_print(id,print_chat,"[Hook] Sadece CT Takimi Hook Kullanabilir")
                    return 
    PLUGIN_HANDLED
                
    }
            }
            new 
    iMaxHooks get_pcvar_num(pMaxHooks)
            if (
    iMaxHooks 0)
            {
                if (
    gHooksUsed[id] >= iMaxHooks)
                {
                    
    client_print(idprint_chat"[Hook] Hook Limitin Doldu Artik Hook Kullanamazsin !")
                    
    //statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks))
                    
                    
    return PLUGIN_HANDLED
                
    }
                else 
                {
                    
    gHooksUsed[id]++
                    
    //statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks))
                
    }
            }
            new 
    Float:fDelay get_pcvar_float(pRndStartDelay)
            if (
    fDelay && !rndStarted)
                
    client_print(idprint_chat"[Hook] Ilk %0.0f Saniye Boyunca Hook Kullanamazsin !"fDelay)
            
            
    throw_hook(id)
        }
        return 
    PLUGIN_HANDLED
    }

    public 
    del_hook(id)
    {
        
    // Remove players hook
        
    if (!canThrowHook[id])
            
    remove_hook(id)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    round_bstart()
    {
        
    // Round is not started anymore
        
    if (rndStarted)
            
    rndStarted false
        
        
    // Remove all hooks
        
    for (new 1<= gMaxPlayersi++)
        {
            if (
    is_user_connected(i))
            {
                if(!
    canThrowHook[i])
                    
    remove_hook(i)
            }
        }
    }

    public 
    round_estart()
    {
        new 
    Float:fDelay get_pcvar_float(pRndStartDelay)
        if (
    fDelay 0.0)
            
    set_task(fDelay"rndStartDelay")
        else
        {
            
    // Round is started...
            
    if (!rndStarted)
                
    rndStarted true
        
    }
    }

    public 
    rndStartDelay()
    {
        if (!
    rndStarted)
            
    rndStarted true
    }

    public 
    Restart()
    {
        for (new 
    id 0id gMaxPlayersid++)
        {
            if (
    is_user_connected(id))
                
    gRestart[id] = true
        
    }
    }

    public 
    Update(id)
    {
        if (!
    gUpdate[id])
            
    gUpdate[id] = true
        
        
    return PLUGIN_CONTINUE
    }

    public 
    ResetHUD(id)
    {
        if (
    gRestart[id])
        {
            
    gRestart[id] = false
            
    return
        }
        if (
    gUpdate[id])
        {
            
    gUpdate[id] = false
            
    return
        }
        if (
    gHooked[id])
        {
            
    remove_hook(id)
        }
        if (
    get_pcvar_num(pMaxHooks) > 0)
        {
            
    gHooksUsed[id] = 0
            
    //statusMsg(0, "[Hook] 0 of %d hooks used.", get_pcvar_num(pMaxHooks))
        
    }
    }

    public 
    fwTouch(ptrptd)
    {
        if (!
    pev_valid(ptr))
            return 
    FMRES_IGNORED
        
        
    new id pev(ptrpev_owner)
        
        
    // Get classname
        
    static szPtrClass[32]    
        
    pev(ptrpev_classnameszPtrClasscharsmax(szPtrClass))
        
        if (
    equali(szPtrClass"Hook"))
        {        
            static 
    Float:fOrigin[3]
            
    pev(ptrpev_originfOrigin)
            
            if (
    pev_valid(ptd))
            {
                static 
    szPtdClass[32]
                
    pev(ptdpev_classnameszPtdClasscharsmax(szPtdClass))
                
                if (!
    get_pcvar_num(pPlayers) && /*equali(szPtdClass, "player")*/ is_user_alive(ptd))
                {
                    
    // Hit a player
                    
    if (get_pcvar_num(pSound))
                        
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hitbod1.wav"1.0ATTN_NORM0PITCH_NORM)
                    
    remove_hook(id)
                    
                    return 
    FMRES_HANDLED
                
    }
                else if (
    equali(szPtdClass"hostage_entity"))
                {
                    
    // Makes an hostage follow
                    
    if (get_pcvar_num(pHostage) && get_user_team(id) == 2)
                    {                    
                        
    //cs_set_hostage_foll(ptd, (cs_get_hostage_foll(ptd) == id) ? 0 : id)
                        // With the use function we have the sounds!
                        
    dllfunc(DLLFunc_Useptdid)
                    }
                    if (!
    get_pcvar_num(pPlayers))
                    {
                        if(
    get_pcvar_num(pSound))
                            
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hitbod1.wav"1.0ATTN_NORM0PITCH_NORM)
                        
    remove_hook(id)
                    }
                    return 
    FMRES_HANDLED
                
    }
                else if (
    get_pcvar_num(pOpenDoors) && equali(szPtdClass"func_door") || equali(szPtdClass"func_door_rotating"))
                {
                    
    // Open doors
                    // Double doors tested in de_nuke and de_wallmart
                    
    static szTargetName[32]
                    
    pev(ptdpev_targetnameszTargetNamecharsmax(szTargetName))
                    if (
    strlen(szTargetName) > 0)
                    {    
                        static 
    ent
                        
    while ((ent engfunc(EngFunc_FindEntityByStringent"target"szTargetName)) > 0)
                        {
                            static 
    szEntClass[32]
                            
    pev(entpev_classnameszEntClasscharsmax(szEntClass))
                            
                            if (
    equali(szEntClass"trigger_multiple"))
                            {
                                
    dllfunc(DLLFunc_Touchentid)
                                goto 
    stopdoors // No need to touch anymore
                            
    }
                        }
                    }
                    
                    
    // No double doors.. just touch it
                    
    dllfunc(DLLFunc_Touchptdid)
                    
    stopdoors:                
                }
                else if (
    get_pcvar_num(pUseButtons) && equali(szPtdClass"func_button"))
                {
                    if (
    pev(ptdpev_spawnflags) & SF_BUTTON_TOUCH_ONLY)
                        
    dllfunc(DLLFunc_Touchptdid// Touch only
                    
    else            
                        
    dllfunc(DLLFunc_Useptdid// Use Buttons            
                
    }
            }
            
            
    // If cvar sv_hooksky is 0 and hook is in the sky remove it!
            
    new iContents engfunc(EngFunc_PointContentsfOrigin)
            if (!
    get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
            {
                if(
    get_pcvar_num(pSound))
                    
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM)
                
    remove_hook(id)
                return 
    FMRES_HANDLED
            
    }
            
            
    // Pick up weapons..
            
    if (get_pcvar_num(pWeapons))
            {
                static 
    ent
                
    while ((ent engfunc(EngFunc_FindEntityInSphereentfOrigin15.0)) > 0)
                {
                    static 
    szentClass[32]
                    
    pev(entpev_classnameszentClasscharsmax(szentClass))
                    
                    if (
    equali(szentClass"weaponbox") || equali(szentClass"armoury_entity"))
                        
    dllfunc(DLLFunc_Touchentid)
                }
            }
            
            
    // Player is now hooked
            
    gHooked[id] = true
            
    // Play sound
            
    if (get_pcvar_num(pSound))
                
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hit1.wav"1.0ATTN_NORM0PITCH_NORM)
            
            
    // Make some sparks :D
            
    message_begin_f(MSG_BROADCASTSVC_TEMPENTITYfOrigin0)
            
    write_byte(9// TE_SPARKS
            
    write_coord_f(fOrigin[0]) // Origin
            
    write_coord_f(fOrigin[1])
            
    write_coord_f(fOrigin[2])
            
    message_end()        
            
            
    // Stop the hook from moving
            
    set_pev(ptrpev_velocityFloat:{0.00.00.0})
            
    set_pev(ptrpev_movetypeMOVETYPE_NONE)
            
            
    //Task
            
    if (!task_exists(id 856))
            { 
                static 
    TaskData[2]
                
    TaskData[0] = id
                TaskData
    [1] = ptr
                gotohook
    (TaskData)
                
                
    set_task(0.1"gotohook"id 856TaskData2"b")
            }
        }
        return 
    FMRES_HANDLED
    }

    public 
    hookthink(param[])
    {
        new 
    id param[0]
        new 
    HookEnt param[1]
        
        if (!
    is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id))
        {
            
    remove_task(id 890)
            return 
    PLUGIN_HANDLED
        
    }
        
        
        static 
    Float:entOrigin[3]
        
    pev(HookEntpev_originentOrigin)
        
        
    // If user is behind a box or something.. remove it
        // only works if sv_interrupt 1 or higher is
        
    if (get_pcvar_num(pInterrupt) && rndStarted)
        {
            static 
    Float:usrOrigin[3]
            
    pev(idpev_originusrOrigin)
            
            static 
    tr
            engfunc
    (EngFunc_TraceLineusrOriginentOrigin1, -1tr)
            
            static 
    Float:fFraction
            get_tr2
    (trTR_flFractionfFraction)
            
            if (
    fFraction != 1.0)
                
    remove_hook(id)
        }
        
        
    // If cvar sv_hooksky is 0 and hook is in the sky remove it!
        
    new iContents engfunc(EngFunc_PointContentsentOrigin)
        if (!
    get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
        {
            if(
    get_pcvar_num(pSound))
                
    emit_sound(HookEntCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM)
            
    remove_hook(id)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    gotohook(param[])
    {
        new 
    id param[0]
        new 
    HookEnt param[1]
        
        if (!
    is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id))
        {
            
    remove_task(id 856)
            return 
    PLUGIN_HANDLED
        
    }
        
    // If the round isnt started velocity is just 0
        
    static Float:fVelocity[3]
        
    fVelocity Float:{0.00.01.0}
        
        
    // If the round is started and player is hooked we can set the user velocity!
        
    if (rndStarted && gHooked[id])
        {
            static 
    Float:fHookOrigin[3], Float:fUsrOrigin[3], Float:fDist
            pev
    (HookEntpev_originfHookOrigin)
            
    pev(idpev_originfUsrOrigin)
            
            
    fDist vector_distance(fHookOriginfUsrOrigin)
            
            if (
    fDist >= 30.0)
            {
                new 
    Float:fSpeed get_pcvar_float(pSpeed)
                
                
    fSpeed *= 0.52
                
                fVelocity
    [0] = (fHookOrigin[0] - fUsrOrigin[0]) * (2.0 fSpeed) / fDist
                fVelocity
    [1] = (fHookOrigin[1] - fUsrOrigin[1]) * (2.0 fSpeed) / fDist
                fVelocity
    [2] = (fHookOrigin[2] - fUsrOrigin[2]) * (2.0 fSpeed) / fDist
            
    }
        }
        
    // Set the velocity
        
    set_pev(idpev_velocityfVelocity)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    throw_hook(id)
    {
        
    // Get origin and angle for the hook
        
    static Float:fOrigin[3], Float:fAngle[3],Float:fvAngle[3]
        static 
    Float:fStart[3]
        
    pev(idpev_originfOrigin)
        
        
    pev(idpev_anglesfAngle)
        
    pev(idpev_v_anglefvAngle)
        
        if (
    get_pcvar_num(pInstant))
        {
            
    get_user_hitpoint(idfStart)
            
            if (
    engfunc(EngFunc_PointContentsfStart) != CONTENTS_SKY)
            {
                static 
    Float:fSize[3]
                
    pev(idpev_sizefSize)
                
                
    fOrigin[0] = fStart[0] + floatcos(fvAngle[1], degrees) * (-10.0 fSize[0])
                
    fOrigin[1] = fStart[1] + floatsin(fvAngle[1], degrees) * (-10.0 fSize[1])
                
    fOrigin[2] = fStart[2]
            }
            else
                
    xs_vec_copy(fStartfOrigin)
        }
        
        
        
    // Make the hook!
        
    Hook[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
        
        if (
    Hook[id])
        {
            
    // Player cant throw hook now
            
    canThrowHook[id] = false
            
            
    static const Float:fMins[3] = {-2.840000, -14.180000, -2.840000}
            static const 
    Float:fMaxs[3] = {2.8400000.0200002.840000}
            
            
    //Set some Data
            
    set_pev(Hook[id], pev_classname"Hook")
            
            
    engfunc(EngFunc_SetModelHook[id], "models/rpgrocket.mdl")
            
    engfunc(EngFunc_SetOriginHook[id], fOrigin)
            
    engfunc(EngFunc_SetSizeHook[id], fMinsfMaxs)        
            
            
    //set_pev(Hook[id], pev_mins, fMins)
            //set_pev(Hook[id], pev_maxs, fMaxs)
            
            
    set_pev(Hook[id], pev_anglesfAngle)
            
            
    set_pev(Hook[id], pev_solid2)
            
    set_pev(Hook[id], pev_movetype5)
            
    set_pev(Hook[id], pev_ownerid)
            
            
    //Set hook velocity
            
    static Float:fForward[3], Float:Velocity[3]
            new 
    Float:fSpeed get_pcvar_float(pThrowSpeed)
            
            
    engfunc(EngFunc_MakeVectorsfvAngle)
            
    global_get(glb_v_forwardfForward)
            
            
    Velocity[0] = fForward[0] * fSpeed
            Velocity
    [1] = fForward[1] * fSpeed
            Velocity
    [2] = fForward[2] * fSpeed
            
            set_pev
    (Hook[id], pev_velocityVelocity)
            
            
    // Make the line between Hook and Player
            
    message_begin_f(MSG_BROADCASTSVC_TEMPENTITYFloat:{0.00.00.0}, 0)
            if (
    get_pcvar_num(pInstant))
            {
                
    write_byte(1// TE_BEAMPOINT
                
    write_short(id// Startent
                
    write_coord_f(fStart[0]) // End pos
                
    write_coord_f(fStart[1])
                
    write_coord_f(fStart[2])
            }
            else
            {
                
    write_byte(8// TE_BEAMENTS
                
    write_short(id// Start Ent
                
    write_short(Hook[id]) // End Ent
            
    }
            
    write_short(sprBeam// Sprite
            
    write_byte(1// StartFrame
            
    write_byte(1// FrameRate
            
    write_byte(600// Life
            
    write_byte(get_pcvar_num(pWidth)) // Width
            
    write_byte(get_pcvar_num(pHookNoise)) // Noise
            // Colors now
            
    if (get_pcvar_num(pColor))
            {
                if (
    get_user_team(id) == 1// Terrorist
                
    {
                    
    write_byte(255// R
                    
    write_byte(0)    // G
                    
    write_byte(0)    // B
                
    }
                
    #if defined _cstrike_included
                
    else if(cs_get_user_vip(id)) // vip for cstrike
                
    {
                    
    write_byte(0)    // R
                    
    write_byte(255)    // G
                    
    write_byte(0)    // B
                
    }
                
    #endif // _cstrike_included
                
    else if(get_user_team(id) == 2// CT
                
    {
                    
    write_byte(0)    // R
                    
    write_byte(0)    // G
                    
    write_byte(255)    // B
                
    }
                else
                {
                    
    write_byte(255// R
                    
    write_byte(255// G
                    
    write_byte(255// B
                
    }
            }
            else
            {
                
    write_byte(255// R
                
    write_byte(255// G
                
    write_byte(255// B
            
    }
            
    write_byte(192// Brightness
            
    write_byte(0// Scroll speed
            
    message_end()
            
            if (
    get_pcvar_num(pSound) && !get_pcvar_num(pInstant))
                
    emit_sound(idCHAN_BODY"weapons/xbow_fire1.wav"VOL_NORMATTN_NORM0PITCH_HIGH)
            
            static 
    TaskData[2]
            
    TaskData[0] = id
            TaskData
    [1] = Hook[id]
            
            
    set_task(0.1"hookthink"id 890TaskData2"b")
        }
        else
            
    client_print(idprint_chat"Can't create hook")
    }

    public 
    remove_hook(id)
    {
        
    //Player can now throw hooks
        
    canThrowHook[id] = true
        
        
    // Remove the hook if it is valid
        
    if (pev_valid(Hook[id]))
            
    engfunc(EngFunc_RemoveEntityHook[id])
        
    Hook[id] = 0
        
        
    // Remove the line between user and hook
        
    if (is_user_connected(id))
        {
            
    message_begin(MSG_BROADCASTSVC_TEMPENTITY, {0,0,0}, id)
            
    write_byte(99// TE_KILLBEAM
            
    write_short(id// entity
            
    message_end()
        }
        
        
    // Player is not hooked anymore
        
    gHooked[id] = false
        
    return 1
    }

    public 
    give_hook(idlevelcid)
    {
        if (!
    cmd_access(id ,levelcid1))
            return 
    PLUGIN_HANDLED
        
        
    if (!get_pcvar_num(pAdmin))
        {
            
    console_print(id"[Hook] Sadece-Admin Modu Suan Kapali !")
            return 
    PLUGIN_HANDLED
        
    }
        
        static 
    szTarget[32]
        
    read_argv(1szTargetcharsmax(szTarget))
        
        new 
    iUsrId cmd_target(idszTarget)
        
        if (!
    iUsrId)
            return 
    PLUGIN_HANDLED
        
        
    static szName[32]
        
    get_user_name(iUsrIdszNamecharsmax(szName))
        
        if (!
    g_bHookAllowed[iUsrId])
        {
            
    g_bHookAllowed[iUsrId] = true
            
            console_print
    (id"[Hook] %s Adli Kisiye Hook Verdin !"szName)
        }
        else
            
    console_print(id"[Hook] %s Adli Kisi Zaten Hook'a Sahip !"szName)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    take_hook(idlevelcid)
    {
        if (!
    cmd_access(id ,levelcid1))
            return 
    PLUGIN_HANDLED
        
        
    if (!get_pcvar_num(pAdmin))
        {
            
    console_print(id"[Hook] Sadece-Admin Modu Suan Kapali !")
            return 
    PLUGIN_HANDLED
        
    }
        
        static 
    szTarget[32]
        
    read_argv(1szTargetcharsmax(szTarget))
        
        new 
    iUsrId cmd_target(idszTarget)
        
        if (!
    iUsrId)
            return 
    PLUGIN_HANDLED
        
        
    static szName[32]
        
    get_user_name(iUsrIdszNamecharsmax(szName))
        
        if (
    g_bHookAllowed[iUsrId])
        {
            
    g_bHookAllowed[iUsrId] = false
            
            console_print
    (id"[Hook] %s Adli Kisiden Hook Atma Ozelligini Aldiniz !"szName)
        }
        else
            
    console_print(id"[Hook] %s Adli Kisi Zaten Hook'a Sahip Degil !"szName)
        
        return 
    PLUGIN_HANDLED
    }

    // Stock by Chaosphere
    stock get_user_hitpoint(idFloat:hOrigin[3])
    {
        if (!
    is_user_alive(id))
            return 
    0
        
        
    static Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3]
        static 
    Float:fTemp[3]
        
        
    pev(idpev_originfOrigin)
        
    pev(idpev_v_anglefvAngle)
        
    pev(idpev_view_ofsfvOffset)
        
        
    xs_vec_add(fOriginfvOffsetfvOrigin)
        
        
    engfunc(EngFunc_AngleVectorsfvAnglefeOriginfTempfTemp)
        
        
    xs_vec_mul_scalar(feOrigin8192.0feOrigin)
        
    xs_vec_add(fvOriginfeOriginfeOrigin)
        
        static 
    tr
        engfunc
    (EngFunc_TraceLinefvOriginfeOrigin0idtr)
        
    get_tr2(trTR_vecEndPoshOrigin)
        
    //global_get(glb_trace_endpos, hOrigin)
        
        
    return 1

    Yazı tamamen kaldırıldı.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    CS:GO ve CS 1.6 için ücretli eklenti yapılır.
    Plugin yazmak isteyenlere yardımcı olabilirim.
    Skype adresimden ulaşabilirsiniz:
    destek_596
    Steam: http://steamcommunity.com/id/ca-nemesis/


  8. #8
    cavus er HijyeniK - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    May 2012
    Yer
    Denizli
    Mesajlar
    217
    Bahsedildi
    0 Mesaj
    Etiketlenmiş
    0 Konu
    Tecrübe Puanı
    9

    Standart Cevap: Adminlere özel hook her el bir kere

    Jailbreakdaki diğer hook pluginiyle çakışıyor
    rica etsem +hook kodu yerine +ag yapmanız mümkün mü ?
    bi de sadece ct de atılıyor hook t de de atılabilsin
    Konu HijyeniK tarafından (11-05-13 Saat 23:29 ) değiştirilmiştir.

    La'brigade # Gaming Bir Gün Değil Her Gün Kral !
    Cs 1.6 Server : CS.LabrigadeGaming.Com
    TeamSpeak3 Server : Ts3.LabrigadeGaming.Com
    Msn :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Facebook :
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Skype : HijyeniK


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


  9. #9
    binbaşı er Furkan Dize - ait Kullanıcı Resmi (Avatar)
    Üyelik tarihi
    Jan 2012
    Yer
    İstanbul
    Mesajlar
    537
    Bahsedildi
    11 Mesaj
    Etiketlenmiş
    0 Konu
    Tecrübe Puanı
    9

    Standart Cevap: Adminlere özel hook her el bir kere

    PHP- Kodu:
    #define ADMINLEVEL ADMIN_BAN 

    #include <amxmodx> 
    #include <amxmisc> 
    #include <fakemeta> 
    #include <cstrike> 
    #include <xs> 

    #define message_begin_f(%1,%2,%3,%4) engfunc(EngFunc_MessageBegin, %1, %2, %3, %4) 
    #define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1) 

    //Cvars 
    new pHookpThrowSpeedpSpeedpWidthpSoundpColor 
    new pInterruptpAdminpHookSkypOpenDoorspPlayers 
    new pUseButtonspHostagepWeaponspInstantpHookNoise 
    new pMaxHookspRndStartDelaypCtOnly
    // Sprite 
    new sprBeam 

    // Players hook entity 
    new Hook[33

    // MaxPlayers 
    new gMaxPlayers 

    // some booleans 
    new bool:gHooked[33
    new 
    bool:canThrowHook[33
    new 
    bool:rndStarted 

    // Player Spawn 
    new bool:gRestart[33] = {false, ...} 
    new 
    bool:gUpdate[33] = {false, ...} 

    new 
    gHooksUsed[33// Used with sv_hookmax 
    new bool:g_bHookAllowed[33// Used with sv_hookadminonly 

    public plugin_init() 

        
    register_plugin("Hook""1.5""P34nut"
         
        
    // Hook commands 
        
    register_clcmd("+ag""make_hook"
        
    register_clcmd("-ag""del_hook"
         
        
    register_concmd("amx_giveag""give_hook"ADMIN_RCON"<Username> - Give somebody access to the hook"
        
    register_concmd("amx_takeag""take_hook"ADMIN_RCON"<UserName> - Take away somebody his access to the hook"
         
        
    // Events for roundstart 
        
    register_event("HLTV""round_bstart""a""1=0""2=0"
        
    register_logevent("round_estart"2"1=Round_Start")  
         
        
    // Player spawn stuff 
        
    register_event("TextMsg""Restart""a""2=#Game_will_restart_in"
        
    register_clcmd("fullupdate""Update")  
        
    register_event("ResetHUD""ResetHUD""b"
         
        
    // Register cvars 
        
    register_cvar("sv_amxxhookmod",  "version 1.5"FCVAR_SERVER// yay public cvar 
        
    pHook =     register_cvar("sv_hook""1"
        
    pThrowSpeed =     register_cvar("sv_hookthrowspeed""4000"
        
    pSpeed =     register_cvar("sv_hookspeed""600"
        
    pWidth =     register_cvar("sv_hookwidth""16"
        
    pSound =     register_cvar("sv_hooksound""0"
        
    pColor =    register_cvar("sv_hookcolor""0"
        
    pPlayers =     register_cvar("sv_hookplayers""0"
        
    pInterrupt =     register_cvar("sv_hookinterrupt""0"
        
    pAdmin =     register_cvar("sv_hookadminonly",  "1"
        
    pHookSky =     register_cvar("sv_hooksky""1"
        
    pOpenDoors =     register_cvar("sv_hookopendoors""1"
        
    pUseButtons =     register_cvar("sv_hookusebuttons""1"
        
    pHostage =     register_cvar("sv_hookhostflollow""1"
        
    pWeapons =    register_cvar("sv_hookpickweapons""1"
        
    pInstant =    register_cvar("sv_hookinstant""1"
        
    pHookNoise =     register_cvar("sv_hooknoise""0"
        
    pMaxHooks =     register_cvar("sv_hookmax""1"
        
    pRndStartDelay register_cvar("sv_hookrndstartdelay""0.0"
         
         
        
    // Touch forward 
        
    register_forward(FM_Touch"fwTouch"
         
        
    // Get maxplayers 
        
    gMaxPlayers get_maxplayers() 


    public 
    plugin_precache() 

        
    // Hook Model 
        
    engfunc(EngFunc_PrecacheModel"models/rpgrocket.mdl"
         
        
    // Hook Beam 
        
    sprBeam engfunc(EngFunc_PrecacheModel"sprites/zbeam4.spr"
         
        
    // Hook Sounds 
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hit1.wav"// good hit 
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hit2.wav"// wrong hit 
         
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_hitbod1.wav"// player hit 
         
        
    engfunc(EngFunc_PrecacheSound"weapons/xbow_fire1.wav"// deploy 



    public 
    make_hook(id

         
        if (
    get_pcvar_num(pHook) && is_user_alive(id) && canThrowHook[id] && !gHooked[id]) {         
            if (
    get_pcvar_num(pAdmin)) 
            { 
                
    // Only the admins can throw the hook 
                // if(is_user_admin(id)) { <- does not work...         
                
    if (!(get_user_flags(id) & ADMINLEVEL) && !g_bHookAllowed[id]) 
                { 
                    
    // Show a message 
                    
    client_print(idprint_chat"[Hook] Bunu Kullanmak Icin Yetkiniz Yok"
                     
                    return 
    PLUGIN_HANDLED 
                

            } 
            new 
    iMaxHooks get_pcvar_num(pMaxHooks
            if (
    iMaxHooks 0
            { 
                if (
    gHooksUsed[id] >= iMaxHooks
                { 
                    
    client_print(idprint_chat"[Hook] Hook Limitin Doldu Artik Hook Kullanamazsin !"
                    
    //statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks)) 
                     
                    
    return PLUGIN_HANDLED 
                

                else  
                { 
                    
    gHooksUsed[id]++ 
                    
    //statusMsg(id, "[Hook] %d of %d hooks used.", gHooksUsed[id], get_pcvar_num(pMaxHooks)) 
                

            } 
            new 
    Float:fDelay get_pcvar_float(pRndStartDelay
            if (
    fDelay && !rndStarted
                
    client_print(idprint_chat"[Hook] Ilk %0.0f Saniye Boyunca Hook Kullanamazsin !"fDelay
             
            
    throw_hook(id
        } 
        return 
    PLUGIN_HANDLED 


    public 
    del_hook(id

        
    // Remove players hook 
        
    if (!canThrowHook[id]) 
            
    remove_hook(id
         
        return 
    PLUGIN_HANDLED 


    public 
    round_bstart() 

        
    // Round is not started anymore 
        
    if (rndStarted
            
    rndStarted false 
         
        
    // Remove all hooks 
        
    for (new 1<= gMaxPlayersi++) 
        { 
            if (
    is_user_connected(i)) 
            { 
                if(!
    canThrowHook[i]) 
                    
    remove_hook(i
            } 
        } 


    public 
    round_estart() 

        new 
    Float:fDelay get_pcvar_float(pRndStartDelay
        if (
    fDelay 0.0
            
    set_task(fDelay"rndStartDelay"
        else 
        { 
            
    // Round is started... 
            
    if (!rndStarted
                
    rndStarted true 
        



    public 
    rndStartDelay() 

        if (!
    rndStarted
            
    rndStarted true 


    public 
    Restart() 

        for (new 
    id 0id gMaxPlayersid++) 
        { 
            if (
    is_user_connected(id)) 
                
    gRestart[id] = true 
        



    public 
    Update(id

        if (!
    gUpdate[id]) 
            
    gUpdate[id] = true 
         
        
    return PLUGIN_CONTINUE 


    public 
    ResetHUD(id

        if (
    gRestart[id]) 
        { 
            
    gRestart[id] = false 
            
    return 
        } 
        if (
    gUpdate[id]) 
        { 
            
    gUpdate[id] = false 
            
    return 
        } 
        if (
    gHooked[id]) 
        { 
            
    remove_hook(id
        } 
        if (
    get_pcvar_num(pMaxHooks) > 0
        { 
            
    gHooksUsed[id] = 
            
    //statusMsg(0, "[Hook] 0 of %d hooks used.", get_pcvar_num(pMaxHooks)) 
        



    public 
    fwTouch(ptrptd

        if (!
    pev_valid(ptr)) 
            return 
    FMRES_IGNORED 
         
        
    new id pev(ptrpev_owner
         
        
    // Get classname 
        
    static szPtrClass[32]     
        
    pev(ptrpev_classnameszPtrClasscharsmax(szPtrClass)) 
         
        if (
    equali(szPtrClass"Hook")) 
        {         
            static 
    Float:fOrigin[3
            
    pev(ptrpev_originfOrigin
             
            if (
    pev_valid(ptd)) 
            { 
                static 
    szPtdClass[32
                
    pev(ptdpev_classnameszPtdClasscharsmax(szPtdClass)) 
                 
                if (!
    get_pcvar_num(pPlayers) && /*equali(szPtdClass, "player")*/ is_user_alive(ptd)) 
                { 
                    
    // Hit a player 
                    
    if (get_pcvar_num(pSound)) 
                        
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hitbod1.wav"1.0ATTN_NORM0PITCH_NORM
                    
    remove_hook(id
                     
                    return 
    FMRES_HANDLED 
                

                else if (
    equali(szPtdClass"hostage_entity")) 
                { 
                    
    // Makes an hostage follow 
                    
    if (get_pcvar_num(pHostage) && get_user_team(id) == 2
                    {                     
                        
    //cs_set_hostage_foll(ptd, (cs_get_hostage_foll(ptd) == id) ? 0 : id) 
                        // With the use function we have the sounds! 
                        
    dllfunc(DLLFunc_Useptdid
                    } 
                    if (!
    get_pcvar_num(pPlayers)) 
                    { 
                        if(
    get_pcvar_num(pSound)) 
                            
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hitbod1.wav"1.0ATTN_NORM0PITCH_NORM
                        
    remove_hook(id
                    } 
                    return 
    FMRES_HANDLED 
                

                else if (
    get_pcvar_num(pOpenDoors) && equali(szPtdClass"func_door") || equali(szPtdClass"func_door_rotating")) 
                { 
                    
    // Open doors 
                    // Double doors tested in de_nuke and de_wallmart 
                    
    static szTargetName[32
                    
    pev(ptdpev_targetnameszTargetNamecharsmax(szTargetName)) 
                    if (
    strlen(szTargetName) > 0
                    {     
                        static 
    ent 
                        
    while ((ent engfunc(EngFunc_FindEntityByStringent"target"szTargetName)) > 0
                        { 
                            static 
    szEntClass[32
                            
    pev(entpev_classnameszEntClasscharsmax(szEntClass)) 
                             
                            if (
    equali(szEntClass"trigger_multiple")) 
                            { 
                                
    dllfunc(DLLFunc_Touchentid
                                goto 
    stopdoors // No need to touch anymore 
                            

                        } 
                    } 
                     
                    
    // No double doors.. just touch it 
                    
    dllfunc(DLLFunc_Touchptdid
                    
    stopdoors:                 
                } 
                else if (
    get_pcvar_num(pUseButtons) && equali(szPtdClass"func_button")) 
                { 
                    if (
    pev(ptdpev_spawnflags) & SF_BUTTON_TOUCH_ONLY
                        
    dllfunc(DLLFunc_Touchptdid// Touch only 
                    
    else             
                        
    dllfunc(DLLFunc_Useptdid// Use Buttons             
                

            } 
             
            
    // If cvar sv_hooksky is 0 and hook is in the sky remove it! 
            
    new iContents engfunc(EngFunc_PointContentsfOrigin
            if (!
    get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY
            { 
                if(
    get_pcvar_num(pSound)) 
                    
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM
                
    remove_hook(id
                return 
    FMRES_HANDLED 
            

             
            
    // Pick up weapons.. 
            
    if (get_pcvar_num(pWeapons)) 
            { 
                static 
    ent 
                
    while ((ent engfunc(EngFunc_FindEntityInSphereentfOrigin15.0)) > 0
                { 
                    static 
    szentClass[32
                    
    pev(entpev_classnameszentClasscharsmax(szentClass)) 
                     
                    if (
    equali(szentClass"weaponbox") || equali(szentClass"armoury_entity")) 
                        
    dllfunc(DLLFunc_Touchentid
                } 
            } 
             
            
    // Player is now hooked 
            
    gHooked[id] = true 
            
    // Play sound 
            
    if (get_pcvar_num(pSound)) 
                
    emit_sound(ptrCHAN_STATIC"weapons/xbow_hit1.wav"1.0ATTN_NORM0PITCH_NORM
             
            
    // Make some sparks :D 
            
    message_begin_f(MSG_BROADCASTSVC_TEMPENTITYfOrigin0
            
    write_byte(9// TE_SPARKS 
            
    write_coord_f(fOrigin[0]) // Origin 
            
    write_coord_f(fOrigin[1]) 
            
    write_coord_f(fOrigin[2]) 
            
    message_end()         
             
            
    // Stop the hook from moving 
            
    set_pev(ptrpev_velocityFloat:{0.00.00.0}) 
            
    set_pev(ptrpev_movetypeMOVETYPE_NONE
             
            
    //Task 
            
    if (!task_exists(id 856)) 
            {  
                static 
    TaskData[2
                
    TaskData[0] = id 
                TaskData
    [1] = ptr 
                gotohook
    (TaskData
                 
                
    set_task(0.1"gotohook"id 856TaskData2"b"
            } 
        } 
        return 
    FMRES_HANDLED 


    public 
    hookthink(param[]) 

        new 
    id param[0
        new 
    HookEnt param[1
         
        if (!
    is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id)) 
        { 
            
    remove_task(id 890
            return 
    PLUGIN_HANDLED 
        

         
         
        static 
    Float:entOrigin[3
        
    pev(HookEntpev_originentOrigin
         
        
    // If user is behind a box or something.. remove it 
        // only works if sv_interrupt 1 or higher is 
        
    if (get_pcvar_num(pInterrupt) && rndStarted
        { 
            static 
    Float:usrOrigin[3
            
    pev(idpev_originusrOrigin
             
            static 
    tr 
            engfunc
    (EngFunc_TraceLineusrOriginentOrigin1, -1tr
             
            static 
    Float:fFraction 
            get_tr2
    (trTR_flFractionfFraction
             
            if (
    fFraction != 1.0
                
    remove_hook(id
        } 
         
        
    // If cvar sv_hooksky is 0 and hook is in the sky remove it! 
        
    new iContents engfunc(EngFunc_PointContentsentOrigin
        if (!
    get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY
        { 
            if(
    get_pcvar_num(pSound)) 
                
    emit_sound(HookEntCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM
            
    remove_hook(id
        } 
         
        return 
    PLUGIN_HANDLED 


    public 
    gotohook(param[]) 

        new 
    id param[0
        new 
    HookEnt param[1
         
        if (!
    is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id)) 
        { 
            
    remove_task(id 856
            return 
    PLUGIN_HANDLED 
        

        
    // If the round isnt started velocity is just 0 
        
    static Float:fVelocity[3
        
    fVelocity Float:{0.00.01.0
         
        
    // If the round is started and player is hooked we can set the user velocity! 
        
    if (rndStarted && gHooked[id]) 
        { 
            static 
    Float:fHookOrigin[3], Float:fUsrOrigin[3], Float:fDist 
            pev
    (HookEntpev_originfHookOrigin
            
    pev(idpev_originfUsrOrigin
             
            
    fDist vector_distance(fHookOriginfUsrOrigin
             
            if (
    fDist >= 30.0
            { 
                new 
    Float:fSpeed get_pcvar_float(pSpeed
                 
                
    fSpeed *= 0.52 
                 
                fVelocity
    [0] = (fHookOrigin[0] - fUsrOrigin[0]) * (2.0 fSpeed) / fDist 
                fVelocity
    [1] = (fHookOrigin[1] - fUsrOrigin[1]) * (2.0 fSpeed) / fDist 
                fVelocity
    [2] = (fHookOrigin[2] - fUsrOrigin[2]) * (2.0 fSpeed) / fDist 
            

        } 
        
    // Set the velocity 
        
    set_pev(idpev_velocityfVelocity
         
        return 
    PLUGIN_HANDLED 


    public 
    throw_hook(id

        
    // Get origin and angle for the hook 
        
    static Float:fOrigin[3], Float:fAngle[3],Float:fvAngle[3
        static 
    Float:fStart[3
        
    pev(idpev_originfOrigin
         
        
    pev(idpev_anglesfAngle
        
    pev(idpev_v_anglefvAngle
         
        if (
    get_pcvar_num(pInstant)) 
        { 
            
    get_user_hitpoint(idfStart
             
            if (
    engfunc(EngFunc_PointContentsfStart) != CONTENTS_SKY
            { 
                static 
    Float:fSize[3
                
    pev(idpev_sizefSize
                 
                
    fOrigin[0] = fStart[0] + floatcos(fvAngle[1], degrees) * (-10.0 fSize[0]) 
                
    fOrigin[1] = fStart[1] + floatsin(fvAngle[1], degrees) * (-10.0 fSize[1]) 
                
    fOrigin[2] = fStart[2
            } 
            else 
                
    xs_vec_copy(fStartfOrigin
        } 
         
         
        
    // Make the hook! 
        
    Hook[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 
         
        if (
    Hook[id]) 
        { 
            
    // Player cant throw hook now 
            
    canThrowHook[id] = false 
             
            
    static const Float:fMins[3] = {-2.840000, -14.180000, -2.840000
            static const 
    Float:fMaxs[3] = {2.8400000.0200002.840000
             
            
    //Set some Data 
            
    set_pev(Hook[id], pev_classname"Hook"
             
            
    engfunc(EngFunc_SetModelHook[id], "models/rpgrocket.mdl"
            
    engfunc(EngFunc_SetOriginHook[id], fOrigin
            
    engfunc(EngFunc_SetSizeHook[id], fMinsfMaxs)         
             
            
    //set_pev(Hook[id], pev_mins, fMins) 
            //set_pev(Hook[id], pev_maxs, fMaxs) 
             
            
    set_pev(Hook[id], pev_anglesfAngle
             
            
    set_pev(Hook[id], pev_solid2
            
    set_pev(Hook[id], pev_movetype5
            
    set_pev(Hook[id], pev_ownerid
             
            
    //Set hook velocity 
            
    static Float:fForward[3], Float:Velocity[3
            new 
    Float:fSpeed get_pcvar_float(pThrowSpeed
             
            
    engfunc(EngFunc_MakeVectorsfvAngle
            
    global_get(glb_v_forwardfForward
             
            
    Velocity[0] = fForward[0] * fSpeed 
            Velocity
    [1] = fForward[1] * fSpeed 
            Velocity
    [2] = fForward[2] * fSpeed 
             
            set_pev
    (Hook[id], pev_velocityVelocity
             
            
    // Make the line between Hook and Player 
            
    message_begin_f(MSG_BROADCASTSVC_TEMPENTITYFloat:{0.00.00.0}, 0
            if (
    get_pcvar_num(pInstant)) 
            { 
                
    write_byte(1// TE_BEAMPOINT 
                
    write_short(id// Startent 
                
    write_coord_f(fStart[0]) // End pos 
                
    write_coord_f(fStart[1]) 
                
    write_coord_f(fStart[2]) 
            } 
            else 
            { 
                
    write_byte(8// TE_BEAMENTS 
                
    write_short(id// Start Ent 
                
    write_short(Hook[id]) // End Ent 
            

            
    write_short(sprBeam// Sprite 
            
    write_byte(1// StartFrame 
            
    write_byte(1// FrameRate 
            
    write_byte(600// Life 
            
    write_byte(get_pcvar_num(pWidth)) // Width 
            
    write_byte(get_pcvar_num(pHookNoise)) // Noise 
            // Colors now 
            
    if (get_pcvar_num(pColor)) 
            { 
                if (
    get_user_team(id) == 1// Terrorist 
                

                    
    write_byte(255// R 
                    
    write_byte(0)    // G 
                    
    write_byte(0)    // B 
                

                
    #if defined _cstrike_included 
                
    else if(cs_get_user_vip(id)) // vip for cstrike 
                

                    
    write_byte(0)    // R 
                    
    write_byte(255)    // G 
                    
    write_byte(0)    // B 
                

                
    #endif // _cstrike_included 
                
    else if(get_user_team(id) == 2// CT 
                

                    
    write_byte(0)    // R 
                    
    write_byte(0)    // G 
                    
    write_byte(255)    // B 
                

                else 
                { 
                    
    write_byte(255// R 
                    
    write_byte(255// G 
                    
    write_byte(255// B 
                

            } 
            else 
            { 
                
    write_byte(255// R 
                
    write_byte(255// G 
                
    write_byte(255// B 
            

            
    write_byte(192// Brightness 
            
    write_byte(0// Scroll speed 
            
    message_end() 
             
            if (
    get_pcvar_num(pSound) && !get_pcvar_num(pInstant)) 
                
    emit_sound(idCHAN_BODY"weapons/xbow_fire1.wav"VOL_NORMATTN_NORM0PITCH_HIGH
             
            static 
    TaskData[2
            
    TaskData[0] = id 
            TaskData
    [1] = Hook[id
             
            
    set_task(0.1"hookthink"id 890TaskData2"b"
        } 
        else 
            
    client_print(idprint_chat"Can't create hook"


    public 
    remove_hook(id

        
    //Player can now throw hooks 
        
    canThrowHook[id] = true 
         
        
    // Remove the hook if it is valid 
        
    if (pev_valid(Hook[id])) 
            
    engfunc(EngFunc_RemoveEntityHook[id]) 
        
    Hook[id] = 
         
        
    // Remove the line between user and hook 
        
    if (is_user_connected(id)) 
        { 
            
    message_begin(MSG_BROADCASTSVC_TEMPENTITY, {0,0,0}, id
            
    write_byte(99// TE_KILLBEAM 
            
    write_short(id// entity 
            
    message_end() 
        } 
         
        
    // Player is not hooked anymore 
        
    gHooked[id] = false 
        
    return 


    public 
    give_hook(idlevelcid

        if (!
    cmd_access(id ,levelcid1)) 
            return 
    PLUGIN_HANDLED 
         
        
    if (!get_pcvar_num(pAdmin)) 
        { 
            
    console_print(id"[Hook] Sadece-Admin Modu Suan Kapali !"
            return 
    PLUGIN_HANDLED 
        

         
        static 
    szTarget[32
        
    read_argv(1szTargetcharsmax(szTarget)) 
         
        new 
    iUsrId cmd_target(idszTarget
         
        if (!
    iUsrId
            return 
    PLUGIN_HANDLED 
         
        
    static szName[32
        
    get_user_name(iUsrIdszNamecharsmax(szName)) 
         
        if (!
    g_bHookAllowed[iUsrId]) 
        { 
            
    g_bHookAllowed[iUsrId] = true 
             
            console_print
    (id"[Hook] %s Adli Kisiye Hook Verdin !"szName
        } 
        else 
            
    console_print(id"[Hook] %s Adli Kisi Zaten Hook'a Sahip !"szName
         
        return 
    PLUGIN_HANDLED 


    public 
    take_hook(idlevelcid

        if (!
    cmd_access(id ,levelcid1)) 
            return 
    PLUGIN_HANDLED 
         
        
    if (!get_pcvar_num(pAdmin)) 
        { 
            
    console_print(id"[Hook] Sadece-Admin Modu Suan Kapali !"
            return 
    PLUGIN_HANDLED 
        

         
        static 
    szTarget[32
        
    read_argv(1szTargetcharsmax(szTarget)) 
         
        new 
    iUsrId cmd_target(idszTarget
         
        if (!
    iUsrId
            return 
    PLUGIN_HANDLED 
         
        
    static szName[32
        
    get_user_name(iUsrIdszNamecharsmax(szName)) 
         
        if (
    g_bHookAllowed[iUsrId]) 
        { 
            
    g_bHookAllowed[iUsrId] = false 
             
            console_print
    (id"[Hook] %s Adli Kisiden Hook Atma Ozelligini Aldiniz !"szName
        } 
        else 
            
    console_print(id"[Hook] %s Adli Kisi Zaten Hook'a Sahip Degil !"szName
         
        return 
    PLUGIN_HANDLED 


    // Stock by Chaosphere 
    stock get_user_hitpoint(idFloat:hOrigin[3]) 

        if (!
    is_user_alive(id)) 
            return 

         
        
    static Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3
        static 
    Float:fTemp[3
         
        
    pev(idpev_originfOrigin
        
    pev(idpev_v_anglefvAngle
        
    pev(idpev_view_ofsfvOffset
         
        
    xs_vec_add(fOriginfvOffsetfvOrigin
         
        
    engfunc(EngFunc_AngleVectorsfvAnglefeOriginfTempfTemp
         
        
    xs_vec_mul_scalar(feOrigin8192.0feOrigin
        
    xs_vec_add(fvOriginfeOriginfeOrigin
         
        static 
    tr 
        engfunc
    (EngFunc_TraceLinefvOriginfeOrigin0idtr
        
    get_tr2(trTR_vecEndPoshOrigin
        
    //global_get(glb_trace_endpos, hOrigin) 
         
        
    return 

    PHP- Kodu:
        register_clcmd("+ag""make_hook"
        
    register_clcmd("-ag""del_hook"
         
        
    register_concmd("amx_giveag""give_ag"ADMIN_RCON"<Username> - Give somebody access to the hook"
        
    register_concmd("amx_takeag""take_ag"ADMIN_RCON"<UserName> - Take away somebody his access to the hook"
    olarak değiştirdim dene, haberdar et beni
    [ OSMANLI IMP # F-TIPI JAILBREAK ]
    [ İMAN AHLAK ADALET ]

    [ Pit10 ]

    -facebook-
    [
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    ]
    [
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    ]

    -diğer sosyal ağlarımız-
    [
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    ]
    [
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    ]
    [
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    ]
    [
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    ]



Benzer Konular

  1. Adminlere Özel Mermi Sekmeme Plugini
    By Schwertle in forum [PLUGİN] Cs 1.6 Eklentiler
    Cevaplar: 417
    Son Mesaj: 20-03-18, 20:18
  2. Pelerin Yapma Plugini ( Adminlere Özel )
    By NiCoMeDiA in forum [PLUGİN] Cs 1.6 Eklentiler
    Cevaplar: 206
    Son Mesaj: 16-02-15, 20:15
  3. adminlere özel model plugini
    By wolf5094 in forum Çözülmüş İstekler
    Cevaplar: 10
    Son Mesaj: 27-07-12, 08:33
  4. Adminlere ve Slotlara özel ayrı yazılar varmı ?
    By sirketclan in forum Çözülmüş İstekler
    Cevaplar: 10
    Son Mesaj: 17-01-12, 20:03

Kullanıcıların arama motorlarındaki kullandığı taglar:

Counter Strike 1.6 Cfg, plugin, eklenti, sxe, config, skin, setup
Counter Strike

Bu Konudaki Etiketler

Yetkileriniz

  • Konu Acma Yetkiniz Yok
  • Cevap Yazma Yetkiniz Yok
  • Eklenti Yükleme Yetkiniz Yok
  • Mesajınızı Değiştirme Yetkiniz Yok
  •  

SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94