Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Player movement & grenades.

  1. #11
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    Quote Originally Posted by filthy_freak_ View Post
    Sorry for the late reply, but I just remembered that this was for fixing bots that are shooting with snipers/semi rifles. Without the fix the gun will 'jam' due to not releasing the shoot button. A proper fix would be to find the 'semiAuto' & 'boltAction' addresses from the weaponfile and use it like this;

    From

    Code:
                    if(!bot_wepType[clientnum])
                    {
                        if(bot_shoot[clientnum] == 4097)
                            bot_shoot[clientnum] = 0;
                        else
                            bot_shoot[clientnum] = 4097;
                    } else
                        bot_shoot[clientnum] = 4097;
    To something like

    Code:
                    if(iswepbolt[clientnum] || isweprifle[clientnum])
                    {
                        if(bot_shoot[clientnum] == 4097)
                            bot_shoot[clientnum] = 0;
                        else
                            bot_shoot[clientnum] = 4097;
                    } else
                        bot_shoot[clientnum] = 4097;
    There are no issues with that in the current setup, just fireWeapon(false) on endframe always means the button is released.

    Quote Originally Posted by croni1012 View Post
    I was tried to achieve with libcod to make a weapon with script (set sounds and everything else) so I get almost every offsets for the weapons. If you need I can send it. It contains the boltaction and semiauto option too.
    I already got most of the weapon offsets mounts ago: https://github.com/voron00/libcod/bl...ions.hpp#L1652, only some really redundant/unknown stuff are missing.
    sudo apt-get rekt

  2. The Following User Says Thank You to voron00 For This Useful Post:

    kung foo man (15th March 2018)

  3. #12
    Private
    Join Date
    Sep 2015
    Posts
    33
    Thanks
    0
    Thanked 21 Times in 13 Posts
    set this function to libcod:

    PHP Code:
    void gsc_utils_getweaponidbyname() {

        
    charweapon;
        if(!
    stackGetParams("s", &weapon)) {
            
    printf("scriptengine> wrongs args for: gsc_utils_getweaponkeydatabyidandoffset(weapon)\n");
            
    stackPushUndefined();
            return;
        }
        
    stackPushInt(getWeapon(hook_findWeaponIndex(weapon)));    
    }

    void gsc_utils_getweaponkeydatabyidandoffset() {

        
    int id;
        
    int offset;
        
    int type;
        if(!
    stackGetParams("iii", &id, &offset, &type)) {
            
    printf("scriptengine> wrongs args for: gsc_utils_getweaponkeydatabyidandoffset(id,offset,type)\n");
            
    stackPushUndefined();
            return;
        }
        if(
    type == 0
            
    stackPushString(*(char**)(id offset));        
        else if(
    type == 1)
            
    stackPushInt(*(int*)(id offset));    
        else
            
    stackPushFloat(*(float*)(id offset));    
    }

    void gsc_utils_setweaponkeydatabyidandoffset_int() {

        
    int id;
        
    int offset;
        
    int value;
        if(!
    stackGetParams("iii", &id, &offset, &value)) {
            
    printf("scriptengine> wrongs args for: gsc_utils_setweaponkeydatabyidandoffset(id,offset,value)\n");
            
    stackPushUndefined();
            return;
        } 
        *(
    int*)(id offset) = value;
    }

    void gsc_utils_setweaponkeydatabyidandoffset_string() {

        
    int id;
        
    int offset;
        
    charvalue;
        if(!
    stackGetParams("iis", &id, &offset, &value)) {
            
    printf("scriptengine> wrongs args for: gsc_utils_setweaponkeydatabyidandoffset(id,offset,value)\n");
            
    stackPushUndefined();
            return;
        } 
        *(
    char**)(id offset) = value;
    }

    void gsc_utils_setweaponkeydatabyidandoffset_float() {

        
    int id;
        
    int offset;
        
    float value;
        if(!
    stackGetParams("iif", &id, &offset, &value)) {
            
    printf("scriptengine> wrongs args for: gsc_utils_setweaponkeydatabyidandoffset(id,offset,value)\n");
            
    stackPushUndefined();
            return;
        } 
        *(
    float*)(id offset) = value;

    and in gsc:
    PHP Code:
    getOffset(key)
    {
        switch(
    key)
        {
            case 
    "displayName": return 4;
            case 
    "modeName": return 112;
            case 
    "playerAnimType ": return 116;
            case 
    "AIOverlayDescription": return 8;
            case 
    "gunModel": return 12;
            case 
    "handModel": return 16;
            case 
    "worldModel": return 436;
            case 
    "idleAnim": return 24;
            case 
    "emptyIdleAnim": return 28;
            case 
    "fireAnim": return 32;
            case 
    "lastShotAnim": return 40;
            case 
    "rechamberAnim": return 44;
            case 
    "meleeAnim": return 48;
            case 
    "reloadAnim": return 52;
            case 
    "reloadEmptyAnim": return 56;
            case 
    "reloadStartAnim": return 60;
            case 
    "reloadEndAnim": return 64;
            case 
    "raiseAnim": return 68;
            case 
    "dropAnim": return 72;
            case 
    "altRaiseAnim": return 76;
            case 
    "altDropAnim": return 80;
            case 
    "quickRaiseAnim": return 84;
            case 
    "quickDropAnim": return 88;
            case 
    "adsFireAnim": return 92;
            case 
    "adsLastShotAnim": return 96;
            case 
    "adsRechamberAnim": return 100;
            case 
    "adsUpAnim": return 104;
            case 
    "adsDownAnim": return 108;
            case 
    "viewFlashEffect": return 144;
            case 
    "worldFlashEffect": return 148;
            case 
    "pickupSound": return 152;
            case 
    "ammoPickupSound": return 156;
            case 
    "fireSound": return 168;
            case 
    "fireSoundPlayer": return 172;
            case 
    "lastShotSound": return 192;
            case 
    "lastShotSoundPlayer": return 196;
            case 
    "meleeSwipeSound": return 200;
            case 
    "rechamberSound": return 204;
            case 
    "rechamberSoundPlayer": return 208;
            case 
    "reloadSound": return 212;
            case 
    "reloadSoundPlayer": return 216;
            case 
    "reloadEmptySound": return 220;
            case 
    "reloadEmptySoundPlayer": return 224;
            case 
    "reloadStartSound": return 228;
            case 
    "reloadStartSoundPlayer": return 232;
            case 
    "reloadEndSound": return 236;
            case 
    "reloadEndSoundPlayer": return 240;
            case 
    "raiseSound": return 244;
            case 
    "altSwitchSound": return 248;
            case 
    "putawaySound": return 252;
            case 
    "noteTrackSoundA": return 256;
            case 
    "noteTrackSoundB": return 260;
            case 
    "noteTrackSoundC": return 264;
            case 
    "noteTrackSoundD": return 268;
            case 
    "shellEjectEffect": return 272;
            case 
    "lastShotEjectEffect": return 276;
            case 
    "reticleCenter": return 280;
            case 
    "reticleSide": return 284;
            case 
    "reticleCenterSize": return 288;
            case 
    "reticleSideSize": return 292;
            case 
    "reticleMinOfs": return 296;
            case 
    "hudIcon": return 440;
            case 
    "modeIcon": return 444;
            case 
    "killIcon": return 844;
            case 
    "ammoName": return 452;
            case 
    "startAmmo": return 448;
            case 
    "clipName": return 460;
            case 
    "maxAmmo": return 468;
            case 
    "clipSize": return 472;
            case 
    "shotCount": return 476;
            case 
    "damage": return 492;
            case 
    "minDamage": return 1424;
            case 
    "meleeDamage": return 500;
            case 
    "minDamageRange": return 1432;
            case 
    "maxDamageRange": return 1436;
            case 
    "fireDelay": return 508;
            case 
    "meleeDelay": return 512;
            case 
    "fireTime": return 516;
            case 
    "rechamberTime": return 520;
            case 
    "rechamberBoltTime": return 524;
            case 
    "meleeTime": return 532;
            case 
    "reloadTime": return 536;
            case 
    "reloadEmptyTime": return 540;
            case 
    "reloadAddTime": return 544;
            case 
    "reloadStartTime": return 548;
            case 
    "reloadStartAddTime": return 552;
            case 
    "reloadEndTime": return 556;
            case 
    "dropTime": return 560;
            case 
    "raiseTime": return 564;
            case 
    "altDropTime": return 568;
            case 
    "altRaiseTime": return 572;
            case 
    "quickDropTime": return 576;
            case 
    "quickRaiseTime": return 580;
            case 
    "adsTransInTime": return 704;
            case 
    "adsTransOutTime": return 708;
            case 
    "aiVsAiAccuracyGraph": return 1292;
            case 
    "aiVsPlayerAccuracyGraph": return 1296;
            case 
    "fireRumble": return 1532;
            case 
    "meleeImpactRumble": return 1536;
            case 
    "adsOverlayShader": return 628;
            case 
    "adsOverlayWidth": return 636;
            case 
    "adsOverlayHeight": return 640;
            case 
    "altWeapon":&n