MyBB, XenForo, vBulletin rakibi DiyoBB çok yakında beta süreci ile webailesi.com adresinde! Tıkla ve detayları görüntüle

sprite duvar arkasından görünmeyi kaldırma

Konu

#1
Merhaba ekteki derlemede .spr yada sprite diye tanımlanan kafada çıkan o görsel duvar arkasındanda çıkıp rakibin yerini gösteriyor bunu kaldırma şansımız varmıdır rakibin kafasında yine çıksın komple kalksın istemiyorum fakat duvar arkasından gözükmesini engellemek istiyorum lütfen yardım edermisniz.
PHP Kod:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

//#define AES_EXP

#if AMXX_VERSION_NUM < 183
    #define client_disconnected client_disconnect
    #include <colorchat>
#endif

#if defined AES_EXP
    #include <aes_main>
#endif

#define PLUGIN "Duels"
#define VERSION "0.75"
#define AUTHOR "Psycrow"

#define SOUND_DUEL_ACCEPTED         "next21_duels/duel_challenge_accepted.wav"
#define SOUND_DUEL_WIN                "next21_duels/win.wav"
#define SOUND_DUEL_LOSE                "next21_duels/lose.wav"

#define SPRITE_DUEL                    "sprites/next21_duels/duel.spr"

#define DUEL_SPRITE_DISTANCE        10.0
#define DUEL_WAITING_TIME            10.0

#define Player[%1][%2]        g_player_data[%1 - 1][%2]

enum _:Player_Properties
{
    
PlrInServer,
    
PlrIsAlive,
    
PlrTeam,
    
PlrDuelReady,
    
PlrDuelWaiting,
    
PlrDuelFrags,
    
PlrDuelSprite,
    
FloatPlrDeathReasonTime,
    
FloatPlrDuelWaitingTime
}

new
g_player_data[32][Player_Properties], g_iMaxplayersg_infoTarget,
g_forwardAddToFullPackg_forwardCheckVisibilityg_iSpriteImpulse,
#if !defined AES_EXP
    
g_cvMoney,
#endif
g_cvFragsg_cvRewardg_cvLosingg_cvCompensationg_cvSoundsFloatg_cvSpriteFloatg_cvSpriteDist

public plugin_precache()
{        
    
precache_sound(SOUND_DUEL_ACCEPTED)
    
precache_sound(SOUND_DUEL_WIN)
    
precache_sound(SOUND_DUEL_LOSE)
    
    
precache_model(SPRITE_DUEL)
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_cvar("cv_duels_frags""3")
    
register_cvar("cv_duels_reward""6000")
    
register_cvar("cv_duels_losing""3000")
    
register_cvar("cv_duels_compensation""3000")
    
register_cvar("cv_duels_sounds""1")
    
register_cvar("cv_duels_sprite""0.5")
    
register_cvar("cv_duels_sprite_dist""40.0")

    
register_clcmd("say /duelo""duel_check_players")
    
register_clcmd("say_team /duel""duel_check_players")
    
    
register_clcmd("say /cikis""unduel")
    
register_clcmd("say_team /cikis""unduel")
    
    
register_logevent("fw_RoundStart"2"1=Round_Start")
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled"1)
    
RegisterHam(Ham_Player_PreThink"player""fw_PlayerPreThink")
    
    
register_message(get_user_msgid("TeamInfo"), "fw_TeamInfo")
    
    
g_iMaxplayers get_maxplayers()
    
g_infoTarget engfunc(EngFunc_AllocString"info_target")
    
g_iSpriteImpulse engfunc(EngFunc_AllocString"next21_duelsprite")
    
    
#if !defined AES_EXP
    
register_cvar("cv_duels_maxmoney","16000")
    
#endif
    
    
register_dictionary("next21_duels.txt")
}

public 
fw_RoundStart()
{
    
g_cvFrags get_cvar_num("cv_duels_frags")
    
g_cvReward get_cvar_num("cv_duels_reward")
    
g_cvLosing get_cvar_num("cv_duels_losing")
    
g_cvCompensation get_cvar_num("cv_duels_compensation")
    
g_cvSounds get_cvar_num("cv_duels_sounds")
    
#if !defined AES_EXP
    
g_cvMoney get_cvar_num("cv_duels_maxmoney")
    
#endif
    
    
new FloatfSpriteScale floatmax(0.0get_cvar_float("cv_duels_sprite"))
        
    if (
fSpriteScale 0.0 && g_cvSprite == 0.0)
    {
        
g_forwardAddToFullPack register_forward(FM_AddToFullPack"fw_AddToFullPack" 1)
        
g_forwardCheckVisibility register_forward(FM_CheckVisibility"fw_CheckVisibility")
        
g_cvSpriteDist get_cvar_float("cv_duels_sprite_dist")
    }
    else if (
fSpriteScale == 0.0 && g_cvSprite 0.0)
    {
        for (new 
1<= g_iMaxplayersi++)
        {
            if (!
Player[i][PlrDuelSprite])
                continue
                
            
engfunc(EngFunc_RemoveEntityPlayer[i][PlrDuelSprite])
            
Player[i][PlrDuelSprite] = 0
        
}
                
        
unregister_forward(FM_AddToFullPackg_forwardAddToFullPack)
        
unregister_forward(FM_CheckVisibilityg_forwardCheckVisibility)
    }
    else if (
fSpriteScale != g_cvSprite)
    {
        for (new 
1<= g_iMaxplayersi++)
            if (
Player[i][PlrDuelSprite])
                
set_pev(Player[i][PlrDuelSprite], pev_scalefSpriteScale)
    }
    
    
g_cvSprite fSpriteScale
}

public 
client_putinserver(id)
{
    
Player[id][PlrInServer] = 1
    Player
[id][PlrIsAlive] = 0
    Player
[id][PlrTeam] = 0
}

public 
client_disconnected(id)
{
    
Player[id][PlrInServer] = 0
    Player
[id][PlrIsAlive] = 0
    Player
[id][PlrTeam] = 0
    
    
if (Player[id][PlrDuelReady] && Player[Player[id][PlrDuelReady]][PlrInServer])
    {
        
remove_duel_sprite(id)
        
remove_duel_sprite(Player[id][PlrDuelReady])
    
        if (
is_user_connected(Player[id][PlrDuelReady]))
        {
            new 
playerName[24]
            
pev(idpev_netnameplayerName23)
            
            
client_print_color(Player[id][PlrDuelReady], print_team_red"^4[%s] ^3%L",
                
PLUGINPlayer[id][PlrDuelReady], "DUEL_DISCONNECT"playerName)
            
            
compensation(Player[id][PlrDuelReady], id)
        }
        else
        {
            
Player[Player[id][PlrDuelWaiting]][PlrInServer] = 0
            Player
[Player[id][PlrDuelReady]][PlrDuelReady] = 0
            Player
[id][PlrDuelReady] = 0
        
}
    }
    
    if (
Player[id][PlrDuelWaiting] && Player[Player[id][PlrDuelWaiting]][PlrInServer])
    {    
        new 
victim Player[id][PlrDuelWaiting], playerName[24]
        
pev(idpev_netnameplayerName23)
        
client_print_color(victimprint_team_red"^4[%s] ^3%L",
            
PLUGINvictim"DUEL_DISCONNECT_W"playerName)
                
        
Player[id][PlrDuelWaiting] = 0
        Player
[victim][PlrDuelWaiting] = 0
        
        Player
[id][PlrDuelWaitingTime] = 0
        Player
[victim][PlrDuelWaitingTime] = 0
    
}
}

public 
fw_PlayerSpawn(id)
{
    if (!
is_user_alive(id))
        return 
HAM_IGNORED
        
    Player
[id][PlrTeam] = get_pdata_int(id1145)
    
Player[id][PlrIsAlive] = 1
    
    
if (Player[id][PlrDuelSprite])
        
set_pev(Player[id][PlrDuelSprite], pev_effects0)
    
    return 
HAM_IGNORED
}

public 
fw_PlayerKilled(victimattacker)
{
    
Player[victim][PlrIsAlive] = 0
    
    
if (attacker && attacker != victim)
        
set_flag_duel(attackervictim)
        
    if (
Player[victim][PlrDuelSprite])
        
set_pev(Player[victim][PlrDuelSprite], pev_effectsEF_NODRAW)
}

public 
fw_PlayerPreThink(id)
{
    if(
Player[id][PlrDuelWaiting] && Player[id][PlrDuelWaitingTime] <= get_gametime())
    {
        
Player[id][PlrDuelWaitingTime] = 0
        Player
[Player[id][PlrDuelWaiting]][PlrDuelWaitingTime] = 0
        
        client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING_TIME")
        
client_print_color(Player[id][PlrDuelWaiting], print_team_red"^4[%s] ^3%L",
            
PLUGINPlayer[id][PlrDuelWaiting], "DUEL_WAITING_TIME")
        
        
Player[Player[id][PlrDuelWaiting]][PlrDuelWaiting] = 0
        Player
[id][PlrDuelWaiting] = 0
    
}
}

public 
fw_TeamInfo()
{
    new 
id get_msg_arg_int(1)
    
    new 
team[2]
    
get_msg_arg_string(2team1)
            
    switch (
team[0])
    {
        case 
'T'Player[id][PlrTeam] = 1
        
case 'C'Player[id][PlrTeam] = 2
        
case 'S'Player[id][PlrTeam] = 3
        
default: Player[id][PlrTeam] = 0
    
}
            
    new 
victim Player[id][PlrDuelReady]
    if (
victim)
    {
        if (
Player[victim][PlrInServer])
        {
            if (
Player[id][PlrTeam] == Player[victim][PlrTeam]
                || (
Player[id][PlrTeam] != && Player[id][PlrTeam] != 2))
            {
                
remove_duel_sprite(id)
                
remove_duel_sprite(victim)
            
                
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_TEAM")
                
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_TEAM")
                
                if (
Player[id][PlrDuelFrags] < Player[victim][PlrDuelFrags])
                    
compensation(victimid)
                else if (
Player[id][PlrDuelFrags] > Player[victim][PlrDuelFrags])
                    
compensation(idvictim)
                
                
Player[id][PlrDuelFrags] = 0
                Player
[victim][PlrDuelFrags] = 0
                
                Player
[id][PlrDuelReady] = 0
                Player
[victim][PlrDuelReady] = 0
            
}        
        }
        
        
victim Player[id][PlrDuelWaiting]
        if (
victim && Player[victim][PlrInServer])    
        {
            if (
Player[id][PlrTeam] == Player[victim][PlrTeam]
                || (
Player[id][PlrTeam] != && Player[id][PlrTeam] != 2))
            {
                
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_TEAM")
                
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_TEAM")
                
                
Player[id][PlrDuelWaiting] = 0
                Player
[victim][PlrDuelWaiting] = 0
                
                Player
[id][PlrDuelWaitingTime] = 0
                Player
[victim][PlrDuelWaitingTime] = 0
            
}
        }
    }
}
    
public 
fw_AddToFullPack(es_stateeenthosthostflagsplayer)
{
    if (!
ent || player || pev_valid(ent) != || pev(entpev_impulse) != g_iSpriteImpulse)
        return 
FMRES_IGNORED
        
    
if (Player[host][PlrDuelSprite] != ent)
    {
        
set_es(es_stateES_RenderModeEF_NODRAW)
        return 
FMRES_IGNORED
    
}
            
    static 
iEnemyiEnemy Player[host][PlrDuelReady]    
    if (!
iEnemy || !Player[iEnemy][PlrIsAlive])
    {
        
set_es(es_stateES_RenderModeEF_NODRAW)
        return 
FMRES_IGNORED
    
}
                
    static 
FloatstartPosition[3],
    
FloatendPosition[3],
    
FloatfVector[3],
    
FloatfVectorNormal[3],
    
FloatfView[3],
    
FloatendCurPosition[3]
                
    
pev(iEnemypev_originendPosition)
    
endPosition[2] += g_cvSpriteDist
        
    pev
(hostpev_originstartPosition)
    
pev(hostpev_view_ofsfView)
    
xs_vec_add(startPositionfViewstartPosition)
        
    
xs_vec_sub(endPositionstartPositionfVector)
    
xs_vec_normalize(fVectorfVectorNormal)
        
    
engfunc(EngFunc_TraceLinestartPositionendPositionIGNORE_MONSTERShost0)
    
get_tr2(0TR_vecEndPosendCurPosition)
        
    
xs_vec_mul_scalar(fVectorNormal, -10.0fVector)
    
xs_vec_add(endCurPositionfVectorendCurPosition)
        
    if (
get_distance_f(startPositionendCurPosition) - get_distance_f(endPositionendCurPosition) < 100.0)
    {
        
xs_vec_mul_scalar(fVectorNormalfloatmin(100.0get_distance_f(startPositionendCurPosition)), endCurPosition)
        
xs_vec_add(startPositionendCurPositionendCurPosition)
            
        
set_es(es_stateES_Scaleget_distance_f(startPositionendCurPosition) * 0.005 g_cvSprite)
    }
    
    
set_es(es_stateES_OriginendCurPosition)

    return 
FMRES_IGNORED
}

