• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Gold Desert Eagle classes
#1
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
  Reply
#2
(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.
  Reply
#3
There is a function in _class.gsc with handgun names, try to add the deserteaglegold_mp there. I dont know if it will work
[Image: veovuq.png]
  Reply
#4
(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:
  Reply
#5
(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.
[Image: lxkf2.jpg]
  Reply
#6
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.
[-] The following 1 user says Thank You to camxxcore for this post:
  • surtek
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Release] 15 classes in MW3 OrangePL 14 9,022 06-28-2013, 19:14
Last Post: X-Track
  [Request] Teknogods Expert's Classes 1.5 request The6thMessenger 0 1,071 04-13-2013, 08:22
Last Post: The6thMessenger
  Modding online custom classes? jarniboi 0 1,220 03-12-2013, 00:21
Last Post: jarniboi
  edit the standard classes? astraioz 6 3,519 01-28-2013, 16:54
Last Post: Sthxz
Big Grin [Release] Awesome Classes modV3.1 ddaavvee 170 126,567 01-24-2013, 23:18
Last Post: KINGOFCRAFT909
  Edit Default Classes? jarniboi 1 1,141 01-24-2013, 00:44
Last Post: DidUknowiPwn
  [Request] Disabling Custom Classes NOT CHOOSE CLASS DidUknowiPwn 5 1,376 01-10-2013, 04:32
Last Post: banz
  [Request] Classes 99IRock 10 2,950 12-26-2012, 21:38
Last Post: kokole
  Chrome+Gold(without 14th prestige L96A1 only) DAZEDluvsLOBO 5 3,180 09-30-2012, 18:09
Last Post: DAZEDluvsLOBO
  [Release] Better Desert Eagle skins RaZ 2 1,435 09-20-2012, 14:12
Last Post: d0h!

Forum Jump:


Users browsing this thread: 1 Guest(s)