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

No text say is written on non-zoom shots below 10 meters


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Erra
Member
Join Date: Jun 2021
Old 10-23-2021 , 09:16   No text say is written on non-zoom shots below 10 meters
Reply With Quote #1

Hello I want this encoding not to work below 10 meters pls help me pls

Code:
#include <amxmodx>
#include <reapi>

native crxranks_set_user_xp(index, amount);
native crxranks_get_user_xp(amount);

new const TAG[32] = ""
new avad

public plugin_init(){
    register_plugin("No Scope", "1.1", "erra")

    register_event("DeathMsg" , "eaDeath" , "a")

    avad = register_cvar("ea_odul","5") // 0: Kapali - Diger sayilar odul miktari
}

public eaDeath(){
    new killer = read_data(1)
    new victim = read_data(2)
    
    if (victim == killer) return; 

    new hs = read_data(3)

    new vdistance[3], kdistance[3]
    new iDistance

    get_user_origin(victim, vdistance)
    get_user_origin(killer, kdistance)

    iDistance = get_distance(vdistance, kdistance)

    new szWeapon[20]; read_data(4,szWeapon,charsmax(szWeapon));
    if(equali(szWeapon,"awp") || equali(szWeapon,"g3sg1") || equali(szWeapon,"scout") || equali(szWeapon,"sg550")) {
        new killern[33],victimn[33]; get_user_name(killer,killern,charsmax(killern)); get_user_name(victim,victimn,charsmax(victimn))
        
        if (get_member(killer,m_iLastZoom) == 90) {
            if(hs) client_print_color(0,0,"^4%s ^3%s ^1adli oyuncu ^3%0.0f ^1m uzakliktan ^3Zoomsuz Kafadan ^1vurdu.", TAG, killern, float(iDistance) * 0.0254, victimn, szWeapon[0]);
            else client_print_color(0,0,"^4%s ^3%s ^1adli oyuncu ^3%0.0f ^1m uzakliktan ^3Zoomsuz ^1vurdu.", TAG, killern, iDistance * 0.0254, victimn, szWeapon[0]);
                if(iDistance >= 9) {
                new avadd = get_pcvar_num(avad);
                crxranks_set_user_xp(killer, crxranks_get_user_xp(killer) + avadd);
                client_print_color(killer, killer, "^4%i XP: ^1Zoomsuz vurusunuzdan dolayi odulunuz.", avadd);
            }
        }
    }
}
Erra is offline
Erra
Member
Join Date: Jun 2021
Old 12-11-2021 , 08:04   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #2

Help pls
Erra is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-11-2021 , 13:57   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #3

Code:
iDistance = get_distance(vdistance, kdistance)

=>

Code:
iDistance = get_distance(vdistance, kdistance) if(iDistance < 10) return;
__________________

Last edited by OciXCrom; 12-11-2021 at 13:58.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Erra
Member
Join Date: Jun 2021
Old 12-11-2021 , 14:03   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Code:
iDistance = get_distance(vdistance, kdistance)

=>

Code:
iDistance = get_distance(vdistance, kdistance) if(iDistance < 10) return;
can you please compile this for me i have insufficient code knowledge please
Erra is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-11-2021 , 14:24   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #5

Compiling plugins does not require any coding knowledge.

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Erra
Member
Join Date: Jun 2021
Old 12-11-2021 , 14:32   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Compiling plugins does not require any coding knowledge.

sorry for my english Can you revise the code for me?

I couldn't integrate the place you mentioned into the code
Erra is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-11-2021 , 14:35   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #7

Simply replace what I told you to replace. There's nothing complicated about copy/pasting. You're not even trying.

PHP Code:
#include <amxmodx>
#include <reapi>

native crxranks_set_user_xp(indexamount);
native crxranks_get_user_xp(amount);

new const 
TAG[32] = ""
new avad