public 
fw_CheckVisibility(ent)
{
    if (
pev(entpev_impulse) == g_iSpriteImpulse)
    {
        
forward_return(FMV_CELL1)
        return 
FMRES_SUPERCEDE
    
}
    
    return 
FMRES_IGNORED
}

public 
duel_check_players(id)
{
    if (
Player[id][PlrDuelReady])
    {
        new 
player_name[24]
        
pev(Player[id][PlrDuelReady], pev_netnameplayer_name23)
        
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_EXIST"player_name)
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_UNDUEL")
        return
    }
        
    if (
Player[id][PlrDuelWaiting])
    {
        new 
player_name[24]
        
pev(Player[id][PlrDuelWaiting], pev_netnameplayer_name23)
        
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_EXIST_W"player_name)
        return
    }
    
    if (!
Player[id][PlrTeam] || Player[id][PlrTeam] == 3)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WRONG_TEAM")
        return        
    }
    
    new 
menuName[64]
    
format(menuName63"\r%L"id"DUEL_HEADNAME")
    
    new 
Players_Menu menu_create(menuName"duel_menu_handler")
    new 
s_Name[24], s_Player[4], iEnemyTeam Player[id][PlrTeam] == 2
        
    
for(new 1<= g_iMaxplayersi++)
    { 
        if (!
Player[i][PlrInServer] || Player[i][PlrTeam] != iEnemyTeam || is_user_hltv(i))
            continue
        
        
pev(ipev_netnames_Name23)
        
num_to_str(is_Player3)
        
        if (
Player[i][PlrDuelReady] || Player[i][PlrDuelWaiting])
            
format(s_Name23"\d%s"s_Name)
        
        
menu_additem(Players_Menus_Names_Player0)
    }
    
    new 
sMenuProp[3][16]
    
format(sMenuProp[0], 15"%L"id"MENU_NEXT")
    
format(sMenuProp[1], 15"%L"id"MENU_BACK")
    
format(sMenuProp[2], 15"%L"id"MENU_EXIT")
    
    
menu_setprop(Players_MenuMPROP_NEXTNAMEsMenuProp[0])
    
menu_setprop(Players_MenuMPROP_BACKNAMEsMenuProp[1])
    
menu_setprop(Players_MenuMPROP_EXITNAMEsMenuProp[2])
    
    
menu_display(idPlayers_Menu0)
}

public 
duel_menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    if(!
Player[id][PlrTeam] || Player[id][PlrTeam] == 3)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WRONG_TEAM")
        return 
PLUGIN_HANDLED    
    
}
    
    new 
sData[6], sName[64], iAccessiCallback
    menu_item_getinfo
(menuitemiAccesssDatacharsmax(sData), sNamecharsmax(sName), iCallback)
    
    new 
key str_to_num(sData)
        
    if (!
Player[key][PlrInServer] || Player[id][PlrTeam] == Player[key][PlrTeam] || !Player[key][PlrTeam] || Player[key][PlrTeam] == 3)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_ERROR_PLAYER")
        
duel_check_players(id)
        return 
PLUGIN_HANDLED
    
}
    
    if (
Player[key][PlrDuelReady] || Player[key][PlrDuelWaiting])
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WARNING_PLAYER")
        
duel_check_players(id)
        return 
PLUGIN_HANDLED
    
}
    
    new 
enemyName[24]
    
pev(keypev_netnameenemyName23)
    
    
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING"enemyName)
    
Player[key][PlrDuelWaiting] = id
    Player
[id][PlrDuelWaiting] = key
    
    
new FloatgameTime get_gametime()
    
Player[id][PlrDuelWaitingTime] = _:(gameTime DUEL_WAITING_TIME)
    
Player[key][PlrDuelWaitingTime] = _:(gameTime DUEL_WAITING_TIME)
    
    
menu_destroy(menu)
    
    new 
menuName[120], playerName[24]
    
pev(idpev_netnameplayerName23)
    
format(menuName119"\r%L"key"DUEL_CHALLENGE"playerName)
    
    new 
duel_Menu menu_create(menuName"duel_challenge_handler")
    
    new 
strMenuItem[64]
    
format(strMenuItem63"\w%L"key"DUEL_AGREE")
    
menu_additem(duel_MenustrMenuItem"1"0)
    
format(strMenuItem63"\w%L"key"DUEL_REFUSE")
    
menu_additem(duel_MenustrMenuItem"2"0)
    
    
menu_setprop(duel_MenuMPROP_EXIT, -1)
    
menu_display(keyduel_Menu0)
    
    if(
is_user_bot(key))
        
duel_challenge_handler(keyduel_Menu0)
    
    return 
PLUGIN_CONTINUE
}

public 
duel_challenge_handler(idmenuitem)
{
    if (!
is_user_connected(id))
        return 
PLUGIN_HANDLED
    
    
new enemy Player[id][PlrDuelWaiting]
    
    if (!
enemy)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING_TIME")
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    switch(
item)
    {
        case 
0:
        {
            new 
playerName[24], enemyName[24]
            
pev(idpev_netnameplayerName23)
            
pev(enemypev_netnameenemyName23)
            
client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_PLAYER_AGREE"playerName)
            
client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_RULE"g_cvFrags)
            
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_RULE"g_cvFrags)
            
Player[enemy][PlrDuelReady] = id
            Player
[id][PlrDuelReady] = enemy
            
            
if (g_cvSounds)
            {
                
client_cmd(enemy"spk %s"SOUND_DUEL_ACCEPTED)
                
client_cmd(id"spk %s"SOUND_DUEL_ACCEPTED)
            }
            
            if (
g_cvSprite 0.0)
            {
                
create_duel_sprite(id)
                
create_duel_sprite(enemy)
            }
        }
        case 
1:
        {
            new 
playerName[24]
            
pev(idpev_netnameplayerName23)
            
client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_PLAYER_REFUSE"playerName)
        }
        default:
        {
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
        
}
    }
    
    
Player[enemy][PlrDuelWaiting] = 0
    Player
[id][PlrDuelWaiting] = 0
    
    Player
[id][PlrDuelWaitingTime] = 0
    Player
[enemy][PlrDuelWaitingTime] = 0
    
    menu_destroy
(menu)
    return 
PLUGIN_HANDLED    
}

public 
unduel(id)
{
    new 
enemy Player[id][PlrDuelReady]
    
    if(!
enemy)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_NOEXIST")
        return
    }
    
    
remove_duel_sprite(id)
    
remove_duel_sprite(enemy)
    
    new 
playerName[24]
    
pev(idpev_netnameplayerName23)
    
client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_BREAK"playerName)
    
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_BREAK_V")
    
    if(
Player[id][PlrDuelFrags] < Player[enemy][PlrDuelFrags])
    {        
        if(
g_cvLosing)
        {
            
#if defined AES_EXP
            
aes_add_player_exp(id, -g_cvLosing)
            
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_ARS_BREAK_FINE"g_cvLosing)
            
#else
            
new curMoney cs_get_user_money(id)
            new 
money curMoney g_cvLosing curMoney g_cvLosing
            cs_set_user_money
(idcurMoney money)
            
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_BREAK_FINE"money)
            
#endif
        
}
    }
    
    
compensation(enemyid)
}

set_flag_duel(attackervictim)
{        
    if(
Player[victim][PlrDuelReady] != attacker || Player[attacker][PlrDuelReady] != victim)
        return
    
    new 
attackerName[24], victimName[24]
    
pev(victimpev_netnamevictimName23)
    
pev(attackerpev_netnameattackerName23)
    
    
Player[attacker][PlrDuelFrags]++
    
    if(
Player[attacker][PlrDuelFrags] == g_cvFrags)
    {
        
remove_duel_sprite(attacker)
        
remove_duel_sprite(victim)
    
        
client_print_color(0print_team_red"^4[%s] ^3%L"PLUGINLANG_PLAYER"DUEL_WIN",
            
attackerNamevictimNameattackerNamePlayer[attacker][PlrDuelFrags], Player[victim][PlrDuelFrags])
        
        if(
g_cvReward)
        {
            
#if defined AES_EXP
            
aes_add_player_exp(attackerg_cvReward)
            
client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_AES_REWARD"g_cvReward)
            
#else
            
new curMoney cs_get_user_money(attacker)
            new 
money curMoney g_cvReward g_cvMoney g_cvMoney curMoney g_cvReward
            cs_set_user_money
(attackercurMoney money)
            
client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_REWARD"money)
            
#endif
        
}
        
        if(
g_cvLosing)
        {
            
#if defined AES_EXP
            
aes_add_player_exp(victim, -g_cvLosing)
            
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_AES_LOOSE"g_cvLosing)
            
#else
            
new curMoney cs_get_user_money(victim)
            new 
money curMoney g_cvLosing curMoney g_cvLosing
            cs_set_user_money
(victimcurMoney money)
            
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_LOOSE"money)
            
#endif
        
}
        
        if(
g_cvSounds)
        {
            
client_cmd(attacker"spk %s"SOUND_DUEL_WIN)
            
client_cmd(victim"spk %s"SOUND_DUEL_LOSE)
        }
        
        
Player[attacker][PlrDuelFrags] = 0
        Player
[victim][PlrDuelFrags] = 0
        Player
[attacker][PlrDuelReady] = 0
        Player
[victim][PlrDuelReady] = 0
        
return
    }
    
    
client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_FRAG_A",
        
g_cvFrags Player[attacker][PlrDuelFrags])
        
    
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_FRAG_V",
        
g_cvFrags Player[attacker][PlrDuelFrags])
}

compensation(const id, const victim)
{
    if(
g_cvCompensation && Player[id][PlrDuelFrags] > Player[victim][PlrDuelFrags])
    {
        
#if defined AES_EXP
        
aes_add_player_exp(idg_cvCompensation)
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_AES_COMPENSATION",
            
g_cvCompensation)
        
#else
        
new curMoney cs_get_user_money(id)
        new 
money curMoney g_cvCompensation g_cvMoney g_cvMoney curMoney g_cvCompensation
        cs_set_user_money
(idcurMoney money)
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_COMPENSATION"money)
        
#endif
    
}
    
    
Player[id][PlrDuelFrags] = 0
    Player
[victim][PlrDuelFrags] = 0
    Player
[id][PlrDuelReady] = 0
    Player
[victim][PlrDuelReady] = 0
}

create_duel_sprite(const iPlayerId)
{
    if (
Player[iPlayerId][PlrDuelSprite])
        return 
0
        
    
new iSprite engfunc(EngFunc_CreateNamedEntityg_infoTarget)
            
    if (
pev_valid(iSprite) != 2)
    {
        
Player[iPlayerId][PlrDuelSprite] = 0
        server_print
("[%s] ERROR: sprite duel entities are not initialized"PLUGIN)
        return 
1
    
}
    
    
engfunc(EngFunc_SetSizeiSpriteFloat: {-1.0, -1.0, -1.0} , Float: { 1.01.01.0 })
    
engfunc(EngFunc_SetModeliSpriteSPRITE_DUEL)
    
engfunc(EngFunc_SetOriginiSpriteFloat: {-8192.0, -8192.0, -8192.0})
    
    
set_pev(iSpritepev_effectsPlayer[iPlayerId][PlrIsAlive] ? EF_NODRAW)
    
set_pev(iSpritepev_renderfx0)
    
set_pev(iSpritepev_rendermodekRenderTransAdd)
    
set_pev(iSpritepev_renderamt255.0)
    
set_pev(iSpritepev_rendercolorFloat: {255.0255.0255.0})
    
set_pev(iSpritepev_solidSOLID_NOT)
    
set_pev(iSpritepev_movetypeMOVETYPE_PUSHSTEP)
    
set_pev(iSpritepev_impulseg_iSpriteImpulse)
    
set_pev(iSpritepev_scaleg_cvSprite)
    
    
Player[iPlayerId][PlrDuelSprite] = iSprite
    
    
return 0
}

