Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Map Building Functions Enhanced
#21
Is it normal that the weapon models have every attachment when you see them on the map?

also i'm not getting the 'press f to pick up blabla' stuff when i'm close to the gun Sad
i'm only using the Createweapon, Weaponthink and weaponrespawnthink functions... do i need to put in the others when i dont use them?
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#22
(02-25-2011, 17:43)iAegle Wrote: also i'm not getting the 'press f to pick up blabla' stuff when i'm close to the gun Sad

Code:
StworzHint()
{
    self.HintText = self createFontString("default", 1);
    self.HintText setPoint("CENTER", "CENTER", 0, 60);
}

SprawdzajHint()
{
    self endon("disconnect");

    for(;;)
    {
        self.HintText setText(self.hint);
        self.hint = "";
        wait .1;
    }
}
helped ya? rep me +
Reply

#23
cool! thx for weapon pick up function!
Reply

#24
how do you setup CreateStraightWalls(start, end) and the table (start, end)
im not sure how to wright it im doing it like this and getting a syntax error
Code:
Summit()
{
CreateStraightWalls(3710.17, -1654.14, 320.125), (3723.1, -1406.52, 456.125);
}
Reply

#25
(03-17-2011, 05:54)rotceh_dnih Wrote: how do you setup CreateStraightWalls(start, end) and the table (start, end)
im not sure how to wright it im doing it like this and getting a syntax error
Code:
Summit()
{
CreateStraightWalls(3710.17, -1654.14, 320.125), (3723.1, -1406.52, 456.125);
}

i think the comma is not need, though i havent looked into the building functions.
Look in to itszombie mod because it used it
Reply

#26
(03-17-2011, 05:54)rotceh_dnih Wrote: how do you setup CreateStraightWalls(start, end) and the table (start, end)
im not sure how to wright it im doing it like this and getting a syntax error
Code:
Summit()
{
CreateStraightWalls(3710.17, -1654.14, 320.125), (3723.1, -1406.52, 456.125);
}

CreateStraightWalls((3710.17, 1654.14, 320.125), (3723.1, 1406.52, 456.125))

you forgot some ( )'s
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#27
yea i think i tried that but i keeped the ; at the end should i try takeing that out ?

edit: error Unkown Fuction (see console for details) getting the same error when trying CreateRamps
at the moment im just trying to add it to your Old school mod like this
Code:
/**
//////////////////////////////////////////////////////////////////////////////
///////////////////////////Building functions/////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
**/

CreateRamps(top, bottom)
{
        D = Distance(top, bottom);
        blocks = roundUp(D/35);
        CX = top[0] - bottom[0];
        CY = top[1] - bottom[1];
        CZ = top[2] - bottom[2];
        XA = CX/blocks;
        YA = CY/blocks;
        ZA = CZ/blocks;
        CXY = Distance((top[0], top[1], 0), (bottom[0], bottom[1], 0));
        Temp = VectorToAngles(top - bottom);
        BA = (Temp[0], Temp[1], Temp[2]);
        for(b = 0; b < blocks; b++){
                block = spawn("script_model", (bottom + ((XA, YA, ZA) * B)), 1);
                block setModel(level.crateModelFriendly);
                block.angles = BA;
                block SetOwner( level );
                wait 0.01;
        }
        block = spawn("script_model", (bottom + ((XA, YA, ZA) * blocks) - (0, 0, 5)), 1);
        block setModel(level.crateModelFriendly);
        block.angles = (0, BA[1], BA[2]);
        block SetOwner( level );
        wait 0.01;
}

CreateWeapon(weapon, name, pos, angle, stock, respawntime)
{
        weapon_model = getWeaponModel(weapon);
        if(weapon_model == ""){
                weapon_model = weapon;
        }
        Wep = spawn("script_model", pos+(0,0,30), 1);
        
        Wep.angles = angle;
        Wep SetOwner( level );
        Wep setModel(weapon_model);
        Wep thread WeaponThink(weapon, name, pos, angle, stock, respawntime);
        wait 0.01;
}

