Thread: Laptop

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored

    Laptop

    Hey,
    i tried to spawn a create or a laptop which executes a function when pressing "F". I tried it this way: https://www.mpgh.net/forum/323-call-d...-ammo-box.html but when i spawn the laptop its laggin as HELL and pressing F doesnt work.

    Someone got a working code for that?

  2. #2
    prisma's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    236
    Reputation
    11
    Thanks
    42
    My Mood
    Amazed
    Quote Originally Posted by Vanoq View Post
    Hey,
    i tried to spawn a create or a laptop which executes a function when pressing "F". I tried it this way: https://www.mpgh.net/forum/323-call-d...-ammo-box.html but when i spawn the laptop its laggin as HELL and pressing F doesnt work.

    Someone got a working code for that?
    Look into the Nemesis mod... There are a lot of those Crates with fnctions like Predator, Harrier, Ammo when pressing F on them

  3. #3
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Yea i already tried this, but the whole czech is really confusing. Can you give a simple short code instead?

  4. #4
    prisma's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    236
    Reputation
    11
    Thanks
    42
    My Mood
    Amazed
    No can't b'cus its too high for me... But i think its in
    Nemesis\maps\mp\placki
    and
    Nemesis\maps\mp\kupas
    Last edited by prisma; 10-08-2010 at 06:50 AM.

  5. #5
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Doesnt exist..
    Code:
    mp\gametypes\
    mp\killstreaks\
    mp\nemesis\

  6. #6
    prisma's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    236
    Reputation
    11
    Thanks
    42
    My Mood
    Amazed
    Quote Originally Posted by Vanoq View Post
    Doesnt exist..
    Code:
    mp\gametypes\
    mp\killstreaks\
    mp\nemesis\
    lol... Soz got the old Nemesis mod, wait i'll look into the new x)

    Put this on top of the MapEdit.gsc:

    Code:
    SpawnBox(origin, model, hint, type, icon, solid, angles)
    {
        if(!isDefined(origin))
            return;
        box = spawn("script_model", origin);
        wait 0.05;
        if(isDefined(model)) box setModel( model );
        wait 0.05;
        if(isDefined(hint) && isDefined(type)) box thread uzywaniePrzedmiotow(hint, type);
        wait 0.05;
        if(isDefined(solid)) box CloneBrushmodelToScriptmodel( solid );
        wait .05;
        if(isDefined(angles)) box.angles = angles;
        wait 0.05;
        if(isDefined(icon)) box pokazNaMapie(icon);
    }
    And add this to the part of the map
    (You should get an AA12 by pressing F)

    Code:
    SpawnBox((801, 2670.26, 420), GetWeaponModel("aa12_mp"), "Press ^3[{+activate}]^7 to get ^1aa12", "aa12", "compass_objpoint_ammo_friendly", undefined);
    For predator use this:
    Code:
    SpawnBox((1881, -21, 137), "com_laptop_2_open", "Press ^3[{+activate}]^7 to ^2fire ^1remote missile", "predator", "cardicon_missile_1", undefined, (0,143,0));
    I dont know if it works... Just give it a try

    maybe you have to precache the Icon too... don't really know x)
    Last edited by prisma; 10-08-2010 at 07:21 AM.

  7. #7
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    166
    My Mood
    Angelic
    this is gonna not work.. because u need 1 more tread the uzywaniePrzedmiotow()
    and precache the icons

  8. #8
    prisma's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    236
    Reputation
    11
    Thanks
    42
    My Mood
    Amazed
    Ok... precacheing the icons with this:

    Add this to the init() thread at the top of your MapEdit.gsc:

    Code:
    precacheShader( "cardicon_missile_1" );
    precacheShader( "compass_objpoint_ammo_friendly" );
    And where do you think is the thread uzywaniePrzedmiotow() located @Mathieutje12 ?

    Edit:
    Ok... Found it...

    Dont know what to do with it but here is the code:

    Code:
    uzywaniePrzedmiotow( Hint, wykonac, drzwiczki, przemiszczenie )
    {
        self endon ( "disconnect" ); 
        self endon ( "death" );
        //player endon ( "disconnect" ); 
        
        if(!isDefined(drzwiczki))
            drzwiczki = undefined;
        if(!isDefined(przemiszczenie))
            przemiszczenie = undefined;
        
        przygotujNaUzycie( Hint );
    
        self thread przechwytywanie();
    
        for ( ;; )
        {
            self waittill ( "captured", player );
            
            if ( player.team == "allies" )
                continue;
            
            switch(wykonac) {
                case "m1014":
                    player giveWeapon("m1014_mp");
                    break;
                case "detonator":
                    zdetonujskrzynie();
                    break;
                case "aa12":
                    player giveWeapon("aa12_mp");
                    break;
                case "predator":
                    player [[level.killstreakFuncs["predator_missile"]]]();
                    break;
                case "randomweapon":
                    if(player.niedostalembroni) {
                        player.niedostalembroni = false;
                        player giveWeapon(level.weaponList[RandomInt( level.weaponList.size )]);
                        //player giveWeapon("m4_gl_mp");
                        weapList = player GetWeaponsListAll();
                        for(i=0;i<weapList.size;i++) {
                            if(isSubStr( weapList[i], "gl" )) {
                                player iPrintlnBold("No luck this time, try again.");
                                player TakeWeapon( weapList[i] );
                                player.niedostalembroni = true;
                            }    
                        }
                    } else player iPrintlnBold("You have already taken weapon.");    
                    break;
                default:
                    break;
            }
            
            player playLocalSound( "ammo_crate_use" );
            //self deleteCrate();
        }
    }
    if you use the one bove you need this one too:

    Code:
    przechwytywanie()
    {
        self endon ( "disconnect" ); 
        //player endon ( "disconnect" ); 
        //player endon ( "death" );    
        while ( isDefined( self ) )
        {
            self waittill ( "trigger", player );
    
            if ( !useHoldThink2( player, 50 ) )
                continue;
            
            self notify ( "captured", player );
        }
    }
    Last edited by prisma; 10-08-2010 at 08:03 AM.

  9. #9
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    I tried it, prisma, but it doesnt work..
    Code:
    unknown function
    I didnt use a icon, i replaced it with 'undefined' instead

  10. #10
    prisma's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    236
    Reputation
    11
    Thanks
    42
    My Mood
    Amazed
    Quote Originally Posted by Vanoq View Post
    I tried it, prisma, but it doesnt work..
    Code:
    unknown function
    I didnt use a icon, i replaced it with 'undefined' instead
    The unknown function is because of the box thread uzywaniePrzedmiotow()

  11. #11
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Oh right..you know where its located?

  12. #12
    prisma's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    236
    Reputation
    11
    Thanks
    42
    My Mood
    Amazed
    Quote Originally Posted by Vanoq View Post
    Oh right..you know where its located?
    Try to put the 2 codes i posted somewhere into the MapEdit.gsc

  13. #13
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Thats what i did and i located the function but it still doesnt work.. maybe we can write our own code for that?

  14. #14
    prisma's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    236
    Reputation
    11
    Thanks
    42
    My Mood
    Amazed
    Sorry but thats too high for me x)

  15. #15
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    166
    My Mood
    Angelic
    Use this
    Code:
    SpawnBox(origin, model, hint, type, icon, solid, angles, name, addorigin, notusablebythisteam, missilecoords, missiletype)
    {
    	if(!isDefined(origin))
    		return;
    	if(!isDefined(notusablebythisteam))
    		notusablebythisteam = "allies";
    	if(!isDefined(name))
    		name = undefined;
    	if(!isDefined(missilecoords))
    		missilecoords = undefined;
    	if(!isDefined(missiletype))
    		missiletype = 1;
    	if(!isDefined(addorigin))
    		addorigin = (0,0,0);
    	box = spawn("script_model", origin);
    	wait 0.05;
    	if(isDefined(model)) box setModel( model );
    	wait 0.05;
    	if(isDefined(angles)) box.angles = angles;
    	wait .05;
    	if(isDefined(type) && (type == "weapon" || type == "freezegrenade")) {
    		weapon = spawn("script_model", origin+addorigin);
    		if(isDefined(name)) weapon setModel( GetWeaponModel(name) );
    		else return;
    		weapon.angles = (box.angles[0],box.angles[1],box.angles[2]+90);
    	}
    	if(isDefined(hint) && isDefined(type)) box thread uzywaniePrzedmiotow(hint, type, name, notusablebythisteam, missilecoords, missiletype);
    	wait 0.05;
    	if(isDefined(solid)) box CloneBrushmodelToScriptmodel( solid );
    	wait 0.05;
    	if(isDefined(icon)) box pokazNaMapie(icon);
    }
    PrecacheShader the icons under init()

    and use this thread:
    Code:
    uzywaniePrzedmiotow( Hint, wykonac, weaponame, notusablebythisteam, missilecoords, missiletype )
    {
    	self endon ( "disconnect" ); 
    	self endon ( "death" );
    	//player endon ( "disconnect" ); 
    	
    	if(!isDefined(weaponame))
    		weaponame = undefined;
    	Sound = undefined;	
    	akimbo = undefined;
    	losowaabron = undefined;
    	
    	przygotujNaUzycie( Hint, notusablebythisteam );
    
    	self thread przechwytywanie();
    
    	for ( ;; )
    	{
    		self waittill ( "captured", player );
    		
    		if ( player.team == notusablebythisteam )
    			continue;
    		
    		switch(wykonac) {
    			case "weapon":
    				if(isSubStr(weaponame, "akimbo"))
    					akimbo = true;
    				else akimbo = false;	
    				player giveWeapon(weaponame, 0, akimbo);
    				break;
    			case "freezegrenade":
    				if(player.niewzialgranatu) {
    					player giveWeapon(weaponame);
    					player SetWeaponAmmoClip( "concussion_grenade_mp", 1 );
    					player SetWeaponAmmoStock( "concussion_grenade_mp", 1 );
    				}	
    				else player iPrintlnBold("You have to wait a bit more.");
    				player.niewzialgranatu = false;
    				player thread mozeWziascGranat();
    				Sound = false;
    				break;	
    			case "detonator":
    				if(level.niezdetonowany) {
    					zdetonujskrzynie(player);
    					level.niezdetonowany = false;
    				}	
    				break;
    			case "movejetderail":
                    player thread moveJetDerail();
                    player ThermalVisionFOFOverlayOn();
                    wait 20;
                    player ThermalVisionFOFOverlayOff();
                    wait 120;
                    break;
    			case "podlaczdoheli":
    				if(!player.nieoczekujeNaNastepny && level.nikogoniema) player odpalheli(player.lifeId);
    				else if(!level.nikogoniema) player iPrintLnBold( "Someone uses it already." );
    				else if(player.nieoczekujeNaNastepny) player iPrintLnBold( "You have to wait a bit more." );
    				break;
                case "napalm":
    				player thread doNapalm();
                    wait 15;
                    break;
    			case "missile":
    				player missile_javelin(missilecoords, missiletype);
    				break;
    			case "health1":
    				if(level.nieuzylhpboxu) {
    					if(player.health+5000 > player.maxhealth) player.maxhealth = player.health+5000;
    					player.health += 5000;
    					level.nieuzylhpboxu = false;
    				}
    				break;
    			case "diving":
                    player thread doDiving();
                    wait 5;
                    break;
    			case "MOAB":
                    if(level.moabnieuzyty) player thread useMotherOfAllBombs();   
    				else player iPrintLnBold( &"MP_AIR_SPACE_TOO_CROWDED" );
    				level thread uzycieMOAB();
    				break;
    			case "predator":
    				player [[level.killstreakFuncs["predator_missile"]]]();
    				break;
    			case "randomweapon":
    				if(player.niedostalembroni) {
    					player.niedostalembroni = false;
    					losowaabron = level.weaponList[RandomInt( level.weaponList.size )];
    					if(isSubStr(losowaabron, "akimbo"))
    						akimbo = true;
    					else akimbo = false;	
    					player giveWeapon(losowaabron, 0, akimbo);
    					//player giveWeapon("m4_gl_mp");
    					weapList = player GetWeaponsListAll();
    					for(i=0;i<weapList.size;i++) {
    						if(isSubStr( weapList[i], "gl_" )) {
    							player iPrintlnBold("No luck this time, try again.");
    							player TakeWeapon( weapList[i] );
    							player.niedostalembroni = true;
    						}	
    					}
    				} else player iPrintlnBold("You have already taken weapon.");	
    				break;
    			default:
    				break;
    		}
    		
    		if(isDefined(wykonac) && (wykonac == "weapon" || wykonac == "randomweapon" || wykonac == "freezegrenade") && Sound) player playLocalSound( "ammo_crate_use" );
    		//self deleteCrate();
    	}
    }

Page 1 of 2 12 LastLast

Similar Threads

  1. Laptop says:
    By UnknownPerson in forum Suggestions, Requests & General Help
    Replies: 1
    Last Post: 03-02-2008, 06:57 AM
  2. New Laptop vs Xbox 360
    By NeedHacksBad in forum General
    Replies: 12
    Last Post: 09-20-2007, 02:14 PM
  3. [HELP] Unhatdware Ban on Laptop
    By ndk721 in forum WarRock - International Hacks
    Replies: 8
    Last Post: 04-29-2007, 01:09 PM
  4. LAPTOP TB Drive
    By Dave84311 in forum General
    Replies: 6
    Last Post: 07-09-2006, 09:19 AM
  5. i need to get into this laptop!!!!!! help plzzz
    By sqeak in forum Suggestions, Requests & General Help
    Replies: 10
    Last Post: 04-10-2006, 07:59 PM