remove_duel_sprite(const iPlayerId)
{
    if (
Player[iPlayerId][PlrDuelSprite])
    {
        
engfunc(EngFunc_RemoveEntityPlayer[iPlayerId][PlrDuelSprite])
        
Player[iPlayerId][PlrDuelSprite] = 0
    

#2
Eklentide hatalar var idi düzelttim. Bahsettiğin olayı da yaptım. Dene bakalım :
PHP Kod:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

//#define AES_EXP

#if AMXX_VERSION_NUM < 183
    #define client_disconnected client_disconnect
    #include <colorchat>
#endif

#if defined AES_EXP
    #include <aes_main>
#endif

#define PLUGIN "Duels"
#define VERSION "0.75"
#define AUTHOR "Psycrow"

#define SOUND_DUEL_ACCEPTED         "next21_duels/duel_challenge_accepted.wav"
#define SOUND_DUEL_WIN                "next21_duels/win.wav"
#define SOUND_DUEL_LOSE                "next21_duels/lose.wav"

#define SPRITE_DUEL                    "sprites/next21_duels/duel.spr"

#define DUEL_SPRITE_DISTANCE        10.0
#define DUEL_WAITING_TIME            10.0

#define Player[%1][%2]        g_player_data[%1 - 1][%2]

enum _:Player_Properties
{
    PlrInServer,
    PlrIsAlive,
    PlrTeam,
    PlrDuelReady,
    PlrDuelWaiting,
    PlrDuelFrags,
    PlrDuelSprite,
    FloatPlrDeathReasonTime,
    FloatPlrDuelWaitingTime
}

new
g_player_data[32][Player_Properties], g_iMaxplayersg_infoTarget,
g_forwardAddToFullPackg_forwardCheckVisibilityg_iSpriteImpulse,
#if !defined AES_EXP
    g_cvMoney,
#endif
g_cvFragsg_cvRewardg_cvLosingg_cvCompensationg_cvSoundsFloatg_cvSpriteFloatg_cvSpriteDist

public plugin_precache()
{
        
    precache_sound
(SOUND_DUEL_ACCEPTED)
    precache_sound(SOUND_DUEL_WIN)
    precache_sound(SOUND_DUEL_LOSE)
    
    precache_model
(SPRITE_DUEL)
}

public 
plugin_init()
{
    register_plugin(PLUGINVERSIONAUTHOR)
    
    register_cvar
("cv_duels_frags""3")
    register_cvar("cv_duels_reward""6000")
    register_cvar("cv_duels_losing""3000")
    register_cvar("cv_duels_compensation""3000")
    register_cvar("cv_duels_sounds""1")
    register_cvar("cv_duels_sprite""0.5")
    register_cvar("cv_duels_sprite_dist""40.0")

    register_clcmd("say /duelo""duel_check_players")
    register_clcmd("say_team /duel""duel_check_players")
    
    register_clcmd
("say /cikis""unduel")
    register_clcmd("say_team /cikis""unduel")
    
    register_logevent
("fw_RoundStart"2"1=Round_Start")
    
    RegisterHam
(Ham_Spawn"player""fw_PlayerSpawn"1)
    RegisterHam(Ham_Killed"player""fw_PlayerKilled"1)
    RegisterHam(Ham_Player_PreThink"player""fw_PlayerPreThink")
    
    register_message
(get_user_msgid("TeamInfo"), "fw_TeamInfo")
    
    g_iMaxplayers 
get_maxplayers()
    g_infoTarget engfunc(EngFunc_AllocString"info_target")
    g_iSpriteImpulse engfunc(EngFunc_AllocString"next21_duelsprite")
    
    
#if !defined AES_EXP
    register_cvar("cv_duels_maxmoney","16000")
    #endif
    
    register_dictionary
("next21_duels.txt")
}

public 
fw_RoundStart()
{
    g_cvFrags get_cvar_num("cv_duels_frags")
    g_cvReward get_cvar_num("cv_duels_reward")
    g_cvLosing get_cvar_num("cv_duels_losing")
    g_cvCompensation get_cvar_num("cv_duels_compensation")
    g_cvSounds get_cvar_num("cv_duels_sounds")
    #if !defined AES_EXP
    g_cvMoney get_cvar_num("cv_duels_maxmoney")
    #endif
    
    
new FloatfSpriteScale floatmax(0.0get_cvar_float("cv_duels_sprite"))
        
    
if (fSpriteScale 0.0 && g_cvSprite == 0.0)
    {
        g_forwardAddToFullPack register_forward(FM_AddToFullPack"fw_AddToFullPack" 1)
        g_forwardCheckVisibility register_forward(FM_CheckVisibility"fw_CheckVisibility")
        g_cvSpriteDist get_cvar_float("cv_duels_sprite_dist")
    }
    else if (fSpriteScale == 0.0 && g_cvSprite 0.0)
    {
        for (new 1<= g_iMaxplayersi++)
        {
            if (!Player[i][PlrDuelSprite])
                continue
                
            engfunc
(EngFunc_RemoveEntityPlayer[i][PlrDuelSprite])
            Player[i][PlrDuelSprite] = 0
        
}
                
        unregister_forward
(FM_AddToFullPackg_forwardAddToFullPack)
        unregister_forward(FM_CheckVisibilityg_forwardCheckVisibility)
    }
    else if (fSpriteScale != g_cvSprite)
    {
        for (new 1<= g_iMaxplayersi++)
            if (Player[i][PlrDuelSprite])
                set_pev(Player[i][PlrDuelSprite], pev_scalefSpriteScale)
    }
    
    g_cvSprite 
fSpriteScale
}

public 
client_putinserver(id)
{
    Player[id][PlrInServer] = 1
    Player
[id][PlrIsAlive] = 0
    Player
[id][PlrTeam] = 0
}

public 
client_disconnected(id)
{
    Player[id][PlrInServer] = 0
    Player
[id][PlrIsAlive] = 0
    Player
[id][PlrTeam] = 0
    
    
if (Player[id][PlrDuelReady] && Player[Player[id][PlrDuelReady]][PlrInServer])
    {
        remove_duel_sprite(id)
        remove_duel_sprite(Player[id][PlrDuelReady])
    
        
if (is_user_connected(Player[id][PlrDuelReady]))
        {
            new playerName[24]
            pev(idpev_netnameplayerName23)
            
            client_print_color
(Player[id][PlrDuelReady], print_team_red"^4[%s] ^3%L",
                PLUGINPlayer[id][PlrDuelReady], "DUEL_DISCONNECT"playerName)
            
            compensation
(Player[id][PlrDuelReady], id)
        }
        else
        {
            Player[Player[id][PlrDuelWaiting]][PlrInServer] = 0
            Player
[Player[id][PlrDuelReady]][PlrDuelReady] = 0
            Player
[id][PlrDuelReady] = 0
        
}
    }
    
    
if (Player[id][PlrDuelWaiting] && Player[Player[id][PlrDuelWaiting]][PlrInServer])
    {    
        
new victim Player[id][PlrDuelWaiting], playerName[24]
        pev(idpev_netnameplayerName23)
        client_print_color(victimprint_team_red"^4[%s] ^3%L",
            PLUGINvictim"DUEL_DISCONNECT_W"playerName)
                
        Player
[id][PlrDuelWaiting] = 0
        Player
[victim][PlrDuelWaiting] = 0
        
        Player
[id][PlrDuelWaitingTime] = 0.0
        Player
[victim][PlrDuelWaitingTime] = 0.0
    
}
}

public 
fw_PlayerSpawn(id)
{
    if (!is_user_alive(id))
        return HAM_IGNORED
        
    Player
[id][PlrTeam] = get_pdata_int(id1145)
    Player[id][PlrIsAlive] = 1
    
    
if (Player[id][PlrDuelSprite])
        set_pev(Player[id][PlrDuelSprite], pev_effects0)
    
    
return HAM_IGNORED
}

public 
fw_PlayerKilled(victimattacker)
{
    Player[victim][PlrIsAlive] = 0
    
    
if (attacker && attacker != victim)
        set_flag_duel(attackervictim)
        
    
if (Player[victim][PlrDuelSprite])
        set_pev(Player[victim][PlrDuelSprite], pev_effectsEF_NODRAW)
}

public 
fw_PlayerPreThink(id)
{
    if(Player[id][PlrDuelWaiting] && Player[id][PlrDuelWaitingTime] <= get_gametime())
    {
        Player[id][PlrDuelWaitingTime] = 0.0
        Player
[Player[id][PlrDuelWaiting]][PlrDuelWaitingTime] = 0.0
        
        client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING_TIME")
        client_print_color(Player[id][PlrDuelWaiting], print_team_red"^4[%s] ^3%L",
            PLUGINPlayer[id][PlrDuelWaiting], "DUEL_WAITING_TIME")
        
        Player
[Player[id][PlrDuelWaiting]][PlrDuelWaiting] = 0
        Player
[id][PlrDuelWaiting] = 0
    
}
}

public 
fw_TeamInfo()
{
    new id get_msg_arg_int(1)
    
    
new team[2]
    get_msg_arg_string(2team1)
            
    
switch (team[0])
    {
        case 'T'Player[id][PlrTeam] = 1
        
case 'C'Player[id][PlrTeam] = 2
        
case 'S'Player[id][PlrTeam] = 3
        
default: Player[id][PlrTeam] = 0
    
}
            
    
new victim Player[id][PlrDuelReady]
    if (victim)
    {
        if (Player[victim][PlrInServer])
        {
            if (Player[id][PlrTeam] == Player[victim][PlrTeam]
                || (Player[id][PlrTeam] != && Player[id][PlrTeam] != 2))
            {
                remove_duel_sprite(id)
                remove_duel_sprite(victim)
            
                client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_TEAM")
                client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_TEAM")
                
                
if (Player[id][PlrDuelFrags] < Player[victim][PlrDuelFrags])
                    compensation(victimid)
                else if (Player[id][PlrDuelFrags] > Player[victim][PlrDuelFrags])
                    compensation(idvictim)
                
                Player
[id][PlrDuelFrags] = 0
                Player
[victim][PlrDuelFrags] = 0
                
                Player
[id][PlrDuelReady] = 0
                Player
[victim][PlrDuelReady] = 0
            
}        
        
}
        
        victim 
Player[id][PlrDuelWaiting]
        if (victim && Player[victim][PlrInServer])    
        
{
            if (Player[id][PlrTeam] == Player[victim][PlrTeam]
                || (Player[id][PlrTeam] != && Player[id][PlrTeam] != 2))
            {
                client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_TEAM")
                client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_TEAM")
                
                Player
[id][PlrDuelWaiting] = 0
                Player
[victim][PlrDuelWaiting] = 0
                
                Player
[id][PlrDuelWaitingTime] = 0.0
                Player
[victim][PlrDuelWaitingTime] = 0.0
            
}
        }
    }
}
    
public fw_AddToFullPack(es_stateeenthosthostflagsplayer)
{
    if (!ent || player || pev_valid(ent) != || pev(entpev_impulse) != g_iSpriteImpulse)
        return FMRES_IGNORED
        
    
if (Player[host][PlrDuelSprite] != ent)
    {
        set_es(es_stateES_RenderModeEF_NODRAW)
        return FMRES_IGNORED
    
}
            
    
static iEnemyiEnemy Player[host][PlrDuelReady]    
    
if (!iEnemy || !Player[iEnemy][PlrIsAlive])
    {
        set_es(es_stateES_RenderModeEF_NODRAW)
        return FMRES_IGNORED
    
}
                
    
static FloatstartPosition[3],
    FloatendPosition[3],
    FloatfVector[3],
    FloatfVectorNormal[3],
    FloatfView[3],
    FloatendCurPosition[3]
                
    pev
(iEnemypev_originendPosition)
    endPosition[2] += g_cvSpriteDist
        
    pev
(hostpev_originstartPosition)
    pev(hostpev_view_ofsfView)
    xs_vec_add(startPositionfViewstartPosition)
        
    xs_vec_sub
(endPositionstartPositionfVector)
    xs_vec_normalize(fVectorfVectorNormal)
        
    engfunc
(EngFunc_TraceLinestartPositionendPositionIGNORE_MONSTERShost0)
    get_tr2(0TR_vecEndPosendCurPosition)
        
    xs_vec_mul_scalar
(fVectorNormal, -10.0fVector)
    xs_vec_add(endCurPositionfVectorendCurPosition)
        
    
if (get_distance_f(startPositionendCurPosition) - get_distance_f(endPositionendCurPosition) < 100.0)
    {
        xs_vec_mul_scalar(fVectorNormalfloatmin(100.0get_distance_f(startPositionendCurPosition)), endCurPosition)
        xs_vec_add(startPositionendCurPositionendCurPosition)
            
        set_es
(es_stateES_Scaleget_distance_f(startPositionendCurPosition) * 0.005 g_cvSprite)
    }
    
    set_es
(es_stateES_OriginendCurPosition)

    return FMRES_IGNORED
}

public 
fw_CheckVisibility(ent)
{
    if (pev(entpev_impulse) == g_iSpriteImpulse)
    {
        forward_return(FMV_CELL1)
        return FMRES_SUPERCEDE
    
}
    
    
return FMRES_IGNORED
}

public 
duel_check_players(id)
{
    if (Player[id][PlrDuelReady])
    {
        new player_name[24]
        pev(Player[id][PlrDuelReady], pev_netnameplayer_name23)
        
        client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_EXIST"player_name)
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_UNDUEL")
        return
    }
        
    
if (Player[id][PlrDuelWaiting])
    {
        new player_name[24]
        pev(Player[id][PlrDuelWaiting], pev_netnameplayer_name23)
        
        client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_EXIST_W"player_name)
        return
    }
    
    
if (!Player[id][PlrTeam] || Player[id][PlrTeam] == 3)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WRONG_TEAM")
        return        
    
}
    
    
new menuName[64]
    format(menuName63"\r%L"id"DUEL_HEADNAME")
    
    
new Players_Menu menu_create(menuName"duel_menu_handler")
    new s_Name[24], s_Player[4], iEnemyTeam Player[id][PlrTeam] == 2
        
    
for(new 1<= g_iMaxplayersi++)
    
        if (!Player[i][PlrInServer] || Player[i][PlrTeam] != iEnemyTeam || is_user_hltv(i))
            continue
        
        pev
(ipev_netnames_Name23)
        num_to_str(is_Player3)
        
        
if (Player[i][PlrDuelReady] || Player[i][PlrDuelWaiting])
            format(s_Name23"\d%s"s_Name)
        
        menu_additem
(Players_Menus_Names_Player0)
    }
    
    
new sMenuProp[3][16]
    format(sMenuProp[0], 15"%L"id"MENU_NEXT")
    format(sMenuProp[1], 15"%L"id"MENU_BACK")
    format(sMenuProp[2], 15"%L"id"MENU_EXIT")
    
    menu_setprop
(Players_MenuMPROP_NEXTNAMEsMenuProp[0])
    menu_setprop(Players_MenuMPROP_BACKNAMEsMenuProp[1])
    menu_setprop(Players_MenuMPROP_EXITNAMEsMenuProp[2])
    
    menu_display
(idPlayers_Menu0)
}