WeaponThink(weapon, name, pos, angle, stock, respawntime)
{
        area = spawn("trigger_radius", pos+(0,0,30), 0, 25, 50);
        while(1)
        {
                area waittill("trigger", player);
                player.hint = "Press ^3[{+activate}] ^7to pick up " + name;
                if(player UseButtonPressed()){
                        switch( weapon )
                        {
                        case "frag_grenade_mp":
                        case "sticky_grenade_mp":
                        case "hatchet_mp":
                        case "flash_grenade_mp":
                        case "concussion_grenade_mp":
                        case "tabun_gas_mp":
                        case "nightingale_mp":
                        case "willy_pete_mp":
                                player takeWeapon(player getCurrentOffhand());
                                player giveWeapon( weapon );
                                player setWeaponAmmoClip( weapon, 2 );
                                break;

                        default:
                                player takeWeapon(player getCurrentWeapon());
                                player giveWeapon(weapon);
                                player SwitchToWeapon(weapon);
                                break;
                        }
                        if(stock > 1)
                        {
                            stock--;
                        }
                        else
                        {
                                if(isDefined(respawntime))
                                {
                                    level thread WeaponRespawnThink(weapon, name, pos, angle, stock, respawntime);
                                }
                                area delete();
                                self delete();
                                return;
                        }
                }
                wait .04;
        }
}

WeaponRespawnThink(weapon, name, pos, angle, stock, respawntime)
{
        wait respawntime;
        CreateWeapon(weapon, name, pos, angle, stock, respawntime);
}

createPickupGroundFX(origin, angles)
{
    baseeffect = spawnFx( level.pickupgroundfx, origin);
    baseeffect.angles = angles;
    triggerFx( baseeffect );
}

createPickupGlowFX(origin, angles)
{
    baseeffect = spawnFx( level.pickupglowfx, origin+(0,0,30) );
    baseeffect.angles = angles;
    triggerFx( baseeffect );
}

doMaps()
{
    if(getDvar("mapname") == "mp_array")
    {
        level thread ArrayMap();
    }
    if(getDvar("mapname") == "mp_cairo")
    {
        level thread Havana();
    }
    if(getDvar("mapname") == "mp_cosmodrome")
    {
        level thread Launch();
    }
    if(getDvar("mapname") == "mp_cracked")
    {
        level thread Cracked();
    }
    if(getDvar("mapname") == "mp_crisis")
    {
        level thread Crisis();
    }
    if(getDvar("mapname") == "mp_duga")
    {
        level thread Grid();
    }
    if(getDvar("mapname") == "mp_firingrange")
    {
        level thread FiringRange();
    }
    if(getDvar("mapname") == "mp_hanoi")
    {
        level thread Hanoi();
    }
    if(getDvar("mapname") == "mp_havoc")
    {
        level thread Jungle();
    }
    if(getDvar("mapname") == "mp_mountain")
    {
        level thread Summit();
    }
    if(getDvar("mapname") == "mp_nuked")
    {
        level thread NukeTown();
    }
    if(getDvar("mapname") == "mp_radiation")
    {
        level thread Radiation();
    }
    if(getDvar("mapname") == "mp_russianbase")
    {
        level thread WMD();
    }
    if(getDvar("mapname") == "mp_villa")
    {
        level thread Villa();
    }
}

ArrayMap()
{

}

Havana()
{

}

Launch()
{

}

Cracked()
{

}

Crisis()
{

}

Grid()
{

}

FiringRange()
{


}

Hanoi()
{

}

Jungle()
{


}

