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

Weird error trying to compile Code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 12-03-2022 , 14:06   Weird error trying to compile Code
Reply With Quote #1

Hello

I have been investigating this error for a while:

For example this code:

HTML Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

 new g_aiming_good[33];



 public plugin_init() {

    register_plugin("1.3 like aim", "0.1", "Obbin");
    register_cvar("amx_13aim", "1");
    register_forward(FM_TraceLine, "fw_traceline");
    register_event("CurWeapon", "weaponChanged", "be", "1=1");
 }



 public client_putinserver( id ) {

    g_aiming_good[id] = 1;
 }



 public weaponChanged( id ) {      //Called when user is changing weapon

    new clip, ammo, wpnid = get_user_weapon( id, clip, ammo );

    //if client is holding a pistol then make bullets go straight even if in the air
    if ( wpnid == CSW_HEGRENADE || wpnid == CSW_FLASHBANG || wpnid == CSW_SMOKEGRENADE || wpnid == CSW_C4 || wpnid == CSW_KNIFE )
    {
        g_aiming_good[id] = 0;
    }
    else
    {
        g_aiming_good[id] = 1;
    }
 }



 public fw_traceline( Float:v1[3],Float:v2[3],noMonsters,id ) {

    //is user alive?
    if( !is_user_alive( id ) )
        return FMRES_IGNORED;

    //if user is holding a rifle/C4/Nade then cancel
    if( !g_aiming_good[id] )
        return FMRES_IGNORED;

    if( !get_cvar_num( "amx_13aim" ) )
        return FMRES_IGNORED;



    // get crosshair aim
    new MyAim[3], Float:flMyAim[3];
    get_user_origin( id, MyAim,3 );
    IVecFVec( MyAim, flMyAim );

    // set crosshair aim
    set_tr( TR_vecEndPos, flMyAim );

    // get ent looking at
    new ent, body;
    get_user_aiming( id, ent, body );



    // if looking at something
    if( is_valid_ent( ent ) )
    {
        set_tr( TR_flFraction, 0.1 );   // 1.0 == no hit, < 1.0 == hit
        set_tr( TR_pHit, ent );  // entity hit
        set_tr( TR_iHitgroup, body );   // bodypart hit
    }
    return FMRES_IGNORED;
 }
if i paste it in sublime, i see the colors but in text in front of the code, maybe this is causing the compile error_

Why is the code trying to copy the colors as text and such?

tried to compile online, last version of amx compiler, more than one code, two different pcs,
4 amx compilers, and sublime.

im kind of lost, been compiling plugins for years,

why this suddenly happens?

Edit: the error starts with cannot find Áamxmodx... but if i replace it manually, the next include presents the same problem, a weird character that is not there when i copy the code, its becoming so annoying.
That happens every line of code i don't write manually.

Last edited by Ark_Procession; 12-03-2022 at 14:08. Reason: asd
Ark_Procession is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-03-2022 , 17:47   Re: Weird error trying to compile Code
Reply With Quote #2

If you're using Firefox, it's because of Firefox. They changed something recently to totally break copying code. I use VS Code and when I paste it, it looks fine but all the whitespace characters are not spaces, they are some other invisible character. The only way I know to get around this right now is to use a different browser. I use Brave as my secondary browser.
__________________
fysiks is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 12-03-2022 , 19:48   Re: Weird error trying to compile Code
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
If you're using Firefox, it's because of Firefox. They changed something recently to totally break copying code. I use VS Code and when I paste it, it looks fine but all the whitespace characters are not spaces, they are some other invisible character. The only way I know to get around this right now is to use a different browser. I use Brave as my secondary browser.
https://marketplace.visualstudio.com...oizey.gremlins
__________________
deprale is offline
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 12-03-2022 , 21:53   Re: Weird error trying to compile Code
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
If you're using Firefox, it's because of Firefox. They changed something recently to totally break copying code. I use VS Code and when I paste it, it looks fine but all the whitespace characters are not spaces, they are some other invisible character. The only way I know to get around this right now is to use a different browser. I use Brave as my secondary browser.
omg thank you, that it. the last straw from firefox. i'm done.

working now.

Thanks!

Last edited by Ark_Procession; 12-03-2022 at 21:53.
Ark_Procession 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 09:42.


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