public 
duel_menu_handler(idmenuitem)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    
}
    
    
if(!Player[id][PlrTeam] || Player[id][PlrTeam] == 3)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WRONG_TEAM")
        return PLUGIN_HANDLED    
    
}
    
    
new sData[6], sName[64], iAccessiCallback
    menu_item_getinfo
(menuitemiAccesssDatacharsmax(sData), sNamecharsmax(sName), iCallback)
    
    
new key str_to_num(sData)
        
    
if (!Player[key][PlrInServer] || Player[id][PlrTeam] == Player[key][PlrTeam] || !Player[key][PlrTeam] || Player[key][PlrTeam] == 3)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_ERROR_PLAYER")
        duel_check_players(id)
        return PLUGIN_HANDLED
    
}
    
    
if (Player[key][PlrDuelReady] || Player[key][PlrDuelWaiting])
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WARNING_PLAYER")
        duel_check_players(id)
        return PLUGIN_HANDLED
    
}
    
    
new enemyName[24]
    pev(keypev_netnameenemyName23)
    
    client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING"enemyName)
    Player[key][PlrDuelWaiting] = id
    Player
[id][PlrDuelWaiting] = key
    
    
new FloatgameTime get_gametime()
    Player[id][PlrDuelWaitingTime] = _:(gameTime DUEL_WAITING_TIME)
    Player[key][PlrDuelWaitingTime] = _:(gameTime DUEL_WAITING_TIME)
    
    menu_destroy
(menu)
    
    
new menuName[120], playerName[24]
    pev(idpev_netnameplayerName23)
    format(menuName119"\r%L"key"DUEL_CHALLENGE"playerName)
    
    
new duel_Menu menu_create(menuName"duel_challenge_handler")
    
    
new strMenuItem[64]
    format(strMenuItem63"\w%L"key"DUEL_AGREE")
    menu_additem(duel_MenustrMenuItem"1"0)
    format(strMenuItem63"\w%L"key"DUEL_REFUSE")
    menu_additem(duel_MenustrMenuItem"2"0)
    
    menu_setprop
(duel_MenuMPROP_EXIT, -1)
    menu_display(keyduel_Menu0)
    
    
if(is_user_bot(key))
        duel_challenge_handler(keyduel_Menu0)
    
    
return PLUGIN_CONTINUE
}

public 
duel_challenge_handler(idmenuitem)
{
    if (!is_user_connected(id))
        return PLUGIN_HANDLED
    
    
new enemy Player[id][PlrDuelWaiting]
    
    
if (!enemy)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING_TIME")
        menu_destroy(menu)
        return PLUGIN_HANDLED
    
}
    
    
switch(item)
    {
        case 0:
        {
            new playerName[24], enemyName[24]
            pev(idpev_netnameplayerName23)
            pev(enemypev_netnameenemyName23)
            client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_PLAYER_AGREE"playerName)
            client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_RULE"g_cvFrags)
            client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_RULE"g_cvFrags)
            Player[enemy][PlrDuelReady] = id
            Player
[id][PlrDuelReady] = enemy
            
            
if (g_cvSounds)
            {
                client_cmd(enemy"spk %s"SOUND_DUEL_ACCEPTED)
                client_cmd(id"spk %s"SOUND_DUEL_ACCEPTED)
            }
            
            
if (g_cvSprite 0.0)
            {
                create_duel_sprite(id)
                create_duel_sprite(enemy)
            }
        }
        case 1:
        {
            new playerName[24]
            pev(idpev_netnameplayerName23)
            client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_PLAYER_REFUSE"playerName)
        }
        default:
        {
            menu_destroy(menu)
            return PLUGIN_HANDLED
        
}
    }
    
    Player
[enemy][PlrDuelWaiting] = 0
    Player
[id][PlrDuelWaiting] = 0
    
    Player
[id][PlrDuelWaitingTime] = 0.0
    Player
[enemy][PlrDuelWaitingTime] = 0.0
    
    menu_destroy
(menu)
    return PLUGIN_HANDLED    
}

public 
unduel(id)
{
    new enemy Player[id][PlrDuelReady]
    
    
if(!enemy)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_NOEXIST")
        return
    }
    
    remove_duel_sprite
(id)
    remove_duel_sprite(enemy)
    
    
new playerName[24]
    pev(idpev_netnameplayerName23)
    client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_BREAK"playerName)
    client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_BREAK_V")
    
    
if(Player[id][PlrDuelFrags] < Player[enemy][PlrDuelFrags])
    {        
        
if(g_cvLosing)
        {
            #if defined AES_EXP
            aes_add_player_exp(id, -g_cvLosing)
            client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_ARS_BREAK_FINE"g_cvLosing)
            #else
            new curMoney cs_get_user_money(id)
            new money curMoney g_cvLosing curMoney g_cvLosing
            cs_set_user_money
(idcurMoney money)
            client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_BREAK_FINE"money)
            #endif
        }
    }
    
    compensation
(enemyid)
}

set_flag_duel(attackervictim)
{
        
    
if(Player[victim][PlrDuelReady] != attacker || Player[attacker][PlrDuelReady] != victim)
        return
    
    
new attackerName[24], victimName[24]
    pev(victimpev_netnamevictimName23)
    pev(attackerpev_netnameattackerName23)
    
    Player
[attacker][PlrDuelFrags]++
    
    
if(Player[attacker][PlrDuelFrags] == g_cvFrags)
    {
        remove_duel_sprite(attacker)
        remove_duel_sprite(victim)
    
        client_print_color
(0print_team_red"^4[%s] ^3%L"PLUGINLANG_PLAYER"DUEL_WIN",
            attackerNamevictimNameattackerNamePlayer[attacker][PlrDuelFrags], Player[victim][PlrDuelFrags])
        
        
if(g_cvReward)
        {
            #if defined AES_EXP
            aes_add_player_exp(attackerg_cvReward)
            client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_AES_REWARD"g_cvReward)
            #else
            new curMoney cs_get_user_money(attacker)
            new money curMoney g_cvReward g_cvMoney g_cvMoney curMoney g_cvReward
            cs_set_user_money
(attackercurMoney money)
            client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_REWARD"money)
            #endif
        }
        
        
if(g_cvLosing)
        {
            #if defined AES_EXP
            aes_add_player_exp(victim, -g_cvLosing)
            client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_AES_LOOSE"g_cvLosing)
            #else
            new curMoney cs_get_user_money(victim)
            new money curMoney g_cvLosing curMoney g_cvLosing
            cs_set_user_money
(victimcurMoney money)
            client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_LOOSE"money)
            #endif
        }
        
        
if(g_cvSounds)
        {
            client_cmd(attacker"spk %s"SOUND_DUEL_WIN)
            client_cmd(victim"spk %s"SOUND_DUEL_LOSE)
        }
        
        Player
[attacker][PlrDuelFrags] = 0
        Player
[victim][PlrDuelFrags] = 0
        Player
[attacker][PlrDuelReady] = 0
        Player
[victim][PlrDuelReady] = 0
        
return
    }
    
    client_print_color
(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_FRAG_A",
        g_cvFrags Player[attacker][PlrDuelFrags])
        
    client_print_color
(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_FRAG_V",
        g_cvFrags Player[attacker][PlrDuelFrags])
}

compensation(const id, const victim)
{
    if(g_cvCompensation && Player[id][PlrDuelFrags] > Player[victim][PlrDuelFrags])
    {
        #if defined AES_EXP
        aes_add_player_exp(idg_cvCompensation)
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_AES_COMPENSATION",
            g_cvCompensation)
        #else
        new curMoney cs_get_user_money(id)
        new money curMoney g_cvCompensation g_cvMoney g_cvMoney curMoney g_cvCompensation
        cs_set_user_money
(idcurMoney money)
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_COMPENSATION"money)
        #endif
    }
    
    Player
[id][PlrDuelFrags] = 0
    Player
[victim][PlrDuelFrags] = 0
    Player
[id][PlrDuelReady] = 0
    Player
[victim][PlrDuelReady] = 0
}

create_duel_sprite(const iPlayerId)
{
    if (Player[iPlayerId][PlrDuelSprite])
        return 0
        
    
new iSprite engfunc(EngFunc_CreateNamedEntityg_infoTarget)
            
    
if (pev_valid(iSprite) != 2)
    {
        Player[iPlayerId][PlrDuelSprite] = 0
        server_print
("[%s] ERROR: sprite duel entities are not initialized"PLUGIN)
        return 1
    
}
    
    engfunc
(EngFunc_SetSizeiSpriteFloat: {-1.0, -1.0, -1.0} , Float: { 1.01.01.0 })
    engfunc(EngFunc_SetModeliSpriteSPRITE_DUEL)
    engfunc(EngFunc_SetOriginiSpriteFloat: {-8192.0, -8192.0, -8192.0})
    
    set_pev
(iSpritepev_effectsPlayer[iPlayerId][PlrIsAlive] ? EF_NODRAW)
    set_pev(iSpritepev_renderfx0)
    set_pev(iSpritepev_rendermodekRenderTransAdd)
    set_pev(iSpritepev_renderamt255.0)
    set_pev(iSpritepev_rendercolorFloat: {255.0255.0255.0})
    set_pev(iSpritepev_solidSOLID_BBOX)
    set_pev(iSpritepev_movetypeMOVETYPE_PUSHSTEP)
    set_pev(iSpritepev_impulseg_iSpriteImpulse)
    set_pev(iSpritepev_scaleg_cvSprite)
    
    Player
[iPlayerId][PlrDuelSprite] = iSprite
    
    
return 0
}