Summit()
{
    CreateWeapon("mp5k_elbit_mp", "MP5k Red Dot", (3101.26, 1566.16, 362.125), (0, 0, 0), 1, 15);
    CreateWeapon("mac11_rf_mp", "MAC11 Rapid Fire", (2590.35, -669.885, 330.125), (0, 0, 0), 1, 15);
    CreateWeapon("m16_extclip_mp", "M16 Extended Mags", (4029.1, -882.752, 330.125), (0, 0, 0), 1, 15);
    CreateWeapon("famas_reflex_mp", "Famas Reflex Sight", (3257.48, -1932.31, 466.125), (0, 0, 0), 1, 15);
    CreateWeapon("fnfal_silencer_mp", "Silenced FAL", (2314.37, -1806.61, 402.125), (0, 0, 0), 1, 15);
    CreateRamps((3710.17, 1654.14, 320.125), (3723.1, 1406.52, 456.125));
    CreateWeapon("m60_elbit_grip_extclip_mp", "Rambo's little girl", (3701.93, 659.677, 330.125), (0, 0, 0), 1, 15);
    CreateWeapon("l96a1_vzoom_mp", "L96 Variable Zoom", (2988.79, -76.4892, 330.125), (0, 0, 0), 1, 15);
    CreateWeapon("spas_silencer_mp", "Silenced SPAS", (1749.22, -433.601, 111.455), (0, 0, 0), 1, 15);
    
    level thread createPickupGroundFX((3101.26, 1566.16, 362.125), (90, 0, 0));
    level thread createPickupGroundFX((2590.35, -669.885, 330.125), (90, 0, 0));
    level thread createPickupGroundFX((4029.1, -882.752, 330.125), (90, 0, 0));
    level thread createPickupGroundFX((3257.48, -1932.31, 466.125), (90, 0, 0));
    level thread createPickupGroundFX((2314.37, -1806.61, 402.125), (90, 0, 0));
    level thread createPickupGroundFX((3477.66, -1288.25, 466.125), (90, 0, 0));
    level thread createPickupGroundFX((3701.93, 659.677, 330.125), (90, 0, 0));
    level thread createPickupGroundFX((2988.79, -76.4892, 330.125), (90, 0, 0));
    level thread createPickupGroundFX((1749.22, -433.601, 111.455), (90, 0, 0));
      

    /**
    level thread createPickupGlowFX((3101.26, 1566.16, 362.125), (90, 0, 0));
    level thread createPickupGlowFX((2590.35, -669.885, 330.125), (90, 0, 0));
    level thread createPickupGlowFX((4029.1, -882.752, 330.125), (90, 0, 0));
    level thread createPickupGlowFX((3257.48, -1932.31, 466.125), (90, 0, 0));
    level thread createPickupGlowFX((2314.37, -1806.61, 402.125), (90, 0, 0));
    level thread createPickupGlowFX((3477.66, -1288.25, 466.125), (90, 0, 0));
    level thread createPickupGlowFX((3701.93, 659.677, 330.125), (90, 0, 0));
    level thread createPickupGlowFX((2988.79, -76.4892, 330.125), (90, 0, 0));
    level thread createPickupGlowFX((1749.22, -433.601, 111.455), (90, 0, 0));
    **/
}

NukeTown()
{

}

Radiation()
{


}

WMD()
{

}

Villa()
{

}
Reply

#28
add this anywhere in your _rank.gsc and KEEP the ;

Code:
roundUp( floatVal )
{
        if ( int( floatVal ) != floatVal )
        return int( floatVal+1 );
        else
        return int( floatVal );
}
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#29
hay thanks now works but nothing show's up nither wall or ramp will see if i can find it in itszombie mod
Reply

#30
(03-17-2011, 11:16)rotceh_dnih Wrote: hay thanks now works but nothing show's up nither wall or ramp will see if i can find it in itszombie mod
Put wait 2; b4 ur map code if u are using killingdyl's code, it takes time to spawn
[Image: wyipjqo9qon7rc2v1lo.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] Matrix Functions Yamato 1 2,768 07-29-2013, 20:14
Last Post: Rendflex
  [Release] nCr and Factorial Functions Yamato 2 2,691 06-18-2013, 17:24
Last Post: Nekochan
  [Release] Random Functions 1.1 Yamato 22 13,368 04-20-2013, 10:13
Last Post: Dominator56
  [Release] Enhanced Botz alistair3149 11 28,888 01-02-2013, 12:59
Last Post: Paroxysmics
  Functions surtek 14 11,302 09-19-2012, 07:57
Last Post: Pozzuh
Information [Solved] Info about functions, events and etc. Nerus 2 2,498 09-09-2012, 20:57
Last Post: surtek
  Seldom required functions Phl3x_ 3 3,184 06-03-2012, 10:53
Last Post: RaZ
  Help I find This functions and i need your help. Bloodfocus 5 3,855 04-23-2012, 01:43
Last Post: House
  Help Functions iPrintLnBold() [Z00MBY] Alex 7 5,887 04-16-2012, 08:44
Last Post: [Z00MBY] Alex
  Preview Racing Mod Enhanced iAegle 18 10,153 03-25-2012, 05:35
Last Post: rotceh_dnih

Forum Jump:


Users browsing this thread:
4 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.