public plugin_init(){
    
register_plugin("No Scope""1.1""erra")

    
register_event("DeathMsg" "eaDeath" "a")

    
avad register_cvar("ea_odul","5"// 0: Kapali - Diger sayilar odul miktari
}

public 
eaDeath(){
    new 
killer read_data(1)
    new 
victim read_data(2)
    
    if (
victim == killer) return; 

    new 
hs read_data(3)

    new 
vdistance[3], kdistance[3]
    new 
iDistance

    get_user_origin
(victimvdistance)
    
get_user_origin(killerkdistance)

    
iDistance get_distance(vdistancekdistance)

    if(
iDistance 10) return;

    new 
szWeapon[20]; read_data(4,szWeapon,charsmax(szWeapon));
    if(
equali(szWeapon,"awp") || equali(szWeapon,"g3sg1") || equali(szWeapon,"scout") || equali(szWeapon,"sg550")) {
        new 
killern[33],victimn[33]; get_user_name(killer,killern,charsmax(killern)); get_user_name(victim,victimn,charsmax(victimn))
        
        if (
get_member(killer,m_iLastZoom) == 90) {
            if(
hsclient_print_color(0,0,"^4%s ^3%s ^1adli oyuncu ^3%0.0f ^1m uzakliktan ^3Zoomsuz Kafadan ^1vurdu."TAGkillernfloat(iDistance) * 0.0254victimnszWeapon[0]);
            else 
client_print_color(0,0,"^4%s ^3%s ^1adli oyuncu ^3%0.0f ^1m uzakliktan ^3Zoomsuz ^1vurdu."TAGkillerniDistance 0.0254victimnszWeapon[0]);
                if(
iDistance >= 9) {
                new 
avadd get_pcvar_num(avad);
                
crxranks_set_user_xp(killercrxranks_get_user_xp(killer) + avadd);
                
client_print_color(killerkiller"^4%i XP: ^1Zoomsuz vurusunuzdan dolayi odulunuz."avadd);
            }
        }
    }

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Erra
Member
Join Date: Jun 2021
Old 12-11-2021 , 15:18   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
Compiling plugins does not require any coding knowledge.

Quote:
Originally Posted by OciXCrom View Post
Simply replace what I told you to replace. There's nothing complicated about copy/pasting. You're not even trying.

PHP Code:
#include <amxmodx>
#include <reapi>

native crxranks_set_user_xp(indexamount);
native crxranks_get_user_xp(amount);

new const 
TAG[32] = ""
new avad

public plugin_init(){
    
register_plugin("No Scope""1.1""erra")

    
register_event("DeathMsg" "eaDeath" "a")

    
avad register_cvar("ea_odul","5"// 0: Kapali - Diger sayilar odul miktari
}

public 
eaDeath(){
    new 
killer read_data(1)
    new 
victim read_data(2)
    
    if (
victim == killer) return; 

    new 
hs read_data(3)

    new 
vdistance[3], kdistance[3]
    new 
iDistance

    get_user_origin
(victimvdistance)
    
get_user_origin(killerkdistance)

    
iDistance get_distance(vdistancekdistance)

    if(
iDistance 10) return;

    new 
szWeapon[20]; read_data(4,szWeapon,charsmax(szWeapon));
    if(
equali(szWeapon,"awp") || equali(szWeapon,"g3sg1") || equali(szWeapon,"scout") || equali(szWeapon,"sg550")) {
        new 
killern[33],victimn[33]; get_user_name(killer,killern,charsmax(killern)); get_user_name(victim,victimn,charsmax(victimn))
        
        if (
get_member(killer,m_iLastZoom) == 90) {
            if(
hsclient_print_color(0,0,"^4%s ^3%s ^1adli oyuncu ^3%0.0f ^1m uzakliktan ^3Zoomsuz Kafadan ^1vurdu."TAGkillernfloat(iDistance) * 0.0254victimnszWeapon[0]);
            else 
client_print_color(0,0,"^4%s ^3%s ^1adli oyuncu ^3%0.0f ^1m uzakliktan ^3Zoomsuz ^1vurdu."TAGkillerniDistance 0.0254victimnszWeapon[0]);
                if(
iDistance >= 9) {
                new 
avadd get_pcvar_num(avad);
                
crxranks_set_user_xp(killercrxranks_get_user_xp(killer) + avadd);
                
client_print_color(killerkiller"^4%i XP: ^1Zoomsuz vurusunuzdan dolayi odulunuz."avadd);
            }
        }
    }

I tried but it was still working under 10 meters
now i tried with yours but still shots below 10 meters are reflected in chat
Erra is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-11-2021 , 15:23   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #9

The distance shown in chat is multiplied by 0.0254. Try doing that as well in the check.

PHP Code:
if(iDistance 10) return; 
REPLACE WITH:

PHP Code:
if(iDistance 10 0.0254) return; 
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 12-11-2021, 15:35
Erra
This message has been deleted by Erra.
Erra
Member
Join Date: Jun 2021
Old 12-11-2021 , 15:37   Re: No text say is written on non-zoom shots below 10 meters
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
The distance shown in chat is multiplied by 0.0254. Try doing that as well in the check.

PHP Code:
if(iDistance 10) return; 
REPLACE WITH:

PHP Code:
if(iDistance 10 0.0254) return; 
I tried, but it still works at shootings below 10 meters, it gives xp and it is reflected in the chat please can you help me please

PHP Code:
#include <amxmodx>
#include <reapi>

native crxranks_set_user_xp(indexamount);
native crxranks_get_user_xp(amount);

new const 
TAG[32] = ""
new avad

public plugin_init(){
    
register_plugin("No Scope""1.1""ocixcrom")

    
register_event("DeathMsg" "eaDeath" "a")

    
avad register_cvar("ea_odul","5")
}

public 
eaDeath(){
    new 
killer read_data(1)
    new 
victim read_data(2)
    
    if (
victim == killer) return; 

    new 
hs read_data(3)

    new 
vdistance[3], kdistance[3]
    new 
iDistance

    get_user_origin
(victimvdistance)
    
get_user_origin(killerkdistance)

    
iDistance get_distance(vdistancekdistance)

    if(
iDistance 10 0.0254) return; 

    new 
szWeapon[20]; read_data(4,szWeapon,charsmax(szWeapon));
    if(
equali(szWeapon,"awp") || equali(szWeapon,"g3sg1") || equali(szWeapon,"scout") || equali(szWeapon,"sg550")) {
        new 
killern[33],victimn[33]; get_user_name(killer,killern,charsmax(killern)); get_user_name(victim,victimn,charsmax(victimn))
        
        if (
get_member(killer,m_iLastZoom) == 90) {
            if(
hsclient_print_color(0,0,"^4%s ^3%s ^1adli oyuncu ^3%0.0f ^1m uzakliktan ^3Zoomsuz Kafadan ^1vurdu."TAGkillernfloat(iDistance) * 0.0254victimnszWeapon[0]);
            else 
client_print_color(0,0,"^4%s ^3%s ^1adli oyuncu ^3%0.0f ^1m uzakliktan ^3Zoomsuz ^1vurdu."TAGkillerniDistance 0.0254victimnszWeapon[0]);
                if(
iDistance >= 9) {
                new 
avadd get_pcvar_num(avad);
                
crxranks_set_user_xp(killercrxranks_get_user_xp(killer) + avadd);
                
client_print_color(killerkiller"^4%i XP: ^1Zoomsuz vurusunuzdan dolayi odulunuz."avadd);
            }
        }
    }

Erra is offline
Reply



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

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

Forum Jump


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


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