remove_duel_sprite(const iPlayerId)
{
    if (Player[iPlayerId][PlrDuelSprite])
    {
        engfunc(EngFunc_RemoveEntityPlayer[iPlayerId][PlrDuelSprite])
        Player[iPlayerId][PlrDuelSprite] = 0
    


(- Ücretli Eklenti Yaptırmak İsteyen -)
#3
(24-11-2021, 17:17)1kaanBEY Adlı Kullanıcıdan Alıntı: Merhaba ekteki derlemede .spr yada sprite diye tanımlanan kafada çıkan o görsel duvar arkasındanda çıkıp rakibin yerini gösteriyor bunu kaldırma şansımız varmıdır rakibin kafasında yine çıksın komple kalksın istemiyorum fakat duvar arkasından gözükmesini engellemek istiyorum lütfen yardım edermisniz.
PHP Kod:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

//#define AES_EXP

#if AMXX_VERSION_NUM < 183
    #define client_disconnected client_disconnect
    #include <colorchat>
#endif

#if defined AES_EXP
    #include <aes_main>
#endif

#define PLUGIN "Duels"
#define VERSION "0.75"
#define AUTHOR "Psycrow"

#define SOUND_DUEL_ACCEPTED         "next21_duels/duel_challenge_accepted.wav"
#define SOUND_DUEL_WIN                "next21_duels/win.wav"
#define SOUND_DUEL_LOSE                "next21_duels/lose.wav"

#define SPRITE_DUEL                    "sprites/next21_duels/duel.spr"

#define DUEL_SPRITE_DISTANCE        10.0
#define DUEL_WAITING_TIME            10.0

#define Player[%1][%2]        g_player_data[%1 - 1][%2]

enum _:Player_Properties
{
    
PlrInServer,
    
PlrIsAlive,
    
PlrTeam,
    
PlrDuelReady,
    
PlrDuelWaiting,
    
PlrDuelFrags,
    
PlrDuelSprite,
    
FloatPlrDeathReasonTime,
    
FloatPlrDuelWaitingTime
}

new
g_player_data[32][Player_Properties], g_iMaxplayersg_infoTarget,
g_forwardAddToFullPackg_forwardCheckVisibilityg_iSpriteImpulse,
#if !defined AES_EXP
    
g_cvMoney,
#endif
g_cvFragsg_cvRewardg_cvLosingg_cvCompensationg_cvSoundsFloatg_cvSpriteFloatg_cvSpriteDist

public plugin_precache()
{        
    
precache_sound(SOUND_DUEL_ACCEPTED)
    
precache_sound(SOUND_DUEL_WIN)
    
precache_sound(SOUND_DUEL_LOSE)
    
    
precache_model(SPRITE_DUEL)
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_cvar("cv_duels_frags""3")
    
register_cvar("cv_duels_reward""6000")
    
register_cvar("cv_duels_losing""3000")
    
register_cvar("cv_duels_compensation""3000")
    
register_cvar("cv_duels_sounds""1")
    
register_cvar("cv_duels_sprite""0.5")
    
register_cvar("cv_duels_sprite_dist""40.0")

    
register_clcmd("say /duelo""duel_check_players")
    
register_clcmd("say_team /duel""duel_check_players")
    
    
register_clcmd("say /cikis""unduel")
    
register_clcmd("say_team /cikis""unduel")
    
    
register_logevent("fw_RoundStart"2"1=Round_Start")
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled"1)
    
RegisterHam(Ham_Player_PreThink"player""fw_PlayerPreThink")
    
    
register_message(get_user_msgid("TeamInfo"), "fw_TeamInfo")
    
    
g_iMaxplayers get_maxplayers()
    
g_infoTarget engfunc(EngFunc_AllocString"info_target")
    
g_iSpriteImpulse engfunc(EngFunc_AllocString"next21_duelsprite")
    
    
#if !defined AES_EXP
    
register_cvar("cv_duels_maxmoney","16000")
    
#endif
    
    
register_dictionary("next21_duels.txt")
}

public 
fw_RoundStart()
{
    
g_cvFrags get_cvar_num("cv_duels_frags")
    
g_cvReward get_cvar_num("cv_duels_reward")
    
g_cvLosing get_cvar_num("cv_duels_losing")
    
g_cvCompensation get_cvar_num("cv_duels_compensation")
    
g_cvSounds get_cvar_num("cv_duels_sounds")
    
#if !defined AES_EXP
    
g_cvMoney get_cvar_num("cv_duels_maxmoney")
    
#endif
    
    
new FloatfSpriteScale floatmax(0.0get_cvar_float("cv_duels_sprite"))
        
    if (
fSpriteScale 0.0 && g_cvSprite == 0.0)
    {
        
g_forwardAddToFullPack register_forward(FM_AddToFullPack"fw_AddToFullPack" 1)
        
g_forwardCheckVisibility register_forward(FM_CheckVisibility"fw_CheckVisibility")
        
g_cvSpriteDist get_cvar_float("cv_duels_sprite_dist")
    }
    else if (
fSpriteScale == 0.0 && g_cvSprite 0.0)
    {
        for (new 
1<= g_iMaxplayersi++)
        {
            if (!
Player[i][PlrDuelSprite])
                continue
                
            
engfunc(EngFunc_RemoveEntityPlayer[i][PlrDuelSprite])
            
Player[i][PlrDuelSprite] = 0
        
}
                
        
unregister_forward(FM_AddToFullPackg_forwardAddToFullPack)
        
unregister_forward(FM_CheckVisibilityg_forwardCheckVisibility)
    }
    else if (
fSpriteScale != g_cvSprite)
    {
        for (new 
1<= g_iMaxplayersi++)
            if (
Player[i][PlrDuelSprite])
                
set_pev(Player[i][PlrDuelSprite], pev_scalefSpriteScale)
    }
    
    
g_cvSprite fSpriteScale
}

public 
client_putinserver(id)
{
    
Player[id][PlrInServer] = 1
    Player
[id][PlrIsAlive] = 0
    Player
[id][PlrTeam] = 0
}

public 
client_disconnected(id)
{
    
Player[id][PlrInServer] = 0
    Player
[id][PlrIsAlive] = 0
    Player
[id][PlrTeam] = 0
    
    
if (Player[id][PlrDuelReady] && Player[Player[id][PlrDuelReady]][PlrInServer])
    {
        
remove_duel_sprite(id)
        
remove_duel_sprite(Player[id][PlrDuelReady])
    
        if (
is_user_connected(Player[id][PlrDuelReady]))
        {
            new 
playerName[24]
            
pev(idpev_netnameplayerName23)
            
            
client_print_color(Player[id][PlrDuelReady], print_team_red"^4[%s] ^3%L",
                
PLUGINPlayer[id][PlrDuelReady], "DUEL_DISCONNECT"playerName)
            
            
compensation(Player[id][PlrDuelReady], id)
        }
        else
        {
            
Player[Player[id][PlrDuelWaiting]][PlrInServer] = 0
            Player
[Player[id][PlrDuelReady]][PlrDuelReady] = 0
            Player
[id][PlrDuelReady] = 0
        
}
    }
    
    if (
Player[id][PlrDuelWaiting] && Player[Player[id][PlrDuelWaiting]][PlrInServer])
    {    
        new 
victim Player[id][PlrDuelWaiting], playerName[24]
        
pev(idpev_netnameplayerName23)
        
client_print_color(victimprint_team_red"^4[%s] ^3%L",
            
PLUGINvictim"DUEL_DISCONNECT_W"playerName)
                
        
Player[id][PlrDuelWaiting] = 0
        Player
[victim][PlrDuelWaiting] = 0
        
        Player
[id][PlrDuelWaitingTime] = 0
        Player
[victim][PlrDuelWaitingTime] = 0
    
}
}

public 
fw_PlayerSpawn(id)
{
    if (!
is_user_alive(id))
        return 
HAM_IGNORED
        
    Player
[id][PlrTeam] = get_pdata_int(id1145)
    
Player[id][PlrIsAlive] = 1
    
    
if (Player[id][PlrDuelSprite])
        
set_pev(Player[id][PlrDuelSprite], pev_effects0)
    
    return 
HAM_IGNORED
}

public 
fw_PlayerKilled(victimattacker)
{
    
Player[victim][PlrIsAlive] = 0
    
    
if (attacker && attacker != victim)
        
set_flag_duel(attackervictim)
        
    if (
Player[victim][PlrDuelSprite])
        
set_pev(Player[victim][PlrDuelSprite], pev_effectsEF_NODRAW)
}

public 
fw_PlayerPreThink(id)
{
    if(
Player[id][PlrDuelWaiting] && Player[id][PlrDuelWaitingTime] <= get_gametime())
    {
        
Player[id][PlrDuelWaitingTime] = 0
        Player
[Player[id][PlrDuelWaiting]][PlrDuelWaitingTime] = 0
        
        client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING_TIME")
        
client_print_color(Player[id][PlrDuelWaiting], print_team_red"^4[%s] ^3%L",
            
PLUGINPlayer[id][PlrDuelWaiting], "DUEL_WAITING_TIME")
        
        
Player[Player[id][PlrDuelWaiting]][PlrDuelWaiting] = 0
        Player
[id][PlrDuelWaiting] = 0
    
}
}

public 
fw_TeamInfo()
{
    new 
id get_msg_arg_int(1)
    
    new 
team[2]
    
get_msg_arg_string(2team1)
            
    switch (
team[0])
    {
        case 
'T'Player[id][PlrTeam] = 1
        
case 'C'Player[id][PlrTeam] = 2
        
case 'S'Player[id][PlrTeam] = 3
        
default: Player[id][PlrTeam] = 0
    
}
            
    new 
victim Player[id][PlrDuelReady]
    if (
victim)
    {
        if (
Player[victim][PlrInServer])
        {
            if (
Player[id][PlrTeam] == Player[victim][PlrTeam]
                || (
Player[id][PlrTeam] != && Player[id][PlrTeam] != 2))
            {
                
remove_duel_sprite(id)
                
remove_duel_sprite(victim)
            
                
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_TEAM")
                
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_TEAM")
                
                if (
Player[id][PlrDuelFrags] < Player[victim][PlrDuelFrags])
                    
compensation(victimid)
                else if (
Player[id][PlrDuelFrags] > Player[victim][PlrDuelFrags])
                    
compensation(idvictim)
                
                
Player[id][PlrDuelFrags] = 0
                Player
[victim][PlrDuelFrags] = 0
                
                Player
[id][PlrDuelReady] = 0
                Player
[victim][PlrDuelReady] = 0
            
}        
        }
        
        
victim Player[id][PlrDuelWaiting]
        if (
victim && Player[victim][PlrInServer])    
        {
            if (
Player[id][PlrTeam] == Player[victim][PlrTeam]
                || (
Player[id][PlrTeam] != && Player[id][PlrTeam] != 2))
            {
                
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_TEAM")
                
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_TEAM")
                
                
Player[id][PlrDuelWaiting] = 0
                Player
[victim][PlrDuelWaiting] = 0
                
                Player
[id][PlrDuelWaitingTime] = 0
                Player
[victim][PlrDuelWaitingTime] = 0
            
}
        }
    }
}
    
public 
fw_AddToFullPack(es_stateeenthosthostflagsplayer)
{
    if (!
ent || player || pev_valid(ent) != || pev(entpev_impulse) != g_iSpriteImpulse)
        return 
FMRES_IGNORED
        
    
if (Player[host][PlrDuelSprite] != ent)
    {
        
set_es(es_stateES_RenderModeEF_NODRAW)
        return 
FMRES_IGNORED
    
}
            
    static 
iEnemyiEnemy Player[host][PlrDuelReady]    
    if (!
iEnemy || !Player[iEnemy][PlrIsAlive])
    {
        
set_es(es_stateES_RenderModeEF_NODRAW)
        return 
FMRES_IGNORED
    
}
                
    static 
FloatstartPosition[3],
    
FloatendPosition[3],
    
FloatfVector[3],
    
FloatfVectorNormal[3],
    
FloatfView[3],
    
FloatendCurPosition[3]
                
    
pev(iEnemypev_originendPosition)
    
endPosition[2] += g_cvSpriteDist
        
    pev
(hostpev_originstartPosition)
    
pev(hostpev_view_ofsfView)
    
xs_vec_add(startPositionfViewstartPosition)
        
    
xs_vec_sub(endPositionstartPositionfVector)
    
xs_vec_normalize(fVectorfVectorNormal)
        
    
engfunc(EngFunc_TraceLinestartPositionendPositionIGNORE_MONSTERShost0)
    
get_tr2(0TR_vecEndPosendCurPosition)
        
    
xs_vec_mul_scalar(fVectorNormal, -10.0fVector)
    
xs_vec_add(endCurPositionfVectorendCurPosition)
        
    if (
get_distance_f(startPositionendCurPosition) - get_distance_f(endPositionendCurPosition) < 100.0)
    {
        
xs_vec_mul_scalar(fVectorNormalfloatmin(100.0get_distance_f(startPositionendCurPosition)), endCurPosition)
        
xs_vec_add(startPositionendCurPositionendCurPosition)
            
        
set_es(es_stateES_Scaleget_distance_f(startPositionendCurPosition) * 0.005 g_cvSprite)
    }
    
    
set_es(es_stateES_OriginendCurPosition)

    return 
FMRES_IGNORED
}

public 
fw_CheckVisibility(ent)
{
    if (
pev(entpev_impulse) == g_iSpriteImpulse)
    {
        
forward_return(FMV_CELL1)
        return 
FMRES_SUPERCEDE
    
}
    
    return 
FMRES_IGNORED
}

public 
duel_check_players(id)
{
    if (
Player[id][PlrDuelReady])
    {
        new 
player_name[24]
        
pev(Player[id][PlrDuelReady], pev_netnameplayer_name23)
        
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_EXIST"player_name)
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_UNDUEL")
        return
    }
        
    if (
Player[id][PlrDuelWaiting])
    {
        new 
player_name[24]
        
pev(Player[id][PlrDuelWaiting], pev_netnameplayer_name23)
        
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_EXIST_W"player_name)
        return
    }
    
    if (!
Player[id][PlrTeam] || Player[id][PlrTeam] == 3)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WRONG_TEAM")
        return        
    }
    
    new 
menuName[64]
    
format(menuName63"\r%L"id"DUEL_HEADNAME")
    
    new 
Players_Menu menu_create(menuName"duel_menu_handler")
    new 
s_Name[24], s_Player[4], iEnemyTeam Player[id][PlrTeam] == 2
        
    
for(new 1<= g_iMaxplayersi++)
    { 
        if (!
Player[i][PlrInServer] || Player[i][PlrTeam] != iEnemyTeam || is_user_hltv(i))
            continue
        
        
pev(ipev_netnames_Name23)
        
num_to_str(is_Player3)
        
        if (
Player[i][PlrDuelReady] || Player[i][PlrDuelWaiting])
            
format(s_Name23"\d%s"s_Name)
        
        
menu_additem(Players_Menus_Names_Player0)
    }
    
    new 
sMenuProp[3][16]
    
format(sMenuProp[0], 15"%L"id"MENU_NEXT")
    
format(sMenuProp[1], 15"%L"id"MENU_BACK")
    
format(sMenuProp[2], 15"%L"id"MENU_EXIT")
    
    
menu_setprop(Players_MenuMPROP_NEXTNAMEsMenuProp[0])
    
menu_setprop(Players_MenuMPROP_BACKNAMEsMenuProp[1])
    
menu_setprop(Players_MenuMPROP_EXITNAMEsMenuProp[2])
    
    
menu_display(idPlayers_Menu0)
}

public 
duel_menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    if(!
Player[id][PlrTeam] || Player[id][PlrTeam] == 3)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WRONG_TEAM")
        return 
PLUGIN_HANDLED    
    
}
    
    new 
