ItsMods

Full Version: Gold Desert Eagle classes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi itsmods, I just had a quick question maybe someone could help me out..

Im working on a patch for PC and am trying to add something that will give players a gold desert eagle on their classes.

Quote:self setplayerdata( "customClasses", 1, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 2, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 3, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 4, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 5, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 6, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 7, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 8, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 9, "weaponSetups", 1, "weapon", "deserteaglegold" );
self setplayerdata( "customClasses", 10, "weaponSetups", 1, "weapon", "deserteaglegold" );
This is what I have, but instead of giving a desert eagle it gives a usp 45? Although in the create a class menu it clearly shows "Gold Desert Eagle"....

Where have I gone wrong? help please =D
(01-27-2013, 01:44)camxxcore Wrote: [ -> ]Hi itsmods, I just had a quick question maybe someone could help me out..

Im working on a patch for PC and am trying to add something that will give players a gold desert eagle on their classes.

Where have I gone wrong? help please =D

You are trying to modify the player's classes instead of replacing them.

Code:
onPlayerSpawned()  
{
    self endon( "disconnect" );
    for( ; ; )
    {
        self waittill( "spawned_player" );
        //self takeallweapons();   //uncomment this line if you want to remove every weapon and just add a gold deagle
        self giveweapon("deserteaglegold_mp",0,false);
        self givemaxammo("deserteaglegold_mp");
        wait (0.5);
        self switchtoweapon("deserteaglegold_mp",0,false);
    }
}

This will give everyone a 3rd wepon (gold deagle now), but if you want to make a gold deagle only mod, you should uncomment the "//self takeallweapons();" command.
There is a function in _class.gsc with handgun names, try to add the deserteaglegold_mp there. I dont know if it will work
(01-27-2013, 13:11)Yamato Wrote: [ -> ]There is a function in _class.gsc with handgun names, try to add the deserteaglegold_mp there. I dont know if it will work

Yes ,it is working. (but only on servers with modified class.gsc)

In _class.gsc line 922 -> 1058:

Code:
isValidPrimary( refString )
{
    switch ( refString )
    {
        case "riotshield":
        case "ak47":
        case "m16":
        case "m4":
        case "fn2000":
        case "deserteaglegold":
        case "masada":
        case "famas":
        case "fal":
        case "scar":
        case "tavor":
        case "mp5k":
        case "uzi":
        case "p90":
        case "kriss":
        case "ump45":
        case "barrett":
        case "wa2000":
        case "m21":
        case "cheytac":
        case "rpd":
        case "sa80":
        case "mg4":
        case "m240":
        case "aug":
            return true;
        default:
            assertMsg( "Replacing invalid primary weapon: " + refString );
            return false;
    }
}

isValidSecondary( refString )
{
    switch ( refString )
    {
        case "beretta":
        case "usp":
        case "deserteagle":
        case "coltanaconda":
        case "deserteaglegold":
        case "glock":
        case "beretta393":
        case "pp2000":
        case "tmp":
        case "m79":
        case "rpg":
        case "at4":
        case "stinger":
        case "javelin":
        case "ranger":
        case "model1887":
        case "striker":
        case "aa12":
        case "m1014":
        case "spas12":
        case "onemanarmy":
            return true;
        default:
            assertMsg( "Replacing invalid secondary weapon: " + refString );
            return false;
    }
}

Full modified _class.gsc:
(01-27-2013, 13:11)Yamato Wrote: [ -> ]There is a function in _class.gsc with handgun names, try to add the deserteaglegold_mp there. I dont know if it will work

Yep, IW added those weapon check functions with some patch to prevent users from modifying their classes with a class editior to get weird overpowered classes.
Can't thank you guys enough for the help, I got it all working fine now. Didn't realize there were any weapon checks like that.