Raised This Month: $105 Target: $400
 26% 

Crosshair Menu Editing Required


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
By Hazard
Member
Join Date: Jan 2016
Old 07-28-2019 , 18:00   Crosshair Menu Editing Required
Reply With Quote #1

When we select crosshair from the Crosshair menu, it gives an error like this. Can we fix this?
Attached Thumbnails
Click image for larger version

Name:	anLGJ2.png
Views:	78
Size:	6.0 KB
ID:	176523  
Attached Files
File Type: sma Get Plugin or Get Source (Cross.sma - 10 views - 8.5 KB)
File Type: amxx Cross.amxx (5.1 KB, 5 views)

Last edited by By Hazard; 07-28-2019 at 18:02.
By Hazard is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-29-2019 , 12:08   Re: Crosshair Menu Editing Required
Reply With Quote #2

If scope is different than 1, you will send the message without passing any arguments.
PHP Code:
    message_begin(MSG_ONE,get_user_msgid("SetFOV"),        .player=id);
    if(
scope[id] == 1)
        
write_byte(55);
    
message_end(); 
Make the check surround the whole message code instead:
PHP Code:
if(scope[id] == 1) {
    
message_begin(MSG_ONE,get_user_msgid("SetFOV"),        .player=id);
    
write_byte(55);
    
message_end();

__________________

Last edited by <VeCo>; 07-29-2019 at 12:08.
<VeCo> is offline
By Hazard
Member
Join Date: Jan 2016
Old 07-29-2019 , 13:34   Re: Crosshair Menu Editing Required
Reply With Quote #3

Quote:
Originally Posted by <VeCo> View Post
If scope is different than 1, you will send the message without passing any arguments.
PHP Code:
    message_begin(MSG_ONE,get_user_msgid("SetFOV"),        .player=id);
    if(
scope[id] == 1)
        
write_byte(55);
    
message_end(); 
Make the check surround the whole message code instead:
PHP Code:
if(scope[id] == 1) {
    
message_begin(MSG_ONE,get_user_msgid("SetFOV"),        .player=id);
    
write_byte(55);
    
message_end();

Can you fix it, please?
By Hazard is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-29-2019 , 14:07   Re: Crosshair Menu Editing Required
Reply With Quote #4

That's what you have to do.

Quote:
Originally Posted by <VeCo>
Make the check surround the whole message code instead:

PHP Code:
if(scope[id] == 1) {
    
message_begin(MSG_ONE,get_user_msgid("SetFOV"),        .player=id);
    
write_byte(55);
    
message_end();

__________________
Accepting private $$$ plugins requests.

@Steam: crazy770
@Discord: CrazY.#5317

Website | Channel


Last edited by CrazY.; 07-29-2019 at 14:07.
CrazY. is offline
By Hazard
Member
Join Date: Jan 2016
Old 07-29-2019 , 14:17   Re: Crosshair Menu Editing Required
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
That's what you have to do.
Unable to select crosshair this time.
By Hazard is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 08-01-2019 , 08:48   Re: Crosshair Menu Editing Required
Reply With Quote #6

Try this, and tell if work.

PHP Code:
#include <amxmodx>
#include <engine>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new const SilahBilgi[27][3] = {
    {
0,0,0},
    {
12,1,4},
    {
9,52,1},
    {
5,32,5},
    {
14,1,6},
    {
6,100,7},
    {
4,90,8},
    {
13,1,9},
    {
10,120,10},
    {
7,100,11},
    {
6,100,12},
    {
4,90,14},
    {
4,90,15},
    {
6,100,16},
    {
10,120,17},
    {
10,120,19},
    {
3,200,20},
    {
5,32,21},
    {
4,90,22},
    {
10,120,23},
    {
11,2,25},
    {
8,35,26},
    {
4,90,27},
    {
2,90,28},
    {
7,100,30},
    {
0,0,29},
    {
0,0,0}
}
new 
MsgSetFOV
new scope[33];
new const 
sprites[6][4][64] = {
    {
"Cross Adi","Txt Yolu","Sprite Yolu","Txt Adi"},
    {
"CS:GO Crosshair","sprites/custom_cross2_fix.txt","sprites/csgo_crosshair_32.spr","custom_cross2_fix"},
    {
"Normal Sabit","sprites/custom_cross_fix_yeni3.txt","sprites/csgo_nisan_yeni3.spr","custom_cross_fix_yeni3"},
    {
"CS:GO Arti Crosshair","sprites/custom_cross3_fix.txt","sprites/artinisan.spr","custom_cross3_fix"},
    {
"CS:GO Ufak","sprites/custom_cross5_fix4.txt","sprites/dahakucuk4.spr","custom_cross5_fix4"},
    {
"CS:GO Baslangic","sprites/custom_cross_baslangic.txt","sprites/csgo_baslangic.spr","custom_cross_baslangic"}
}

new 
weapon_weapon[][] =
{
    
"weapon_aug",
    
"weapon_sg552"
}

new 
cross[33];
public 
plugin_init()
{
    
register_plugin("CS:GO Crosshair","1.1","KriTo");
    
register_event("CurWeapon","Event_CurWeapon","be","1=1");
    
register_clcmd("buyammo1","guncelle1");
    
register_clcmd("buyammo2","guncelle1");
    
register_clcmd("custom_cross2_fix","FakeSwitch");
    
register_clcmd("say /crosshair","crossmenu");
    
register_clcmd("say .crosshair","crossmenu");
    
register_clcmd("corss_gizli","crossmenu");
    
MsgSetFOV get_user_msgid("SetFOV")

    for(new 
0sizeof weapon_weaponi++)
        
RegisterHam(Ham_Weapon_Reloadweapon_weapon[i], "fw_Weapon_Reload_Post"1)
}

public 
fw_Weapon_Reload_Post(ent)
{
    static 
id;
    
id pev(entpev_owner);
    
    if(
get_user_weapon(id) == CSW_AUG || get_user_weapon(id) == CSW_SG552)
        if(
scope[id]==1)
            
scope[id]=0;
        
    return 
HAM_HANDLED
}

/*public client_disconnected(id){
    cross[id] = 1;
}*/
public client_putinserver(id){
    
client_cmd(id"crosshair 1")
    
cross[id] = 0;
}
public 
client_PreThink(id)
{
    new 
button pev(idpev_oldbuttons);
    new 
oldbutton pev(idpev_button);
    if(
oldbutton IN_ATTACK2)
    {
        if(
button IN_ATTACK2)
            return 
PLUGIN_CONTINUE;

        new 
weapon get_user_weapon(id);
        if(
weapon == CSW_AUG || weapon == CSW_SG552)
        {
            if(
scope[id]==0)
                
scope[id]=1;
            else
                
scope[id]=0;
            
Guncelle(id);
        } else if(
weapon != CSW_AUG || weapon != CSW_SG552)
        {
            
scope[id]=0;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}
public 
crossmenu(id)
{
    new 
Menu=menu_create("\rCS:GO \yCrosshair \wMenu^n","crossdevam");
    
menu_additem(Menu,"Default Crosshair","1");
    for(new 
i=1;i<sizeof(sprites);i++)
    {
        new 
Item[128],text[12];
        
formatex(Item,127,"%s",sprites[i][0]);
        
num_to_str(i+1,text,11);
        
menu_additem(Menu,Item,text);
    }
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL);
    
menu_display(id,Menu,0);
}
public 
crossdevam(idmenuitem)
{

    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    new 
key str_to_num(data);
    
cross[id] = key-1;
    if(
cross[id] == 0)
    {
        
message_begin(MSG_ONEget_user_msgid("HideWeapon"),  .player=id);
        
write_byte(1<<7);
        
message_end();
    }
    
client_print_color(idid"^3%s ^1sectin.",sprites[cross[id]][0])
    
Guncelle(id);
    
client_cmd(id"lastinv;wait;wait;wait;wait;wait;wait;lastinv")

    return 
PLUGIN_HANDLED;
}
public 
guncelle1(id)
{
    
set_task(0.1,"Guncelle",id);
    return 
PLUGIN_CONTINUE;
}
public 
Guncelle(id)
{
    if(!
is_user_alive(id) || cross[id] == 0)
        return 
PLUGIN_HANDLED;
    new 
weapon get_user_weapon(id);
    if( 
weapon == CSW_AWP || weapon == CSW_SCOUT || weapon == CSW_SG550 || weapon == CSW_G3SG1 || weapon == CSW_KNIFE)
        return 
PLUGIN_CONTINUE

    
if(weapon != CSW_SG552 && weapon != CSW_AUG)
        
scope[id]=0

    
new i;
    for(
i=0;i<sizeof(SilahBilgi);i++)
    {
        new 
yeniweap SilahBilgi[i][2];
        if(
weapon == yeniweap)
        {
            break;
        } else if(
i==sizeof(SilahBilgi)-1)
        {
            return 
PLUGIN_CONTINUE;
        }
    }
    
message_begin(MSG_ONEget_user_msgid("HideWeapon"),  .player=id);
    
write_byte(1<<6);
    
message_end();

    
message_begin(MSG_ONE,get_user_msgid("WeaponList"),   .player=id);
    
write_string(sprites[cross[id]][3]);
    
write_byte(SilahBilgi[i-1][0]);
    
write_byte(SilahBilgi[i-1][1]);
    
write_byte(-1);
    
write_byte(-1);
    
write_byte(6);
    
write_byte(0);
    
write_byte(2);
    
write_byte(0);
    
message_end();

    if(
scope[id] == 1)
    {
      
message_begin(MSG_ONE_UNRELIABLEMsgSetFOV, {0,0,0}, id)
      
write_byte(55);
      
message_end();
    }

    new 
ammo,bpammo;
    
get_user_ammo(id,weapon,ammo,bpammo);

    
message_begin(MSG_ONE,get_user_msgid("CurWeapon"),    .player=id);
    
write_byte(1);
    
write_byte(2);
    
write_byte(ammo);
    
message_end();
    if(
weapon != CSW_KNIFE) {
        
message_begin(MSG_ONE,get_user_msgid("AmmoX"),      .player=id);
        
write_byte(SilahBilgi[i-1][0]);
        
write_byte(bpammo);
        
message_end();
    }

    return 
PLUGIN_HANDLED;
}
public 
FakeSwitch(const client)engclient_cmd(client,"weapon_shield");
public 
plugin_precache()
{
    for(new 
i=1;i<sizeof(sprites);i++)
    {
        
precache_generic(sprites[i][1]);
        
precache_generic(sprites[i][2]);
    }
}

public 
Event_CurWeapon(id)
{
    if(!
is_user_alive(id) || cross[id] == 0)
        return 
PLUGIN_HANDLED;
    new 
weapon read_data(2);
    if( 
weapon == CSW_AWP || weapon == CSW_SCOUT || weapon == CSW_SG550 || weapon == CSW_G3SG1)
        return 
PLUGIN_CONTINUE
    
new i;
    for(
i=0;i<sizeof(SilahBilgi);i++)
    {
        new 
yeniweap SilahBilgi[i][2];
        if(
weapon == yeniweap)
        {
            break;
        }
    }

    if(
weapon == CSW_KNIFE)
    {
        
message_begin(MSG_ONE,get_user_msgid("WeaponList"),   .player=id);
        
write_string(sprites[cross[id]][3]);
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(-1);
        
write_byte(0);
        
write_byte(11);
        
write_byte(2);
        
write_byte(0);
        
message_end();

        
message_begin(MSG_ONE,get_user_msgid("CurWeapon"),    .player=id);
        
write_byte(1);
        
write_byte(2);
        
write_byte(-1);
        
message_end();

  

        return 
PLUGIN_CONTINUE
    
}

    
message_begin(MSG_ONEget_user_msgid("HideWeapon"),  .player=id);
    
write_byte(1<<6);
    
message_end();

    
message_begin(MSG_ONE,get_user_msgid("WeaponList"),   .player=id);
    
write_string(sprites[cross[id]][3]);
    
write_byte(SilahBilgi[i-1][0]);
    
write_byte(SilahBilgi[i-1][1]);
    
write_byte(-1);
    
write_byte(-1);
    
write_byte(6);
    
write_byte(0);
    
write_byte(2);
    
write_byte(0);
    
message_end();

    if(
weapon != CSW_SG552 && weapon != CSW_AUG)
        
scope[id]=0

    
if(scope[id] == 1)
    {
      
message_begin(MSG_ONE_UNRELIABLEMsgSetFOV, {0,0,0}, id)
      
write_byte(55);
      
message_end();
    }

    new 
ammo,bpammo;
    
get_user_ammo(id,weapon,ammo,bpammo);

    
message_begin(MSG_ONE,get_user_msgid("CurWeapon"),    .player=id);
    
write_byte(1);
    
write_byte(2);
    
write_byte(ammo);
    
message_end();

    if(
weapon != CSW_KNIFE) {
        
message_begin(MSG_ONE,get_user_msgid("AmmoX"),      .player=id);
        
write_byte(SilahBilgi[i-1][0]);
        
write_byte(bpammo);
        
message_end();
    }
    return 
PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1254\\ deff0\\ deflang1055{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1254\\ deff0\\ deflang1055{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 
__________________
Check my new Zombie Mod (2019)
Look at the video below to see gameplay

https://www.youtube.com/watch?v=U4mf9obA6x0
Krtola is offline
Send a message via Skype™ to Krtola
By Hazard
Member
Join Date: Jan 2016
Old 08-02-2019 , 10:30   Re: Crosshair Menu Editing Required
Reply With Quote #7

Quote:
Originally Posted by Krtola View Post
Try this, and tell if work.
It doesn't show up when we pick a crosshair.
By Hazard is offline
Reply


Thread Tools
Display Modes

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 01:00.


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