Results 1 to 8 of 8
  1. #1
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy

    EMERGENCY!!Need some help

    Can someone help me to make the center origin to a custom position like CreateBlock?

    I wanted to make something like
    Code:
    CreateCannon((-240, 1640, 422));
    Here's the code...
    Code:
    CreateCannon(pos) 
    { 
            center = spawn("script_origin", bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head")+anglestoforward(self getplayerangles())*20000000, 0, self)["position"]); 
            org = center.origin; 
            level.artillery = []; 
            level.artillery[0] = cbox(org+(41.25,0,0)); 
            level.artillery[1] = cbox(org+(96.25,0,0)); 
            level.artillery[2] = cbox(org+(-41.25,0,0)); 
            level.artillery[3] = cbox(org+(-96.25,0,0)); 
            level.artillery[4] = cbox(org+(0,41.25,0)); 
            level.artillery[5] = cbox(org+(0,96.25,0)); 
            level.artillery[6] = cbox(org+(0,-41.25,0)); 
            level.artillery[7] = cbox(org+(0,-96.25,0)); 
            level.swivel = []; 
            level.swivel[0] = cbox(org-(0,0,14)); 
            level.swivel[0].angles = (90,0,0); 
            level.swivel[1] = cbox(org+(0,0,28)); 
            level.swivel[2] = cbox(org+(41.25,0,69)); 
            level.swivel[2].angles = (90,0,0); 
            level.swivel[3] = cbox(org+(-41.25,0,69)); 
            level.swivel[3].angles = (-90,0,0); 
            level.swivel[4] = cbox(org+(-41.25,0,29)); 
            level.swivel[4].angles = (0,90,0); 
            level.swivel[5] = cbox(org+(41.25,0,29)); 
            level.swivel[5].angles = (0,-90,0); 
            level.swivel[6] = cbox(org+(-41.25,0,110)); 
            level.swivel[6].angles = (0,90,0); 
            level.swivel[7] = cbox(org+(41.25,0,110)); 
            level.swivel[7].angles = (0,-90,0); 
            level.barrel = []; 
            for(i=0;i<=6;i++) 
            { 
                    level.barrel[i] = cbox(org+(0,i*55-110,110)); 
                    level.barrel[i].angles = (0,90,0); 
            } 
            level.barrel[7] = cbox(org+(0,0,109.99)); 
            for(i=4;i<=7;i++) 
                    level.artillery[i].angles = (0,90,0); 
            level.gunpos = spawn("script_origin", org+(0,245,110)); 
            level.gunpos.angles = (0,90,0); 
            level.pitch = spawn("script_origin", org+(0,0,110)); 
            foreach(barrel in level.barrel) 
                    barrel linkto(level.pitch); 
            level.gunpos linkto(level.pitch); 
            level.turn = spawn("script_origin", org); 
            foreach(swivel in level.swivel) 
                    swivel linkto(level.turn); 
            level.turn linkto(level.pitch); 
            level.computer = cbox(org+(-165,-165,14)); 
            level.computer.angles = (0,-45,0); 
            level.pc = spawn("script_model", level.computer.origin+(0,0,14  )); 
            level.pc setModel( "com_laptop_2_open" ); 
            level.pc.angles = (0,-135,0); 
            level.pctrig = spawn("trigger_radius", level.computer.origin,0,70,70); 
            level.pctrig thread CannonUse(); 
    } 
     
    cbox(location) 
    { 
            box = spawn("script_model", location); 
            box setModel( "com_plasticcase_enemy" ); 
            box CloneBrushmodelToScriptmodel( level.airDropCrateCollision ); 
            return box; 
    } 
     
    CannonUse() 
    { 
            player = "fsf"; 
            if(level.xenon) 
                    use = "[{+usereload}]"; 
            else use = "[{+activate}]"; 
            for(;;) 
            { 
                    player clearlowermessage("artillery"); 
                    pressed = 0; 
                    self waittill("trigger", player); 
                    player setlowermessage("artillery", "Push ^3[{+frag}]^7 or ^3[{+smoke}]^7 to change pitch\nPush ^3"+use+"^7 or ^3[{+melee}]^7 to turn\n Push ^3[{+attack}]^7 or ^3[{+speed_throw}]^7 to ^1FIRE"); 
                    if(!pressed) 
                    while(player fragbuttonpressed()) 
                    { 
                            pressed = 1; 
                            level.turn unlink(); 
                            if(level.pitch.angles[2] <= 37.5) 
                                    level.pitch rotateto(level.pitch.angles+(0,0,2), 0.2); 
                            wait 0.2; 
                    } 
                    if(!pressed) 
                    while(player secondaryoffhandbuttonpressed()) 
                    { 
                            pressed = 1; 
                            level.turn unlink(); 
                            if(level.pitch.angles[2] >= -22) 
                                    level.pitch rotateto(level.pitch.angles-(0,0,2), 0.2); 
                            wait 0.2; 
                    } 
                    if(!pressed) 
                    while(player meleebuttonpressed()) 
                    { 
                            pressed = 1; 
                            level.pitch rotateto(level.pitch.angles-(0,2,0), 0.2); 
                            wait 0.2; 
                    } 
                    if(!pressed) 
                    while(player usebuttonpressed()) 
                    { 
                            pressed = 1; 
                            level.pitch rotateto(level.pitch.angles+(0,2,0), 0.2); 
                            wait 0.2; 
                    } 
                    if(!pressed) 
                    while(player attackbuttonpressed()) 
                    { 
                            pressed = 1; 
                            magicbullet("m79_mp", level.gunpos.origin, level.gunpos.origin+anglestoforward(level.gunpos.angles)*10000); 
                            wait 0.5; 
                    } 
                    if(!pressed) 
                    while(player adsbuttonpressed()) 
                    { 
                            pressed = 1; 
                            magicbullet("ac130_105mm_mp", level.gunpos.origin, level.gunpos.origin+anglestoforward(level.gunpos.angles)*10000); 
                            earthquake( 0.5, 0.75, level.turn.origin, 800 ); 
                            player playSound( "exp_airstrike_bomb" ); 
                            playfx(level.chopper_fx["explode"]["medium"], level.gunpos.origin); 
                            for(i=0;i<=6;i++) 
                            { 
                                    level.barrel[i] unlink(); 
                                    level.barrel[i] moveto(level.barrel[i].origin-anglestoforward(level.barrel[i].angles)*50, 0.05); 
                            } 
                            wait 0.1; 
                            for(i=0;i<=6;i++) 
                                    level.barrel[i] moveto(level.barrel[i].origin-anglestoforward(level.barrel[i].angles)*-50, 0.5, 0.4, 0.1); 
                            wait 2; 
                    } 
                    foreach(swivel in level.swivel) 
                            swivel linkto(level.turn); 
                    level.turn linkto(level.pitch); 
                    foreach(barrel in level.barrel) 
                            barrel linkto(level.pitch); 
                    wait 0.05; 
            } 
    }
    Last edited by alistair4322; 10-04-2010 at 08:39 AM.

  2. #2
    maarten551's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    255
    Reputation
    10
    Thanks
    75
    My Mood
    Mellow
    hmmm,i think you need to
    Code:
    CreateCannon(pos);
    {
    length = pos[0];
    width = pos[1];
    height = pos[2];
    block1 = lenght - 0,57; // or something like that
    
    // rest of the calculations and shit
    }
    
    afghan()
    {
    CreateCannon((-240, 1640, 422));
    // rest
    don't really know either /
    Last edited by maarten551; 10-03-2010 at 12:57 PM.

    My Youtube account : Maarten551, subscribe me ^^
    [YOUTUBE]lSl0HlhGQsY[/YOUTUBE]
    AIzombies for Alteriw, Check it now!
    [YOUTUBE]U9OjBsHgcKQ[/YOUTUBE]
    hover/cordinates mod with visible bunkers!!!
    ---------------------------------------------------
    Most important waittills

  3. #3
    [WhA]4FunPlayin's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Not here
    Posts
    757
    Reputation
    8
    Thanks
    169
    My Mood
    Lonely
    Code:
    CreateCannon(pos)
    And you do
    Code:
    CreateCannon(-240, 1640, 422);
    Wrong.
    Code:
    CreateCannon((-240, 1640, 422));
    Fixed.

    You did 3 (x , y , z) things in "pos", which isn't x,y,z, it's x+y+z. Can't explain better.

  4. #4
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Quote Originally Posted by [WhA]4FunPlayin View Post
    Code:
    CreateCannon(pos)
    And you do
    Code:
    CreateCannon(-240, 1640, 422);
    Wrong.
    Code:
    CreateCannon((-240, 1640, 422));
    Fixed.

    You did 3 (x , y , z) things in "pos", which isn't x,y,z, it's x+y+z. Can't explain better.
    Any example?
    I just want to change the center spawn pos in 2nd line...
    And I wish I can use
    Code:
    CreateCannon(-240, 1640, 422);
    to create a cannon
    Last edited by alistair4322; 10-04-2010 at 04:44 AM.

  5. #5
    [WhA]4FunPlayin's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Not here
    Posts
    757
    Reputation
    8
    Thanks
    169
    My Mood
    Lonely
    My English isn't bad.. but IDK how to explain this, well look
    if you have for example
    Code:
    function_here.. (do1)
    you can use it like
    Code:
    function_here.. (do1thing, do2thing, do3thing);
    because only do1thing is defined in the function_here,
    Code:
    function_here.. (do1)
    As you can see only do1 is defined.

    like:
    Code:
    function_here.. (do1, do2, do3)
    that will work if you will do
    Code:
    function_here.. (do1thing, do2thing, do3thing)
    let's look at your function, and IW's setOrigin function:

    IW's setOrigin Function:
    Code:
    setOrigin(newpos)
    and in code it's used like:
    Code:
    self setOrigin((0, 0, 0));
    you probably don't understand why it works, well it's because there is extra () over there, that extra () makes the (0,0,0) defined as the pos in setOrigin function.

    Now to yours:
    Code:
    CreateCannon(-240, 1640, 422);
    won't work, no extra ()
    Code:
    CreateCannon((-240, 1640, 422));
    That should work

  6. #6
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Thanks but still can't correct my code...
    Last edited by Blubb1337; 10-04-2010 at 01:53 PM.

  7. #7
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,923
    Reputation
    161
    Thanks
    3,096
    Do not quote long messages please.



  8. #8
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Quote Originally Posted by Blubb1337 View Post
    Do not quote long messages please.
    Oh...Sorry for that

Similar Threads

  1. [Help Request] Need some help with my server premisions
    By pero122 in forum Minecraft Help
    Replies: 5
    Last Post: 11-07-2011, 11:55 PM
  2. [Help Request] Need some help to make a bot
    By Domo in forum Vindictus Help
    Replies: 6
    Last Post: 05-21-2011, 11:15 AM
  3. [Help Request] I need some help with binding eps7
    By v1zhaixingv1 in forum Vindictus Help
    Replies: 3
    Last Post: 05-18-2011, 10:25 PM
  4. need some help with client exe.
    By barney in forum Hack Requests
    Replies: 2
    Last Post: 11-03-2006, 11:05 PM
  5. my sig is done but i need some help
    By A7X Oblivian in forum Help & Requests
    Replies: 0
    Last Post: 02-21-2006, 01:24 AM