sData[6], sName[64], iAccessiCallback
    menu_item_getinfo
(menuitemiAccesssDatacharsmax(sData), sNamecharsmax(sName), iCallback)
    
    new 
key str_to_num(sData)
        
    if (!
Player[key][PlrInServer] || Player[id][PlrTeam] == Player[key][PlrTeam] || !Player[key][PlrTeam] || Player[key][PlrTeam] == 3)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_ERROR_PLAYER")
        
duel_check_players(id)
        return 
PLUGIN_HANDLED
    
}
    
    if (
Player[key][PlrDuelReady] || Player[key][PlrDuelWaiting])
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WARNING_PLAYER")
        
duel_check_players(id)
        return 
PLUGIN_HANDLED
    
}
    
    new 
enemyName[24]
    
pev(keypev_netnameenemyName23)
    
    
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING"enemyName)
    
Player[key][PlrDuelWaiting] = id
    Player
[id][PlrDuelWaiting] = key
    
    
new FloatgameTime get_gametime()
    
Player[id][PlrDuelWaitingTime] = _:(gameTime DUEL_WAITING_TIME)
    
Player[key][PlrDuelWaitingTime] = _:(gameTime DUEL_WAITING_TIME)
    
    
menu_destroy(menu)
    
    new 
menuName[120], playerName[24]
    
pev(idpev_netnameplayerName23)
    
format(menuName119"\r%L"key"DUEL_CHALLENGE"playerName)
    
    new 
duel_Menu menu_create(menuName"duel_challenge_handler")
    
    new 
strMenuItem[64]
    
format(strMenuItem63"\w%L"key"DUEL_AGREE")
    
menu_additem(duel_MenustrMenuItem"1"0)
    
format(strMenuItem63"\w%L"key"DUEL_REFUSE")
    
menu_additem(duel_MenustrMenuItem"2"0)
    
    
menu_setprop(duel_MenuMPROP_EXIT, -1)
    
menu_display(keyduel_Menu0)
    
    if(
is_user_bot(key))
        
duel_challenge_handler(keyduel_Menu0)
    
    return 
PLUGIN_CONTINUE
}

public 
duel_challenge_handler(idmenuitem)
{
    if (!
is_user_connected(id))
        return 
PLUGIN_HANDLED
    
    
new enemy Player[id][PlrDuelWaiting]
    
    if (!
enemy)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING_TIME")
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    switch(
item)
    {
        case 
0:
        {
            new 
playerName[24], enemyName[24]
            
pev(idpev_netnameplayerName23)
            
pev(enemypev_netnameenemyName23)
            
client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_PLAYER_AGREE"playerName)
            
client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_RULE"g_cvFrags)
            
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_RULE"g_cvFrags)
            
Player[enemy][PlrDuelReady] = id
            Player
[id][PlrDuelReady] = enemy
            
            
if (g_cvSounds)
            {
                
client_cmd(enemy"spk %s"SOUND_DUEL_ACCEPTED)
                
client_cmd(id"spk %s"SOUND_DUEL_ACCEPTED)
            }
            
            if (
g_cvSprite 0.0)
            {
                
create_duel_sprite(id)
                
create_duel_sprite(enemy)
            }
        }
        case 
1:
        {
            new 
playerName[24]
            
pev(idpev_netnameplayerName23)
            
client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_PLAYER_REFUSE"playerName)
        }
        default:
        {
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
        
}
    }
    
    
Player[enemy][PlrDuelWaiting] = 0
    Player
[id][PlrDuelWaiting] = 0
    
    Player
[id][PlrDuelWaitingTime] = 0
    Player
[enemy][PlrDuelWaitingTime] = 0
    
    menu_destroy
(menu)
    return 
PLUGIN_HANDLED    
}

public 
unduel(id)
{
    new 
enemy Player[id][PlrDuelReady]
    
    if(!
enemy)
    {
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_NOEXIST")
        return
    }
    
    
remove_duel_sprite(id)
    
remove_duel_sprite(enemy)
    
    new 
playerName[24]
    
pev(idpev_netnameplayerName23)
    
client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_BREAK"playerName)
    
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_BREAK_V")
    
    if(
Player[id][PlrDuelFrags] < Player[enemy][PlrDuelFrags])
    {        
        if(
g_cvLosing)
        {
            
#if defined AES_EXP
            
aes_add_player_exp(id, -g_cvLosing)
            
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_ARS_BREAK_FINE"g_cvLosing)
            
#else
            
new curMoney cs_get_user_money(id)
            new 
money curMoney g_cvLosing curMoney g_cvLosing
            cs_set_user_money
(idcurMoney money)
            
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_BREAK_FINE"money)
            
#endif
        
}
    }
    
    
compensation(enemyid)
}

set_flag_duel(attackervictim)
{        
    if(
Player[victim][PlrDuelReady] != attacker || Player[attacker][PlrDuelReady] != victim)
        return
    
    new 
attackerName[24], victimName[24]
    
pev(victimpev_netnamevictimName23)
    
pev(attackerpev_netnameattackerName23)
    
    
Player[attacker][PlrDuelFrags]++
    
    if(
Player[attacker][PlrDuelFrags] == g_cvFrags)
    {
        
remove_duel_sprite(attacker)
        
remove_duel_sprite(victim)
    
        
client_print_color(0print_team_red"^4[%s] ^3%L"PLUGINLANG_PLAYER"DUEL_WIN",
            
attackerNamevictimNameattackerNamePlayer[attacker][PlrDuelFrags], Player[victim][PlrDuelFrags])
        
        if(
g_cvReward)
        {
            
#if defined AES_EXP
            
aes_add_player_exp(attackerg_cvReward)
            
client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_AES_REWARD"g_cvReward)
            
#else
            
new curMoney cs_get_user_money(attacker)
            new 
money curMoney g_cvReward g_cvMoney g_cvMoney curMoney g_cvReward
            cs_set_user_money
(attackercurMoney money)
            
client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_REWARD"money)
            
#endif
        
}
        
        if(
g_cvLosing)
        {
            
#if defined AES_EXP
            
aes_add_player_exp(victim, -g_cvLosing)
            
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_AES_LOOSE"g_cvLosing)
            
#else
            
new curMoney cs_get_user_money(victim)
            new 
money curMoney g_cvLosing curMoney g_cvLosing
            cs_set_user_money
(victimcurMoney money)
            
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_LOOSE"money)
            
#endif
        
}
        
        if(
g_cvSounds)
        {
            
client_cmd(attacker"spk %s"SOUND_DUEL_WIN)
            
client_cmd(victim"spk %s"SOUND_DUEL_LOSE)
        }
        
        
Player[attacker][PlrDuelFrags] = 0
        Player
[victim][PlrDuelFrags] = 0
        Player
[attacker][PlrDuelReady] = 0
        Player
[victim][PlrDuelReady] = 0
        
return
    }
    
    
client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_FRAG_A",
        
g_cvFrags Player[attacker][PlrDuelFrags])
        
    
client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_FRAG_V",
        
g_cvFrags Player[attacker][PlrDuelFrags])
}

compensation(const id, const victim)
{
    if(
g_cvCompensation && Player[id][PlrDuelFrags] > Player[victim][PlrDuelFrags])
    {
        
#if defined AES_EXP
        
aes_add_player_exp(idg_cvCompensation)
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_AES_COMPENSATION",
            
g_cvCompensation)
        
#else
        
new curMoney cs_get_user_money(id)
        new 
money curMoney g_cvCompensation g_cvMoney g_cvMoney curMoney g_cvCompensation
        cs_set_user_money
(idcurMoney money)
        
client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_COMPENSATION"money)
        
#endif
    
}
    
    
Player[id][PlrDuelFrags] = 0
    Player
[victim][PlrDuelFrags] = 0
    Player
[id][PlrDuelReady] = 0
    Player
[victim][PlrDuelReady] = 0
}

create_duel_sprite(const iPlayerId)
{
    if (
Player[iPlayerId][PlrDuelSprite])
        return 
0
        
    
new iSprite engfunc(EngFunc_CreateNamedEntityg_infoTarget)
            
    if (
pev_valid(iSprite) != 2)
    {
        
Player[iPlayerId][PlrDuelSprite] = 0
        server_print
("[%s] ERROR: sprite duel entities are not initialized"PLUGIN)
        return 
1
    
}
    
    
engfunc(EngFunc_SetSizeiSpriteFloat: {-1.0, -1.0, -1.0} , Float: { 1.01.01.0 })
    
engfunc(EngFunc_SetModeliSpriteSPRITE_DUEL)
    
engfunc(EngFunc_SetOriginiSpriteFloat: {-8192.0, -8192.0, -8192.0})
    
    
set_pev(iSpritepev_effectsPlayer[iPlayerId][PlrIsAlive] ? EF_NODRAW)
    
set_pev(iSpritepev_renderfx0)
    
set_pev(iSpritepev_rendermodekRenderTransAdd)
    
set_pev(iSpritepev_renderamt255.0)
    
set_pev(iSpritepev_rendercolorFloat: {255.0255.0255.0})
    
set_pev(iSpritepev_solidSOLID_NOT)
    
set_pev(iSpritepev_movetypeMOVETYPE_PUSHSTEP)
    
set_pev(iSpritepev_impulseg_iSpriteImpulse)
    
set_pev(iSpritepev_scaleg_cvSprite)
    
    
Player[iPlayerId][PlrDuelSprite] = iSprite
    
    
return 0
}

