⭐🚀 TkyNET | Blacklist ve Profesyonel DDoS Korumalı TeamSpeak 3 Sunucuları 🚀⭐
Sponsor Görsel
🇹🇷 TR Lokasyon | 🛡️ Gelişmiş DDoS Koruması | ⚡ Düşük Ping | 🎧 Kesintisiz TS3 | Hostlar
Sponsor Görsel 2
SponsorSponsor

Ping Yerine Assists Yazan Eklentinin Hasar Düzenlemesi

Konu

#1
Ping yerine Assits sayısının yazan bı eklentı buldum fakat 1 hasar bıle assıts olarak kabul edıyor. Düzenlemeye yardım etmek ısteyen var ıse kodlar bunlar
Kod:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <dhudmessage>

const TASK_ARGUMENTS = 100

new g_maxplayers, g_connected[33], g_offset[33][2], g_argping[33][3]
new assists[33]

new bool:plugin = true
new rs

new damage2[33][33] //damage[Attacker][Victim]
public plugin_init()
{
    register_plugin("Assists", "2.1", "RuleBreaker")
    g_maxplayers = get_maxplayers()
    register_clcmd("say /rs", "resetscore")
    register_clcmd("say /resetscore", "resetscore")
    register_clcmd("amx_assists", "plugin_assists", ADMIN_RCON)
    register_event("TextMsg", "Event_Restart", "a", "2&#Game_C", "2&#Game_w")
    rs = register_cvar("assists_rs", "0")
    register_forward(FM_UpdateClientData, "fw_UpdateClientData")
    // Calculate weird argument values regularly in case we are faking ping fluctuations or a multiple of the real ping
    set_task(2.0, "calculate_arguments", TASK_ARGUMENTS, _, _, "b")
    
    RegisterHam(Ham_TakeDamage, "player", "fw_takedamage")
    RegisterHam(Ham_Killed, "player", "Ham_Killed_player")
    RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1) 
    set_task(1.0, "deletedmg")

}
public Event_Restart() {
    new i=0
    do {
        assists[i]=0
        i+=1
    } while(i<33)
}
public plugin_assists(id) {
    if(plugin) {
        plugin=false
        client_print(id, print_console, "[AMXX] Plugin Assists is turned off!")
        return PLUGIN_HANDLED
    }
    else if (!plugin) {
        plugin = true
        client_print(id, print_console, "[AMXX] Plugin Assists is turned on!")
        return PLUGIN_HANDLED
    }
    return PLUGIN_CONTINUE
}
public Ham_Killed_player(iVictim, iAttacker, shouldgib) {
    new i=0
    do {
        if(i!=iAttacker) {
            if(damage2[i][iVictim]>30) {
                assist(i, iVictim)
            }
        }
        i+=1
    } while (i<33)
    
}
public assist(attacker, victim) {
    damage2[attacker][victim]=0
    assists[attacker]+=1
    set_hudmessage(0, 255, 0, 0.79, 0.24, 0, 6.0, 12.0)
    show_hudmessage(attacker, "+Assist")
}
public fwHamPlayerSpawnPost(iPlayer) {
    new i=0
    do {
        damage2[iPlayer][i]=0
        i+=1
    } while(i<33)
}
public fw_takedamage(victim, inflictor, attacker, Float:damage, bits) {
      damage2[attacker][victim]+=damage

public deletedmg(id) {
    new i1 = 0
    do {
        new i2=0
        do {
            if(damage2[i1][i2]>0) {
                damage2[i1][i2]-=1
            }
            i2+=1
        } while (i2<33)
        i1+=1
    } while (i1<33)
    set_task(1.0, "deletedmg")
}
public resetscore(id) {
    if(get_pcvar_num(rs)) {
        assists[id]=0
    }
    return PLUGIN_CONTINUE
}
public client_putinserver(id)
{
    g_connected[id] = true
    assists[id]+=0
}

public client_disconnect(id)
{
    g_connected[id] = false
    assists[id]=0
    new i=0
    do {
        damage2[id][i]=0
        i+=1
    } while(i<33)
}

public fw_UpdateClientData(id)
{
    if(plugin) {
    // Scoreboard key being pressed?
    if (!(pev(id, pev_button) & IN_SCORE) && !(pev(id, pev_oldbuttons) & IN_SCORE))
        return;
    
    // Send fake player's pings
    static player, sending
    sending = 0
    for (player = 1; player <= g_maxplayers; player++)
    {
        // Player not in game?
        if (!g_connected[player])
             continue;
        
        // Send message with the weird arguments
        switch (sending)
        {
            case 0:
            {
                // Start a new message
                message_begin(MSG_ONE_UNRELIABLE, SVC_PINGS, _, id)
                write_byte((g_offset[player][0] * 64) + (1 + 2 * (player - 1)))
                write_short(g_argping[player][0])
                sending++
            }
            case 1:
            {
                // Append additional data
                write_byte((g_offset[player][1] * 128) + (2 + 4 * (player - 1)))
                write_short(g_argping[player][1])
                sending++
            }
            case 2:
            {
                // Append additional data and end message
                write_byte((4 + 8 * (player - 1)))
                write_short(g_argping[player][2])
                write_byte(0)
                message_end()
                sending = 0
            }
        }
    }
    
    // End message if not yet sent
    if (sending)
    {
        write_byte(0)
        message_end()
    }
    }
}


// Calculate weird argument values based on target ping
public calculate_arguments()
{
    static player, ping
    for (player = 1; player <= g_maxplayers; player++)
    {
        ping = assists[player]
        
        // First argument's ping
        for (g_offset[player][0] = 0; g_offset[player][0] < 4; g_offset[player][0]++)
        {
            if ((ping - g_offset[player][0]) % 4 == 0)
            {
                g_argping[player][0] = (ping - g_offset[player][0]) / 4
                break;
            }
        }
        // Second argument's ping
        for (g_offset[player][1] = 0; g_offset[player][1] < 2; g_offset[player][1]++)
        {
            if ((ping - g_offset[player][1]) % 2 == 0)
            {
                g_argping[player][1] = (ping - g_offset[player][1]) / 2
                break;
            }
        }
        // Third argument's ping
        g_argping[player][2] = ping
    }
}


Güncel++

güncel++
Son Düzenleme: 20-06-2021, 16:59, Düzenleyen: ertgrlars.
#2
PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

const TASK_ARGUMENTS 100

new g_maxplayersg_connected[33], g_offset[33][2], g_argping[33][3]
new 
assists[33]

new 
bool:plugin true
new rs

new damage2[33][33//damage[Attacker][Victim]
public plugin_init()
{
    register_plugin("Assists""2.1""RuleBreaker")
    g_maxplayers get_maxplayers()
    register_clcmd("say /rs""resetscore")
    register_clcmd("say /resetscore""resetscore")
    register_clcmd("amx_assists""plugin_assists"ADMIN_RCON)
    register_event("TextMsg""Event_Restart""a""2&#Game_C""2&#Game_w")
    rs register_cvar("assists_rs""0")
    register_forward(FM_UpdateClientData"fw_UpdateClientData")
    // Calculate weird argument values regularly in case we are faking ping fluctuations or a multiple of the real ping
    set_task(2.0"calculate_arguments"TASK_ARGUMENTS__"b")
    
    RegisterHam
(Ham_TakeDamage"player""fw_takedamage")
    RegisterHam(Ham_Killed"player""Ham_Killed_player")
    RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1
    set_task(1.0"deletedmg")

}
public 
Event_Restart() {
    new i=0
    
do {
        assists[i]=0
        i
+=1
    
} while(i<33)
}
public 
plugin_assists(id) {
    if(plugin) {
        plugin=false
        client_print
(idprint_console"[AMXX] Plugin Assists is turned off!")
        return PLUGIN_HANDLED
    
}
    else if (!plugin) {
        plugin true
        client_print
(idprint_console"[AMXX] Plugin Assists is turned on!")
        return PLUGIN_HANDLED
    
}
    return PLUGIN_CONTINUE
}
public 
Ham_Killed_player(iVictimiAttackershouldgib) {
    new i=0
    
do {
        if(i!=iAttacker) {
            if(damage2[i][iVictim]>30) {
                assist(iiVictim)
            }
        }
        i+=1
    
} while (i<33)
    
}
public 
assist(attackervictim) {
    damage2[attacker][victim]=0
    assists
[attacker]+=1
    set_hudmessage
(025500.790.2406.012.0)
    show_hudmessage(attacker"+Assist")
}
public 
fwHamPlayerSpawnPost(iPlayer) {
    new i=0
    
do {
        damage2[iPlayer][i]=0
        i
+=1
    
} while(i<33)
}
public 
fw_takedamage(victiminflictorattackerFloat:damagebits) {
      damage2[attacker][victim]+=damage

public 
deletedmg(id) {
    new i1 0
    
do {
        new i2=0
        
do {
            if(damage2[i1][i2]>0) {
                damage2[i1][i2]-=1
            
}
            i2+=1
        
} while (i2<33)
        i1+=1
    
} while (i1<33)
    set_task(1.0"deletedmg")
}
public 
resetscore(id) {
    if(get_pcvar_num(rs)) {
        assists[id]=0
    
}
    return PLUGIN_CONTINUE
}
public 
client_putinserver(id)
{
    g_connected[id] = true
    assists
[id]+=0
}

public 
client_disconnected(id)
{
    g_connected[id] = false
    assists
[id]=0
    
new i=0
    
do {
        damage2[id][i]=0
        i
+=1
    
} while(i<33)
}

public 
fw_UpdateClientData(id)
{
    if(plugin) {
    // Scoreboard key being pressed?
    if (!(pev(idpev_button) & IN_SCORE) && !(pev(idpev_oldbuttons) & IN_SCORE))
        return;
    
    
// Send fake player's pings
    static playersending
    sending 
0
    
for (player 1player <= g_maxplayersplayer++)
    {
        // Player not in game?
        if (!g_connected[player])
             continue;
        
        
// Send message with the weird arguments
        switch (sending)
        {
            case 0:
            {
                // Start a new message
                message_begin(MSG_ONE_UNRELIABLESVC_PINGS_id)
                write_byte((g_offset[player][0] * 64) + (* (player 1)))
                write_short(g_argping[player][0])
                sending++
            }
            case 1:
            {
                // Append additional data
                write_byte((g_offset[player][1] * 128) + (* (player 1)))
                write_short(g_argping[player][1])
                sending++
            }
            case 2:
            {
                // Append additional data and end message
                write_byte((* (player 1)))
                write_short(g_argping[player][2])
                write_byte(0)
                message_end()
                sending 0
            
}
        }
    }
    
    
// End message if not yet sent
    if (sending)
    {
        write_byte(0)
        message_end()
    }
    }
}


// Calculate weird argument values based on target ping
public calculate_arguments()
{
    static playerping
    
for (player 1player <= g_maxplayersplayer++)
    {
        ping assists[player]
        
        
// First argument's ping
        for (g_offset[player][0] = 0g_offset[player][0] < 4g_offset[player][0]++)
        {
            if ((ping g_offset[player][0]) % == 0)
            {
                g_argping[player][0] = (ping g_offset[player][0]) / 4
                
break;
            }
        }
        // Second argument's ping
        for (g_offset[player][1] = 0g_offset[player][1] < 2g_offset[player][1]++)
        {
            if ((ping g_offset[player][1]) % == 0)
            {
                g_argping[player][1] = (ping g_offset[player][1]) / 2
                
break;
            }
        }
        // Third argument's ping
        g_argping[player][2] = ping
    
}

58. Satırda,
Kod:
if(damage2[i][iVictim]>30) {
30 yazan yeri değiştirip deneyin.
#3
(21-06-2021, 19:51)suriyelikene Adlı Kullanıcıdan Alıntı:
PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

const TASK_ARGUMENTS 100

new g_maxplayersg_connected[33], g_offset[33][2], g_argping[33][3]
new 
assists[33]

new 
bool:plugin true
new rs

new damage2[33][33//damage[Attacker][Victim]
public plugin_init()
{
    register_plugin("Assists""2.1""RuleBreaker")
    g_maxplayers get_maxplayers()
    register_clcmd("say /rs""resetscore")
    register_clcmd("say /resetscore""resetscore")
    register_clcmd("amx_assists""plugin_assists"ADMIN_RCON)
    register_event("TextMsg""Event_Restart""a""2&#Game_C""2&#Game_w")
    rs register_cvar("assists_rs""0")
    register_forward(FM_UpdateClientData"fw_UpdateClientData")
    // Calculate weird argument values regularly in case we are faking ping fluctuations or a multiple of the real ping
    set_task(2.0"calculate_arguments"TASK_ARGUMENTS__"b")
    
    RegisterHam
(Ham_TakeDamage"player""fw_takedamage")
    RegisterHam(Ham_Killed"player""Ham_Killed_player")
    RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1
    set_task(1.0"deletedmg")

}
public 
Event_Restart() {
    new i=0
    
do {
        assists[i]=0
        i
+=1
    
} while(i<33)
}
public 
plugin_assists(id) {
    if(plugin) {
        plugin=false
        client_print
(idprint_console"[AMXX] Plugin Assists is turned off!")
        return PLUGIN_HANDLED
    
}
    else if (!plugin) {
        plugin true
        client_print
(idprint_console"[AMXX] Plugin Assists is turned on!")
        return PLUGIN_HANDLED
    
}
    return PLUGIN_CONTINUE
}
public 
Ham_Killed_player(iVictimiAttackershouldgib) {
    new i=0
    
do {
        if(i!=iAttacker) {
            if(damage2[i][iVictim]>30) {
                assist(iiVictim)
            }
        }
        i+=1
    
} while (i<33)
    
}
public 
assist(attackervictim) {
    damage2[attacker][victim]=0
    assists
[attacker]+=1
    set_hudmessage
(025500.790.2406.012.0)
    show_hudmessage(attacker"+Assist")
}
public 
fwHamPlayerSpawnPost(iPlayer) {
    new i=0
    
do {
        damage2[iPlayer][i]=0
        i
+=1
    
} while(i<33)
}
public 
fw_takedamage(victiminflictorattackerFloat:damagebits) {
      damage2[attacker][victim]+=damage

public 
deletedmg(id) {
    new i1 0
    
do {
        new i2=0
        
do {
            if(damage2[i1][i2]>0) {
                damage2[i1][i2]-=1
            
}
            i2+=1
        
} while (i2<33)
        i1+=1
    
} while (i1<33)
    set_task(1.0"deletedmg")
}
public 
resetscore(id) {
    if(get_pcvar_num(rs)) {
        assists[id]=0
    
}
    return PLUGIN_CONTINUE
}
public 
client_putinserver(id)
{
    g_connected[id] = true
    assists
[id]+=0
}

public 
client_disconnected(id)
{
    g_connected[id] = false
    assists
[id]=0
    
new i=0
    
do {
        damage2[id][i]=0
        i
+=1
    
} while(i<33)
}

public 
fw_UpdateClientData(id)
{
    if(plugin) {
    // Scoreboard key being pressed?
    if (!(pev(idpev_button) & IN_SCORE) && !(pev(idpev_oldbuttons) & IN_SCORE))
        return;
    
    
// Send fake player's pings
    static playersending
    sending 
0
    
for (player 1player <= g_maxplayersplayer++)
    {
        // Player not in game?
        if (!g_connected[player])
             continue;
        
        
// Send message with the weird arguments
        switch (sending)
        {
            case 0:
            {
                // Start a new message
                message_begin(MSG_ONE_UNRELIABLESVC_PINGS_id)
                write_byte((g_offset[player][0] * 64) + (* (player 1)))
                write_short(g_argping[player][0])
                sending++
            }
            case 1:
            {
                // Append additional data
                write_byte((g_offset[player][1] * 128) + (* (player 1)))
                write_short(g_argping[player][1])
                sending++
            }
            case 2:
            {
                // Append additional data and end message
                write_byte((* (player 1)))
                write_short(g_argping[player][2])
                write_byte(0)
                message_end()
                sending 0
            
}
        }
    }
    
    
// End message if not yet sent
    if (sending)
    {
        write_byte(0)
        message_end()
    }
    }
}


// Calculate weird argument values based on target ping
public calculate_arguments()
{
    static playerping
    
for (player 1player <= g_maxplayersplayer++)
    {
        ping assists[player]
        
        
// First argument's ping
        for (g_offset[player][0] = 0g_offset[player][0] < 4g_offset[player][0]++)
        {
            if ((ping g_offset[player][0]) % == 0)
            {
                g_argping[player][0] = (ping g_offset[player][0]) / 4
                
break;
            }
        }
        // Second argument's ping
        for (g_offset[player][1] = 0g_offset[player][1] < 2g_offset[player][1]++)
        {
            if ((ping g_offset[player][1]) % == 0)
            {
                g_argping[player][1] = (ping g_offset[player][1]) / 2
                
break;
            }
        }
        // Third argument's ping
        g_argping[player][2] = ping
    
}

58. Satırda,
Kod:
if(damage2[i][iVictim]>30) {
30 yazan yeri değiştirip deneyin.
denedim olmadı
#4
Onun dışında eklentide sorgu göremiyorum.
PHP Kod:
amx_cvar assists_rs 0 
Bu cvar ayarını 1 yapıp dene bakalım.
#5
İstek konusu, @"suriyelikene" adlı kullanıcı tarafından 1 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 567 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
Task