remove_duel_sprite(const iPlayerId)
{
    if (
Player[iPlayerId][PlrDuelSprite])
    {
        
engfunc(EngFunc_RemoveEntityPlayer[iPlayerId][PlrDuelSprite])
        
Player[iPlayerId][PlrDuelSprite] = 0
    

çok teşekkür ederim fakat duvar arkasından hala gözüküyor
Dosya Adı: Screenshot_1.png | Dosya Boyutu: 231,71 KB | 24-11-2021, 18:30
#4
Sorun sprite dosyanızdan kaynaklı olduğunu düşünüyorum. Farklı bir sprite dosyası kullanarak dener misin ?
(- Ücretli Eklenti Yaptırmak İsteyen -)
#5
(24-11-2021, 20:18)suriyelikene Adlı Kullanıcıdan Alıntı: Sorun sprite dosyanızdan kaynaklı olduğunu düşünüyorum. Farklı bir sprite dosyası kullanarak dener misin ?
Denedim fakat duvar arkasından hertürlü gözüküyor sprite.
#6
Dene bakalım :
PHP Kod:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <xs>

//#define AES_EXP

#if AMXX_VERSION_NUM < 183
    #define client_disconnected client_disconnect
    #include <colorchat>
#endif

#if defined AES_EXP
    #include <aes_main>
#endif

#define PLUGIN "Duels"
#define VERSION "0.75"
#define AUTHOR "Psycrow"

#define SOUND_DUEL_ACCEPTED         "next21_duels/duel_challenge_accepted.wav"
#define SOUND_DUEL_WIN                "next21_duels/win.wav"
#define SOUND_DUEL_LOSE                "next21_duels/lose.wav"

#define SPRITE_DUEL                    "sprites/next21_duels/duel.spr"

#define DUEL_SPRITE_DISTANCE        10.0
#define DUEL_WAITING_TIME            10.0

#define Player[%1][%2]        g_player_data[%1 - 1][%2]

enum _:Player_Properties
{
    PlrInServer,
    PlrIsAlive,
    PlrTeam,
    PlrDuelReady,
    PlrDuelWaiting,
    PlrDuelFrags,
    PlrDuelSprite,
    FloatPlrDeathReasonTime,
    FloatPlrDuelWaitingTime
}

new
g_player_data[32][Player_Properties], g_iMaxplayersg_infoTarget,
g_forwardAddToFullPackg_forwardCheckVisibilityg_iSpriteImpulse,
#if !defined AES_EXP
    g_cvMoney,
#endif
g_cvFragsg_cvRewardg_cvLosingg_cvCompensationg_cvSoundsFloatg_cvSpriteFloatg_cvSpriteDist

public plugin_precache()
{
        
    precache_sound
(SOUND_DUEL_ACCEPTED)
    precache_sound(SOUND_DUEL_WIN)
    precache_sound(SOUND_DUEL_LOSE)
    
    precache_model
(SPRITE_DUEL)
}

public 
plugin_init()
{
    register_plugin(PLUGINVERSIONAUTHOR)
    
    register_cvar
("cv_duels_frags""3")
    register_cvar("cv_duels_reward""6000")
    register_cvar("cv_duels_losing""3000")
    register_cvar("cv_duels_compensation""3000")
    register_cvar("cv_duels_sounds""1")
    register_cvar("cv_duels_sprite""0.5")
    register_cvar("cv_duels_sprite_dist""40.0")

    register_clcmd("say /duelo""duel_check_players")
    register_clcmd("say_team /duel""duel_check_players")
    
    register_clcmd
("say /cikis""unduel")
    register_clcmd("say_team /cikis""unduel")
    
    register_logevent
("fw_RoundStart"2"1=Round_Start")
    
    RegisterHam
(Ham_Spawn"player""fw_PlayerSpawn"1)
    RegisterHam(Ham_Killed"player""fw_PlayerKilled"1)
    RegisterHam(Ham_Player_PreThink"player""fw_PlayerPreThink")
    
    register_message
(get_user_msgid("TeamInfo"), "fw_TeamInfo")
    
    g_iMaxplayers 
get_maxplayers()
    g_infoTarget engfunc(EngFunc_AllocString"info_target")
    g_iSpriteImpulse engfunc(EngFunc_AllocString"next21_duelsprite")
    
    
#if !defined AES_EXP
    register_cvar("cv_duels_maxmoney","16000")
    #endif
    
    register_dictionary
("next21_duels.txt")
}

public 
fw_RoundStart()
{
    g_cvFrags get_cvar_num("cv_duels_frags")
    g_cvReward get_cvar_num("cv_duels_reward")
    g_cvLosing get_cvar_num("cv_duels_losing")
    g_cvCompensation get_cvar_num("cv_duels_compensation")
    g_cvSounds get_cvar_num("cv_duels_sounds")
    #if !defined AES_EXP
    g_cvMoney get_cvar_num("cv_duels_maxmoney")
    #endif
    
    
new FloatfSpriteScale floatmax(0.0get_cvar_float("cv_duels_sprite"))
        
    
if (fSpriteScale 0.0 && g_cvSprite == 0.0)
    {
        g_forwardAddToFullPack register_forward(FM_AddToFullPack"fw_AddToFullPack" 1)
        g_forwardCheckVisibility register_forward(FM_CheckVisibility"fw_CheckVisibility")
        g_cvSpriteDist get_cvar_float("cv_duels_sprite_dist")
    }
    else if (fSpriteScale == 0.0 && g_cvSprite 0.0)
    {
        for (new 1<= g_iMaxplayersi++)
        {
            if (!Player[i][PlrDuelSprite])
                continue
                
            engfunc
(EngFunc_RemoveEntityPlayer[i][PlrDuelSprite])
            Player[i][PlrDuelSprite] = 0
        
}
                
        unregister_forward
(FM_AddToFullPackg_forwardAddToFullPack)
        unregister_forward(FM_CheckVisibilityg_forwardCheckVisibility)
    }
    else if (fSpriteScale != g_cvSprite)
    {
        for (new 1<= g_iMaxplayersi++)
            if (Player[i][PlrDuelSprite])
                set_pev(Player[i][PlrDuelSprite], pev_scalefSpriteScale)
    }
    
    g_cvSprite 
fSpriteScale
}

public 
client_putinserver(id)
{
    Player[id][PlrInServer] = 1
    Player
[id][PlrIsAlive] = 0
    Player
[id][PlrTeam] = 0
}

public 
client_disconnected(id)
{
    Player[id][PlrInServer] = 0
    Player
[id][PlrIsAlive] = 0
    Player
[id][PlrTeam] = 0
    
    
if (Player[id][PlrDuelReady] && Player[Player[id][PlrDuelReady]][PlrInServer])
    {
        remove_duel_sprite(id)
        remove_duel_sprite(Player[id][PlrDuelReady])
    
        
if (is_user_connected(Player[id][PlrDuelReady]))
        {
            new playerName[24]
            pev(idpev_netnameplayerName23)
            
            client_print_color
(Player[id][PlrDuelReady], print_team_red"^4[%s] ^3%L",
                PLUGINPlayer[id][PlrDuelReady], "DUEL_DISCONNECT"playerName)
            
            compensation
(Player[id][PlrDuelReady], id)
        }
        else
        {
            Player[Player[id][PlrDuelWaiting]][PlrInServer] = 0
            Player
[Player[id][PlrDuelReady]][PlrDuelReady] = 0
            Player
[id][PlrDuelReady] = 0
        
}
    }
    
    
if (Player[id][PlrDuelWaiting] && Player[Player[id][PlrDuelWaiting]][PlrInServer])
    {    
        
new victim Player[id][PlrDuelWaiting], playerName[24]
        pev(idpev_netnameplayerName23)
        client_print_color(victimprint_team_red"^4[%s] ^3%L",
            PLUGINvictim"DUEL_DISCONNECT_W"playerName)
                
        Player
[id][PlrDuelWaiting] = 0
        Player
[victim][PlrDuelWaiting] = 0
        
        Player
[id][PlrDuelWaitingTime] = 0.0
        Player
[victim][PlrDuelWaitingTime] = 0.0
    
}
}

public 
fw_PlayerSpawn(id)
{
    if (!is_user_alive(id))
        return HAM_IGNORED
        
    Player
[id][PlrTeam] = get_pdata_int(id1145)
    Player[id][PlrIsAlive] = 1
    
    
if (Player[id][PlrDuelSprite])
        set_pev(Player[id][PlrDuelSprite], pev_effects0)
    
    
return HAM_IGNORED
}

public 
fw_PlayerKilled(victimattacker)
{
    Player[victim][PlrIsAlive] = 0
    
    
if (attacker && attacker != victim)
        set_flag_duel(attackervictim)
        
    
if (Player[victim][PlrDuelSprite])
        set_pev(Player[victim][PlrDuelSprite], pev_effectsEF_NODRAW)
}

public 
fw_PlayerPreThink(id)
{
    if(Player[id][PlrDuelWaiting] && Player[id][PlrDuelWaitingTime] <= get_gametime())
    {
        Player[id][PlrDuelWaitingTime] = 0.0
        Player
[Player[id][PlrDuelWaiting]][PlrDuelWaitingTime] = 0.0
        
        client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING_TIME")
        client_print_color(Player[id][PlrDuelWaiting], print_team_red"^4[%s] ^3%L",
            PLUGINPlayer[id][PlrDuelWaiting], "DUEL_WAITING_TIME")
        
        Player
[Player[id][PlrDuelWaiting]][PlrDuelWaiting] = 0
        Player
[id][PlrDuelWaiting] = 0
    
}
}

public 
fw_TeamInfo()
{
    new id get_msg_arg_int(1)
    
    
new team[2]
    get_msg_arg_string(2team1)
            
    
switch (team[0])
    {
        case 'T'Player[id][PlrTeam] = 1
        
case 'C'Player[id][PlrTeam] = 2
        
case 'S'Player[id][PlrTeam] = 3
        
default: Player[id][PlrTeam] = 0
    
}
            
    
new victim Player[id][PlrDuelReady]
    if (victim)
    {
        if (Player[victim][PlrInServer])
        {
            if (Player[id][PlrTeam] == Player[victim][PlrTeam]
                || (Player[id][PlrTeam] != && Player[id][PlrTeam] != 2))
            {
                remove_duel_sprite(id)
                remove_duel_sprite(victim)
            
                client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_TEAM")
                client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_TEAM")
                
                
if (Player[id][PlrDuelFrags] < Player[victim][PlrDuelFrags])
                    compensation(victimid)
                else if (Player[id][PlrDuelFrags] > Player[victim][PlrDuelFrags])
                    compensation(idvictim)
                
                Player
[id][PlrDuelFrags] = 0
                Player
[victim][PlrDuelFrags] = 0
                
                Player
[id][PlrDuelReady] = 0
                Player
[victim][PlrDuelReady] = 0
            
}        
        
}
        
        victim 
Player[id][PlrDuelWaiting]
        if (victim && Player[victim][PlrInServer])    
        
{
            if (Player[id][PlrTeam] == Player[victim][PlrTeam]
                || (Player[id][PlrTeam] != && Player[id][PlrTeam] != 2))
            {
                client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_TEAM")
                client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_TEAM")
                
                Player
[id][PlrDuelWaiting] = 0
                Player
[victim][PlrDuelWaiting] = 0
                
                Player
[id][PlrDuelWaitingTime] = 0.0
                Player
[victim][PlrDuelWaitingTime] = 0.0
            
}
        }
    }
}
    
public fw_AddToFullPack(es_stateeenthosthostflagsplayer)
{
    if (!ent || player || pev_valid(ent) != || pev(entpev_impulse) != g_iSpriteImpulse)
        return FMRES_IGNORED
        
    
if (Player[host][PlrDuelSprite] != ent)
    {
        set_es(es_stateES_RenderModeEF_NODRAW)
        return FMRES_IGNORED
    
}
            
    
static iEnemyiEnemy Player[host][PlrDuelReady]    
    
if (!iEnemy || !Player[iEnemy][PlrIsAlive])
    {
        set_es(es_stateES_RenderModeEF_NODRAW)
        return FMRES_IGNORED
    
}
                
    
static FloatstartPosition[3],
    FloatendPosition[3],
    FloatfVector[3],
    FloatfVectorNormal[3],
    FloatfView[3],
    FloatendCurPosition[3]
                
    pev
(iEnemypev_originendPosition)
    endPosition[2] += g_cvSpriteDist
        
    pev
(hostpev_originstartPosition)
    pev(hostpev_view_ofsfView)
    xs_vec_add(startPositionfViewstartPosition)
        
    xs_vec_sub
(endPositionstartPositionfVector)
    xs_vec_normalize(fVectorfVectorNormal)
        
    engfunc
(EngFunc_TraceLinestartPositionendPositionIGNORE_MONSTERShost0)
    get_tr2(0TR_vecEndPosendCurPosition)
        
    xs_vec_mul_scalar
(fVectorNormal, -10.0fVector)
    xs_vec_add(endCurPositionfVectorendCurPosition)
        
    
if (get_distance_f(startPositionendCurPosition) - get_distance_f(endPositionendCurPosition) < 100.0)
    {
        xs_vec_mul_scalar(fVectorNormalfloatmin(100.0get_distance_f(startPositionendCurPosition)), endCurPosition)
        xs_vec_add(startPositionendCurPositionendCurPosition)
            
        set_es
(es_stateES_Scaleget_distance_f(startPositionendCurPosition) * 0.005 g_cvSprite)
    }
    
    set_es
(es_stateES_OriginendCurPosition)

    return FMRES_IGNORED
}

public 
fw_CheckVisibility(ent)
{
    if (pev(entpev_impulse) == g_iSpriteImpulse)
    {
        forward_return(FMV_CELL1)
        return FMRES_SUPERCEDE
    
}
    
    
return FMRES_IGNORED
}

public 
duel_check_players(id)
{
    if (Player[id][PlrDuelReady])
    {
        new player_name[24]
        pev(Player[id][PlrDuelReady], pev_netnameplayer_name23)
        
        client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_EXIST"player_name)
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_UNDUEL")
        return
    }
        
    
if (Player[id][PlrDuelWaiting])
    {
        new player_name[24]
        pev(Player[id][PlrDuelWaiting], pev_netnameplayer_name23)
        
        client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_EXIST_W"player_name)
        return
    }
    
    
if (!Player[id][PlrTeam] || Player[id][PlrTeam] == 3)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WRONG_TEAM")
        return        
    
}
    
    
new menuName[64]
    format(menuName63"\r%L"id"DUEL_HEADNAME")
    
    
new Players_Menu menu_create(menuName"duel_menu_handler")
    new s_Name[24], s_Player[4], iEnemyTeam Player[id][PlrTeam] == 2
        
    
for(new 1<= g_iMaxplayersi++)
    
        if (!Player[i][PlrInServer] || Player[i][PlrTeam] != iEnemyTeam || is_user_hltv(i))
            continue
        
        pev
(ipev_netnames_Name23)
        num_to_str(is_Player3)
        
        
if (Player[i][PlrDuelReady] || Player[i][PlrDuelWaiting])
            format(s_Name23"\d%s"s_Name)
        
        menu_additem
(Players_Menus_Names_Player0)
    }
    
    
new sMenuProp[3][16]
    format(sMenuProp[0], 15"%L"id"MENU_NEXT")
    format(sMenuProp[1], 15"%L"id"MENU_BACK")
    format(sMenuProp[2], 15"%L"id"MENU_EXIT")
    
    menu_setprop
(Players_MenuMPROP_NEXTNAMEsMenuProp[0])
    menu_setprop(Players_MenuMPROP_BACKNAMEsMenuProp[1])
    menu_setprop(Players_MenuMPROP_EXITNAMEsMenuProp[2])
    
    menu_display
(idPlayers_Menu0)
}

public 
duel_menu_handler(idmenuitem)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    
}
    
    
if(!Player[id][PlrTeam] || Player[id][PlrTeam] == 3)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WRONG_TEAM")
        return PLUGIN_HANDLED    
    
}
    
    
new sData[6], sName[64], iAccessiCallback
    menu_item_getinfo
(menuitemiAccesssDatacharsmax(sData), sNamecharsmax(sName), iCallback)
    
    
new key str_to_num(sData)
        
    
if (!Player[key][PlrInServer] || Player[id][PlrTeam] == Player[key][PlrTeam] || !Player[key][PlrTeam] || Player[key][PlrTeam] == 3)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_ERROR_PLAYER")
        duel_check_players(id)
        return PLUGIN_HANDLED
    
}
    
    
if (Player[key][PlrDuelReady] || Player[key][PlrDuelWaiting])
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WARNING_PLAYER")
        duel_check_players(id)
        return PLUGIN_HANDLED
    
}
    
    
new enemyName[24]
    pev(keypev_netnameenemyName23)
    
    client_print_color
(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING"enemyName)
    Player[key][PlrDuelWaiting] = id
    Player
[id][PlrDuelWaiting] = key
    
    
new FloatgameTime get_gametime()
    Player[id][PlrDuelWaitingTime] = _:(gameTime DUEL_WAITING_TIME)
    Player[key][PlrDuelWaitingTime] = _:(gameTime DUEL_WAITING_TIME)
    
    menu_destroy
(menu)
    
    
new menuName[120], playerName[24]
    pev(idpev_netnameplayerName23)
    format(menuName119"\r%L"key"DUEL_CHALLENGE"playerName)
    
    
new duel_Menu menu_create(menuName"duel_challenge_handler")
    
    
new strMenuItem[64]
    format(strMenuItem63"\w%L"key"DUEL_AGREE")
    menu_additem(duel_MenustrMenuItem"1"0)
    format(strMenuItem63"\w%L"key"DUEL_REFUSE")
    menu_additem(duel_MenustrMenuItem"2"0)
    
    menu_setprop
(duel_MenuMPROP_EXIT, -1)
    menu_display(keyduel_Menu0)
    
    
if(is_user_bot(key))
        duel_challenge_handler(keyduel_Menu0)
    
    
return PLUGIN_CONTINUE
}

public 
duel_challenge_handler(idmenuitem)
{
    if (!is_user_connected(id))
        return PLUGIN_HANDLED
    
    
new enemy Player[id][PlrDuelWaiting]
    
    
if (!enemy)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_WAITING_TIME")
        menu_destroy(menu)
        return PLUGIN_HANDLED
    
}
    
    
switch(item)
    {
        case 0:
        {
            new playerName[24], enemyName[24]
            pev(idpev_netnameplayerName23)
            pev(enemypev_netnameenemyName23)
            client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_PLAYER_AGREE"playerName)
            client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_RULE"g_cvFrags)
            client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_RULE"g_cvFrags)
            Player[enemy][PlrDuelReady] = id
            Player
[id][PlrDuelReady] = enemy
            
            
if (g_cvSounds)
            {
                client_cmd(enemy"spk %s"SOUND_DUEL_ACCEPTED)
                client_cmd(id"spk %s"SOUND_DUEL_ACCEPTED)
            }
            
            
if (g_cvSprite 0.0)
            {
                create_duel_sprite(id)
                create_duel_sprite(enemy)
            }
        }
        case 1:
        {
            new playerName[24]
            pev(idpev_netnameplayerName23)
            client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_PLAYER_REFUSE"playerName)
        }
        default:
        {
            menu_destroy(menu)
            return PLUGIN_HANDLED
        
}
    }
    
    Player
[enemy][PlrDuelWaiting] = 0
    Player
[id][PlrDuelWaiting] = 0
    
    Player
[id][PlrDuelWaitingTime] = 0.0
    Player
[enemy][PlrDuelWaitingTime] = 0.0
    
    menu_destroy
(menu)
    return PLUGIN_HANDLED    
}

public 
unduel(id)
{
    new enemy Player[id][PlrDuelReady]
    
    
if(!enemy)
    {
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_NOEXIST")
        return
    }
    
    remove_duel_sprite
(id)
    remove_duel_sprite(enemy)
    
    
new playerName[24]
    pev(idpev_netnameplayerName23)
    client_print_color(enemyprint_team_red"^4[%s] ^3%L"PLUGINenemy"DUEL_BREAK"playerName)
    client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_BREAK_V")
    
    
if(Player[id][PlrDuelFrags] < Player[enemy][PlrDuelFrags])
    {        
        
if(g_cvLosing)
        {
            #if defined AES_EXP
            aes_add_player_exp(id, -g_cvLosing)
            client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_ARS_BREAK_FINE"g_cvLosing)
            #else
            new curMoney cs_get_user_money(id)
            new money curMoney g_cvLosing curMoney g_cvLosing
            cs_set_user_money
(idcurMoney money)
            client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_BREAK_FINE"money)
            #endif
        }
    }
    
    compensation
(enemyid)
}

set_flag_duel(attackervictim)
{
        
    
if(Player[victim][PlrDuelReady] != attacker || Player[attacker][PlrDuelReady] != victim)
        return
    
    
new attackerName[24], victimName[24]
    pev(victimpev_netnamevictimName23)
    pev(attackerpev_netnameattackerName23)
    
    Player
[attacker][PlrDuelFrags]++
    
    
if(Player[attacker][PlrDuelFrags] == g_cvFrags)
    {
        remove_duel_sprite(attacker)
        remove_duel_sprite(victim)
    
        client_print_color
(0print_team_red"^4[%s] ^3%L"PLUGINLANG_PLAYER"DUEL_WIN",
            attackerNamevictimNameattackerNamePlayer[attacker][PlrDuelFrags], Player[victim][PlrDuelFrags])
        
        
if(g_cvReward)
        {
            #if defined AES_EXP
            aes_add_player_exp(attackerg_cvReward)
            client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_AES_REWARD"g_cvReward)
            #else
            new curMoney cs_get_user_money(attacker)
            new money curMoney g_cvReward g_cvMoney g_cvMoney curMoney g_cvReward
            cs_set_user_money
(attackercurMoney money)
            client_print_color(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_REWARD"money)
            #endif
        }
        
        
if(g_cvLosing)
        {
            #if defined AES_EXP
            aes_add_player_exp(victim, -g_cvLosing)
            client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_AES_LOOSE"g_cvLosing)
            #else
            new curMoney cs_get_user_money(victim)
            new money curMoney g_cvLosing curMoney g_cvLosing
            cs_set_user_money
(victimcurMoney money)
            client_print_color(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_LOOSE"money)
            #endif
        }
        
        
if(g_cvSounds)
        {
            client_cmd(attacker"spk %s"SOUND_DUEL_WIN)
            client_cmd(victim"spk %s"SOUND_DUEL_LOSE)
        }
        
        Player
[attacker][PlrDuelFrags] = 0
        Player
[victim][PlrDuelFrags] = 0
        Player
[attacker][PlrDuelReady] = 0
        Player
[victim][PlrDuelReady] = 0
        
return
    }
    
    client_print_color
(attackerprint_team_red"^4[%s] ^3%L"PLUGINattacker"DUEL_FRAG_A",
        g_cvFrags Player[attacker][PlrDuelFrags])
        
    client_print_color
(victimprint_team_red"^4[%s] ^3%L"PLUGINvictim"DUEL_FRAG_V",
        g_cvFrags Player[attacker][PlrDuelFrags])
}

compensation(const id, const victim)
{
    if(g_cvCompensation && Player[id][PlrDuelFrags] > Player[victim][PlrDuelFrags])
    {
        #if defined AES_EXP
        aes_add_player_exp(idg_cvCompensation)
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_AES_COMPENSATION",
            g_cvCompensation)
        #else
        new curMoney cs_get_user_money(id)
        new money curMoney g_cvCompensation g_cvMoney g_cvMoney curMoney g_cvCompensation
        cs_set_user_money
(idcurMoney money)
        client_print_color(idprint_team_red"^4[%s] ^3%L"PLUGINid"DUEL_COMPENSATION"money)
        #endif
    }
    
    Player
[id][PlrDuelFrags] = 0
    Player
[victim][PlrDuelFrags] = 0
    Player
[id][PlrDuelReady] = 0
    Player
[victim][PlrDuelReady] = 0
}

create_duel_sprite(const iPlayerId)
{
    if (Player[iPlayerId][PlrDuelSprite])
        return 0
        
    
new iSprite engfunc(EngFunc_CreateNamedEntityg_infoTarget)
            
    
if (pev_valid(iSprite) != 2)
    {
        Player[iPlayerId][PlrDuelSprite] = 0
        server_print
("[%s] ERROR: sprite duel entities are not initialized"PLUGIN)
        return 1
    
}
    
    engfunc
(EngFunc_SetSizeiSpriteFloat: {-1.0, -1.0, -1.0} , Float: { 1.01.01.0 })
    engfunc(EngFunc_SetModeliSpriteSPRITE_DUEL)
    engfunc(EngFunc_SetOriginiSpriteFloat: {-8192.0, -8192.0, -8192.0})
    
    set_pev
(iSpritepev_effectsPlayer[iPlayerId][PlrIsAlive] ? EF_NODRAW)
    set_pev(iSpritepev_renderfx0)
    set_pev(iSpritepev_rendermodekRenderTransAlpha)
    set_pev(iSpritepev_renderamt255.0)
    set_pev(iSpritepev_rendercolorFloat: {255.0255.0255.0})
    set_pev(iSpritepev_solidSOLID_BBOX)
    set_pev(iSpritepev_movetypeMOVETYPE_PUSHSTEP)
    set_pev(iSpritepev_impulseg_iSpriteImpulse)
    set_pev(iSpritepev_scaleg_cvSprite)
    
    Player
[iPlayerId][PlrDuelSprite] = iSprite
    
    
return 0
}

remove_duel_sprite(const iPlayerId)
{
    if (Player[iPlayerId][PlrDuelSprite])
    {
        engfunc(EngFunc_RemoveEntityPlayer[iPlayerId][PlrDuelSprite])
        Player[iPlayerId][PlrDuelSprite] = 0
    


(- Ücretli Eklenti Yaptırmak İsteyen -)
#7
İstek konusu, @suriyelikene adlı kullanıcı tarafından 3 gün içinde çözülmüştür.
İsteği çözdüğü için suriyelikene Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
suriyelikene Adlı kullanıcı sizin dışınızda toplam 785 kişiye yardım etmiştir.

Herhangi bir konuda hata olduğunu düşünüyorsanız destek sistemi üzerinden iletişim kurabilirsiniz.

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Benzer Konular

8
Yorum
599
Okunma
14-06-2022, 15:26
4
Yorum
606
Okunma
13-06-2022, 00:40
2
Yorum
1.502
Okunma
03-05-2022, 03:59
3
Yorum
1.818
Okunma
18-04-2022, 19:56
4
Yorum
2.675
Okunma
16-03-2022, 10:51
Task
Kayıt Ol
Discord Adresimize Katılın