Post: Got a COD4, WAW, or MW2 GSC Coding Question? Ask Hawkin.
12-04-2011, 03:03 PM #1
Hawkin
Lord of the Undead
(adsbygoogle = window.adsbygoogle || []).push({}); OK I get so many messages asking me for help with a gsc they are working on I end up answering the same questions over and over. So I figured I would just start this thread.

This is for GSC Coding questions only!
DO NOT ask me how to Jailbreak your PS3.

If you ask me a stupid question I will ignore it.

If you ask me a total DUMB A** question, one that is not about GSC coding, you will wish I'd ignored it.

I will answer your question when I get to it DO NOT be Annoying.

I'll start by posting a question I just recently answered.


---------- Post added at 10:03 AM ---------- Previous post was at 10:00 AM ----------

QUESTION: Well basically I'm making zombieland for W@W and I've sorted everything apart from the map edits. This is one of my scripts but when I go to the flag it's ment to teleport you to the other flag, but when I put self setOrigin(self.origin +("position here")); it spawns me in the wrong place like out of the map :S and when I put self MoveTo("position here"); it does nothing :/ could you help me bro?

ANSWER:
You problem is you are not using SetOrigin correctly. SetOrigin sets a players position. It only requires the location of where you want the player to be. It teleports you. You are telling it to teleport you to the players origin + the location. It should be
    self SetOrigin(x,y,z);

I also am not sure you understand the difference between a self thread and a level thread.
Moveto moves Script_model, or script_origin. It will not move a player unless you link a player to one first.
You are basically trying to reinventing the wheel. Just take the flag code from COD4 Zombieland. Every (99.9%) code from cod4 will work in WAW. The models, fxs, and sounds may not work from one to another, but the commands will.
Also you don't need to make a separate thread everytime you want to make a flag. Just make one, then reference like this code below will work in waw to do what you are trying to do.
When you want to put a flag on a certian map. just put this line of code.
    CrFlag(enter, exit, vis, radius, angle);

enter=start pos, exit=end pos. Vis, radius and angle can be left blank, and it will default to a visible flag with a 50 radius, and angle of (0,0,0). vis can be either 1 or 0, 1=hidden flag, 0 is not. Radius is how close someone has to get to the flag before it works.
these are examples.

    CrFlag((5997, 6286, 115), (9127, 3496, 135));
CrFlag((5997, 6286, 115), (9127, 3496, 135),1,100,(0,57,0));


    CrFlag(enter, exit, vis, radius, angle)
{ if(!isDefined(vis)) vis = 0;
if(!isDefined(angle))angle = (0,0,0);
if(!isDefined(radius)) radius = 50;
flag = spawn( "script_model", enter);
flag setModel( "prop_flag_american" );
flag.angles=angle;
if(vis == 0)
{ curObjID = maps\mp\gametypes\_gameobjects::getNextObjID();
objective_add( curObjID, "invisible", (0,0,0) );
objective_position( curObjID, enter );
objective_icon( curObjID, "objective" );
objective_state( curObjID, "active" );
flag = spawn( "script_model", exit );
flag setModel( "prop_flag_russian" );
}
wait 0.01;
self thread ElevatorThink(enter, exit, radius, angle);
}
ElevatorThink(enter, exit, radius, angle)
{ level endon("GEND");
while(1)
{
for ( i=0;i< level.players.size;i++ )
{ p = level.players[i];
if(Distance(enter, p.origin) <= radius){
p SetOrigin(exit);
p SetPlayerAngles(angle);
}
}
wait .25;
}
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 9 users say thank you to Hawkin for this useful post:

247Yamato, Baby-panama, BlazingDope, IELIITEMODZX, IVI40A3Fusionz, lallyman, Sterg, oO-GKUSH-Oo, x_DaftVader_x
12-04-2011, 07:44 PM #11
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by x. View Post
I bet that some people don't find it funny though.. I expect it will get a few groans stare


I think you will get more than just a few groans, first it will be a the person that i think your talking about then his fan boys :p.

P.S: You need to get Skype so i can show you something :p.
12-04-2011, 09:04 PM #12
Originally posted by IVI40A3Fusionz View Post


Here as you keep bugging everyone about it, you can add verification and how to get back to the player menu from the player options yourself.

    //Sub Menu 8 
level.MenuName[7] = "Player Menu";
level.SubMenuOptions[7] = 11;
level.name[7] = [];
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
level.name[7][p] = "[" + player.verstat + "]" + player.name;
level.funcs[7][p] = ::;//Add Submenu Function Here!
level.input[7][p] = ;//Add What Sub Menu You Want It To Go To Here!
}


how i add a submenu to the player menu?

The following user thanked ThePhantom410. for this useful post:

247Yamato
12-04-2011, 09:09 PM #13
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by sniipezZ View Post
how i add a submenu to the player menu?


You can figure that out yourself :p, I've had to make an unstable menu stable and add player and verification stuff to it by myself (not that hard to do) and you should be able to do the same Smile. You'll only learn if you do it yourself.
12-04-2011, 09:24 PM #14
Originally posted by IVI40A3Fusionz View Post
You can figure that out yourself :p, I've had to make an unstable menu stable and add player and verification stuff to it by myself (not that hard to do) and you should be able to do the same Smile. You'll only learn if you do it yourself.


i try'ed it myself like this:
    //Player Menu 
level.MenuName[7] = "Player Menu";
level.SubMenuOptions[7] = 11;
level.name[7] = [];
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
level.name[7][p] = "[" + player.verstat + "]" + player.name;
level.funcs[7][p] = :: subMenu;
level.input[7][p] = "8";

//player options
level.SubMenuOptions[8] = 11;
level.name[8] = [];
level.name[8][0] = "Test";
level.name[8][1] = "Test";
level.name[8][2] = "Test";
level.name[8][3] = "Test";
level.name[8][4] = "Test";
level.name[8][5] = "Test";
level.name[8][6] = "Test";
level.name[8][7] = "Test";
level.name[8][8] = "Test";
level.name[8][9] = "Test";
level.name[8][10] = "Test";
level.funcs[8] = [];
level.funcs[8][0] = :: test;
level.funcs[8][1] = :: test;
level.funcs[8][2] = :: test;
level.funcs[8][3] = :: test;
level.funcs[8][4] = :: test;
level.funcs[8][5] = :: test;
level.funcs[8][6] = :: test;
level.funcs[8][7] = :: test;
level.funcs[8][8] = :: test;
level.funcs[8][9] = :: test;
level.funcs[8][10] = :: test;


but it dnt go -.-

pls say how to fix it pleaasee ^^
that will be my last question...
12-04-2011, 09:28 PM #15
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by sniipezZ View Post
i try'ed it myself like this:
    //Player Menu 
level.MenuName[7] = "Player Menu";
level.SubMenuOptions[7] = 11;
level.name[7] = [];
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
level.name[7][p] = "[" + player.verstat + "]" + player.name;
level.funcs[7][p] = :: subMenu;
level.input[7][p] = "8";

//player options
level.SubMenuOptions[8] = 11;
level.name[8] = [];
level.name[8][0] = "Test";
level.name[8][1] = "Test";
level.name[8][2] = "Test";
level.name[8][3] = "Test";
level.name[8][4] = "Test";
level.name[8][5] = "Test";
level.name[8][6] = "Test";
level.name[8][7] = "Test";
level.name[8][8] = "Test";
level.name[8][9] = "Test";
level.name[8][10] = "Test";
level.funcs[8] = [];
level.funcs[8][0] = :: test;
level.funcs[8][1] = :: test;
level.funcs[8][2] = :: test;
level.funcs[8][3] = :: test;
level.funcs[8][4] = :: test;
level.funcs[8][5] = :: test;
level.funcs[8][6] = :: test;
level.funcs[8][7] = :: test;
level.funcs[8][8] = :: test;
level.funcs[8][9] = :: test;
level.funcs[8][10] = :: test;


but it dnt go -.-

pls say how to fix it pleaasee ^^
that will be my last question...


Where in your coding it says:
    subMenu()

you need to change it to:
    subMenu(value)

then change a few more things like when you open the menu use:
    self thread subMenu(0);


What it will do it what ever the value you've put it will go to that sub menu.

EDIT: Add me on Skype! IVI40A3Fusionz

The following 2 users say thank you to IVI40A3Fusionz for this useful post:

Hawkin, oO-GKUSH-Oo
12-04-2011, 09:37 PM #16
so when i did that how i have to tread it in the Player menu?

like this ?

level.name[7][p] = "[" + player.verstat + "]" + player.name;
level.funcs[7][p] = :: subMenu1;
level.input[7][p] = "8";
12-04-2011, 09:40 PM #17
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by sniipezZ View Post
so when i did that how i have to tread it in the Player menu?

like this ?

level.name[7][p] = "[" + player.verstat + "]" + player.name;
level.funcs[7][p] = :: subMenu1;
level.input[7][p] = "8";


Like this:

    //Player Menu 
level.MenuName[7] = "Player Menu";
level.SubMenuOptions[7] = 11;
level.name[7] = [];
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
level.name[7][p] = "[" + player.verstat + "]" + player.name;
level.funcs[7][p] = :: subMenu;
level.input[7][p] = 8;

//player options
level.SubMenuOptions[8] = 11;
level.name[8] = [];
level.name[8][0] = "Test";
level.name[8][1] = "Test";
level.name[8][2] = "Test";
level.name[8][3] = "Test";
level.name[8][4] = "Test";
level.name[8][5] = "Test";
level.name[8][6] = "Test";
level.name[8][7] = "Test";
level.name[8][8] = "Test";
level.name[8][9] = "Test";
level.name[8][10] = "Test";
level.funcs[8] = [];
level.funcs[8][0] = :: test;
level.funcs[8][1] = :: test;
level.funcs[8][2] = :: test;
level.funcs[8][3] = :: test;
level.funcs[8][4] = :: test;
level.funcs[8][5] = :: test;
level.funcs[8][6] = :: test;
level.funcs[8][7] = :: test;
level.funcs[8][8] = :: test;
level.funcs[8][9] = :: test;
level.funcs[8][10] = :: test;


Winky Winky.
12-04-2011, 10:02 PM #18
Originally posted by IVI40A3Fusionz View Post
Like this:

    //Player Menu 
level.MenuName[7] = "Player Menu";
level.SubMenuOptions[7] = 11;
level.name[7] = [];
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
level.name[7][p] = "[" + player.verstat + "]" + player.name;
level.funcs[7][p] = :: subMenu;
level.input[7][p] = 8;

//player options
level.SubMenuOptions[8] = 11;
level.name[8] = [];
level.name[8][0] = "Test";
level.name[8][1] = "Test";
level.name[8][2] = "Test";
level.name[8][3] = "Test";
level.name[8][4] = "Test";
level.name[8][5] = "Test";
level.name[8][6] = "Test";
level.name[8][7] = "Test";
level.name[8][8] = "Test";
level.name[8][9] = "Test";
level.name[8][10] = "Test";
level.funcs[8] = [];
level.funcs[8][0] = :: test;
level.funcs[8][1] = :: test;
level.funcs[8][2] = :: test;
level.funcs[8][3] = :: test;
level.funcs[8][4] = :: test;
level.funcs[8][5] = :: test;
level.funcs[8][6] = :: test;
level.funcs[8][7] = :: test;
level.funcs[8][8] = :: test;
level.funcs[8][9] = :: test;
level.funcs[8][10] = :: test;


Winky Winky.



Ok take a look at this and say if its right or not

    START(){self thread Buttons();self thread iniMenuVars();self.MenuOpen = false;}
Buttons()
{
self endon("disconnect");
for(;Winky Winky
{
if(self AttackButtonPressed() && self.MenuOpen == true)
{
self notify("scrollDown");
self.scroll++;
self thread checkScroll();
self thread subMenu(0);
self playSound("ui_mp_suitcasebomb_timer");
wait .3;
}
if(self AdsButtonPressed() && self.MenuOpen == true)
{
self notify("scrollUp");
self.scroll--;
self thread checkScroll();
self thread subMenu(0);
self playSound("ui_mp_suitcasebomb_timer");
wait .3;
}
if(self SecondaryOffhandButtonPressed() && self.MenuOpen == true)
{
self notify("cycleLeft");
self.cycle--;
self.scroll = 0;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu(0);
self playSound("ui_mp_suitcasebomb_timer");
wait .3;
}
if(self FragButtonPressed() && self.MenuOpen == true)
{
self notify("cycleRight");
self.cycle++;
self.scroll = 0;
self thread checkCycle();
self thread topLevelMenu();
self thread subMenu(0);
self playSound("ui_mp_suitcasebomb_timer");
wait .3;
}
if(self UseButtonPressed() && self.MenuOpen == true)
{
self thread [[level.funcs[self.cycle][self.scroll]]](level.input[self.cycle][self.scroll]);
wait .3;
}
if(self MeleeButtonPressed())
{
if(self.MenuOpen == false)
{
self thread iniMenuVars();
self.MenuOpen = true;
self freezeControls(true);
self.blackscreen = set_hudelem(undefined, 320, 67, 1, 0, self);
self.blackscreen setshader("white", 320, 635);
self.blackscreen.alpha = 0.7;
self.blackscreen.color =(0, 0, 0);
self.blackscreen.sort = -5;
self thread topLevelMenu();
self thread subMenu(0);
}
else
{
self freezeControls(false);
self.blackscreen.alpha = 0;
self notify("exitMenu");
self.MenuOpen = false;
}
wait .3;
}
wait .05;
}
}

set_hudelem(text, x, y, scale, alpha, player)
{
if(!IsDefined(alpha))
{
alpha = 1;
}
if(!IsDefined(scale))
{
scale = 1;
}
hud = newClientHudElem(player);
hud.location = 0;
hud.alignX = "center";
hud.alignY = "middle";
hud.foreground = 0;
hud.fontScale = scale;
hud.sort = 20;
hud.alpha = alpha;
hud.x = x;
hud.y = y;
hud.og_scale = scale;
if(IsDefined(text))
{
hud SetText(text);
}
return hud;
}

iniMenuVars()
{
self.cycle = 0;
self.scroll = 0;
self.MenuOpen = false;
level.menuX = 100;
level.menuY = 20;
level.topLevelMenuOptions = 9;
level.SubMenuOptions = [];

//Sub Menu 1
level.MenuName[0] = "Sub Menu 1";
level.SubMenuOptions[0] = 11;
level.name[0] = [];
level.name[0][0] = "Test";
level.name[0][1] = "Test";
level.name[0][2] = "Test";
level.name[0][3] = "Test";
level.name[0][4] = "Test";
level.name[0][5] = "Test";
level.name[0][6] = "Test";
level.name[0][7] = "Test";
level.name[0][8] = "Test";
level.name[0][9] = "Test";
level.name[0][10] = "Test";
level.funcs[0] = [];
level.funcs[0][0] = :: test;
level.funcs[0][1] = :: test;
level.funcs[0][2] = :: test;
level.funcs[0][3] = :: test;
level.funcs[0][4] = :: test;
level.funcs[0][5] = :: test;
level.funcs[0][6] = :: test;
level.funcs[0][7] = :: test;
level.funcs[0][8] = :: test;
level.funcs[0][9] = :: test;
level.funcs[0][10] = :: test;
level.input[0] = [];
level.input[0][0] = "";
level.input[0][1] = "";
level.input[0][2] = "";
level.input[0][3] = "";
level.input[0][4] = "";
level.input[0][5] = "";
level.input[0][6] = "";
level.input[0][7] = "";
level.input[0][8] = "";
level.input[0][9] = "";
level.input[0][10] = "";

//Sub Menu 2
level.MenuName[1] = "Sub Menu 2";
level.SubMenuOptions[1] = 9;
level.name[1] = [];
level.name[1][0] = "Test";
level.name[1][1] = "Test";
level.name[1][2] = "Test";
level.name[1][3] = "Test";
level.name[1][4] = "Test";
level.name[1][5] = "Test";
level.name[1][6] = "Test";
level.name[1][7] = "Test";
level.name[1][8] = "Test";
level.funcs[1] = [];
level.funcs[1][0] = :: test;
level.funcs[1][1] = :: test;
level.funcs[1][2] = :: test;
level.funcs[1][3] = :: test;
level.funcs[1][4] = :: test;
level.funcs[1][5] = :: test;
level.funcs[1][6] = :: test;
level.funcs[1][7] = :: test;
level.funcs[1][8] = :: test;
level.input[1] = [];
level.input[1][0] = "";
level.input[1][1] = "";
level.input[1][2] = "";
level.input[1][3] = "";
level.input[1][4] = "";
level.input[1][5] = "";
level.input[1][6] = "";
level.input[1][7] = "";
level.input[1][8] = "";

//Sub Menu 3
level.MenuName[2] = "Sub Menu 3";
level.SubMenuOptions[2] = 7;
level.name[2] = [];
level.name[2][0] = "Test";
level.name[2][1] = "Test";
level.name[2][2] = "Test";
level.name[2][3] = "Test";
level.name[2][4] = "Test";
level.name[2][5] = "Test";
level.name[2][6] = "Test";
level.funcs[2] = [];
for(j = 0; j < 7; j++)
{
level.funcs[2][j] = ::test;
}
level.input[2] = [];
level.input[2][0] = "";
level.input[2][1] = "";
level.input[2][2] = "";
level.input[2][3] = "";
level.input[2][4] = "";
level.input[2][5] = "";
level.input[2][6] = "";

//Sub Menu 4
level.MenuName[3] = "Sub Menu 4";
level.SubMenuOptions[3] = 11;
level.name[3] = [];
level.name[3][0] = "Test";
level.name[3][1] = "Test";
level.name[3][2] = "Test";
level.name[3][3] = "Test";
level.name[3][4] = "Test";
level.name[3][5] = "Test";
level.name[3][6] = "Test";
level.name[3][7] = "Test";
level.name[3][8] = "Test";
level.name[3][9] = "Test";
level.name[3][10] = "Test";
level.funcs[3] = [];
level.funcs[3][0] = :: test;
level.funcs[3][1] = :: test;
level.funcs[3][2] = :: test;
level.funcs[3][3] = :: test;
level.funcs[3][4] = :: test;
level.funcs[3][5] = :: test;
level.funcs[3][6] = :: test;
level.funcs[3][7] = :: test;
level.funcs[3][8] = :: test;
level.funcs[3][9] = :: test;
level.funcs[3][10] = :: test;
level.input[3] = [];
level.input[3][0] = "";
level.input[3][1] = "";
level.input[3][2] = "";
level.input[3][3] = "";
level.input[3][4] = "";
level.input[3][5] = "";
level.input[3][6] = "";
level.input[3][7] = "";
level.input[3][8] = "";
level.input[3][9] = "";
level.input[3][10] = "";

//Sub Menu 5
level.MenuName[4] = "Sub Menu 5";
level.SubMenuOptions[4] = 11;
level.name[4] = [];
level.name[4][0] = "HDF";
level.name[4][1] = "Test";
level.name[4][2] = "Test";
level.name[4][3] = "Test";
level.name[4][4] = "Test";
level.name[4][5] = "Test";
level.name[4][6] = "Test";
level.name[4][7] = "Test";
level.name[4][8] = "Test";
level.name[4][9] = "Test";
level.name[4][10] = "Test";
level.funcs[4] = [];
level.funcs[4][0] = :: doWelcome;
level.funcs[4][1] = :: test;
level.funcs[4][2] = :: test;
level.funcs[4][3] = :: test;
level.funcs[4][4] = :: test;
level.funcs[4][5] = :: test;
level.funcs[4][6] = :: test;
level.funcs[4][7] = :: test;
level.funcs[4][8] = :: test;
level.funcs[4][9] = :: test;
level.funcs[4][10] = :: test;
level.input[4] = [];
level.input[4][0] = "Rank Me Up";
level.input[4][1] = "";
level.input[4][2] = "";
level.input[4][3] = "";
level.input[4][4] = "";
level.input[4][5] = "";
level.input[4][6] = "";
level.input[4][7] = "";
level.input[4][8] = "";
level.input[4][9] = "";
level.input[4][10] = "";

//Sub Menu 6
level.MenuName[5] = "Sub Menu 6";
level.SubMenuOptions[5] = 11;
level.name[5] = [];
level.name[5][0] = "Test";
level.name[5][1] = "Test";
level.name[5][2] = "Test";
level.name[5][3] = "Test";
level.name[5][4] = "Test";
level.name[5][5] = "Test";
level.name[5][6] = "Test";
level.name[5][7] = "Test";
level.name[5][8] = "Test";
level.name[5][9] = "Test";
level.name[5][10] = "Test";
level.funcs[5] = [];
level.funcs[5][0] = :: test;
level.funcs[5][1] = :: test;
level.funcs[5][2] = :: test;
level.funcs[5][3] = :: test;
level.funcs[5][4] = :: test;
level.funcs[5][5] = :: test;
level.funcs[5][6] = :: test;
level.funcs[5][7] = :: test;
level.funcs[5][8] = :: test;
level.funcs[5][9] = :: test;
level.funcs[5][10] = :: test;
level.input[5] = [];
level.input[5][0] = "";
level.input[5][1] = "";
level.input[5][2] = "";
level.input[5][3] = "";
level.input[5][4] = "";
level.input[5][5] = "";
level.input[5][6] = "";
level.input[5][7] = "";
level.input[5][8] = "";
level.input[5][9] = "";
level.input[5][10] = "";

//Sub Menu 7
level.MenuName[6] = "Sub Menu 7";
level.SubMenuOptions[6] = 11;
level.name[6] = [];
level.name[6][0] = "Test";
level.name[6][1] = "Test";
level.name[6][2] = "Test";
level.name[6][3] = "Test";
level.name[6][4] = "Test";
level.name[6][5] = "Test";
level.name[6][6] = "Test";
level.name[6][7] = "Test";
level.name[6][8] = "Test";
level.name[6][9] = "Test";
level.name[6][10] = "Test";
for(s = 0; s < 11; s++)
{
level.funcs[6][s] = ::test;
}
level.input[6] = [];
level.input[6][0] = "";
level.input[6][1] = "";
level.input[6][2] = "";
level.input[6][3] = "";
level.input[6][4] = "";
level.input[6][5] = "";
level.input[6][6] = "";
level.input[6][7] = "";
level.input[6][8] = "";
level.input[6][9] = "";
level.input[6][10] = "";

//Player Menu
level.MenuName[7] = "Player Menu";
level.SubMenuOptions[7] = 11;
level.name[7] = [];
for(p = 0; p < level.players.size; p++)
{
player = level.players[p];
level.name[7][p] = "[" + player.verstat + "]" + player.name;
level.funcs[7][p] = :: subMenu;
level.input[7][p] = "8";

//player options
level.SubMenuOptions[8] = 11;
level.name[8] = [];
level.name[8][0] = "Test";
level.name[8][1] = "Test";
level.name[8][2] = "Test";
level.name[8][3] = "Test";
level.name[8][4] = "Test";
level.name[8][5] = "Test";
level.name[8][6] = "Test";
level.name[8][7] = "Test";
level.name[8][8] = "Test";
level.name[8][9] = "Test";
level.name[8][10] = "Test";
level.funcs[8] = [];
level.funcs[8][0] = :: test;
level.funcs[8][1] = :: test;
level.funcs[8][2] = :: test;
level.funcs[8][3] = :: test;
level.funcs[8][4] = :: test;
level.funcs[8][5] = :: test;
level.funcs[8][6] = :: test;
level.funcs[8][7] = :: test;
level.funcs[8][8] = :: test;
level.funcs[8][9] = :: test;
level.funcs[8][10] = :: test;
}
}
topLevelMenu()
{
self endon("cycleRight");
self endon("cycleLeft");
self endon("exitMenu");
topLevelMenu = [];
for(i = -1; i < 2; i++)
{
topLevelMenu[i+1] = self createFontString("default", 1.7);
topLevelMenu[i+1] setPoint("CENTER", "TOP",(i)*level.menuX,(-1)*level.menuY+20);
if((i + self.cycle) < 0)
{
topLevelMenu[i+1] setText(level.MenuName[i + self.cycle + level.topLevelMenuOptions]);
}
else if((i + self.cycle) > level.topLevelMenuOptions - 1)
{
topLevelMenu[i+1] setText(level.MenuName[i + self.cycle - level.topLevelMenuOptions]);
}
else
{
topLevelMenu[i+1] setText(level.MenuName[i + self.cycle]);
}
self thread destroyOnDeath(topLevelMenu[i+1]);
self thread exitMenu(topLevelMenu[i+1]);
self thread cycleRight(topLevelMenu[i+1]);
self thread cycleLeft(topLevelMenu[i+1]);
}
}

subMenu(value)
{
self endon("cycleRight");
self endon("cycleLeft");
self endon("exitMenu");
subMenu = [];
for(i = 0; i < level.SubMenuOptions[self.cycle]; i++)
{
subMenu[i] = self createFontString("default", 1.5);
subMenu[i] setPoint("CENTER", "TOP", 0, i*level.menuY+20);
if(i != self.scroll)
{
subMenu[i] setText(level.name[self.cycle][i]);
}
else
{
subMenu[i] setText("^1" + level.name[self.cycle][i]);
}
self thread destroyOnDeath(subMenu[i]);
self thread exitMenu(subMenu[i]);
self thread cycleRight(subMenu[i]);
self thread cycleLeft(subMenu[i]);
self thread scrollUp(subMenu[i]);
self thread scrollDown(subMenu[i]);
}
}
destroyOnDeath(hudElem){self waittill("death");hudElem destroy();}
destroyOnExitMenu(hudElem){self waittill("exitMenu");self.MenuOpen = false;hudElem destroy();}
exitMenu(menu){self waittill("exitMenu");menu destroy();self.MenuOpen = false;}
cycleRight(menu){self waittill("cycleRight");menu destroy();}
cycleLeft(menu){self waittill("cycleLeft");menu destroy();}
scrollUp(menu){self waittill("scrollUp");menu destroy();}
scrollDown(menu){self waittill("scrollDown");menu destroy();}
checkCycle(){if(self.cycle > level.topLevelMenuOptions - 1){self.cycle = self.cycle - level.topLevelMenuOptions;}else if(self.cycle < 0){self.cycle = self.cycle + level.topLevelMenuOptions;}}
checkScroll(){if(self.scroll < 0){self.scroll = 0;}else if(self.scroll > level.SubMenuOptions[self.cycle] - 1){self.scroll = level.SubMenuOptions[self.cycle] - 1;}}
test(){self iprintlnbold("hi");}


---------- Post added at 05:02 PM ---------- Previous post was at 04:46 PM ----------

Originally posted by IVI40A3Fusionz View Post

EDIT: Add me on Skype! IVI40A3Fusionz


i did
__________
12-05-2011, 02:24 AM #19
Choco
Respect my authoritah!!
Originally posted by Hawkin View Post
OK I get so many messages asking me for help with a gsc they are working on I end up answering the same questions over and over. So I figured I would just start this thread.

This is for GSC Coding questions only!
DO NOT ask me how to Jailbreak your PS3.

If you ask me a stupid question I will ignore it.

If you ask me a total DUMB A** question, one that is not about GSC coding, you will wish I'd ignored it.

I will answer your question when I get to it DO NOT be Annoying.

I'll start by posting a question I just recently answered.


---------- Post added at 10:03 AM ---------- Previous post was at 10:00 AM ----------

QUESTION: Well basically I'm making zombieland for W@W and I've sorted everything apart from the map edits. This is one of my scripts but when I go to the flag it's ment to teleport you to the other flag, but when I put self setOrigin(self.origin +("position here")); it spawns me in the wrong place like out of the map :S and when I put self MoveTo("position here"); it does nothing :/ could you help me bro?

ANSWER:
You problem is you are not using SetOrigin correctly. SetOrigin sets a players position. It only requires the location of where you want the player to be. It teleports you. You are telling it to teleport you to the players origin + the location. It should be
    self SetOrigin(x,y,z);

I also am not sure you understand the difference between a self thread and a level thread.
Moveto moves Script_model, or script_origin. It will not move a player unless you link a player to one first.
You are basically trying to reinventing the wheel. Just take the flag code from COD4 Zombieland. Every (99.9%) code from cod4 will work in WAW. The models, fxs, and sounds may not work from one to another, but the commands will.
Also you don't need to make a separate thread everytime you want to make a flag. Just make one, then reference like this code below will work in waw to do what you are trying to do.
When you want to put a flag on a certian map. just put this line of code.
    CrFlag(enter, exit, vis, radius, angle);

enter=start pos, exit=end pos. Vis, radius and angle can be left blank, and it will default to a visible flag with a 50 radius, and angle of (0,0,0). vis can be either 1 or 0, 1=hidden flag, 0 is not. Radius is how close someone has to get to the flag before it works.
these are examples.

    CrFlag((5997, 6286, 115), (9127, 3496, 135));
CrFlag((5997, 6286, 115), (9127, 3496, 135),1,100,(0,57,0));


    CrFlag(enter, exit, vis, radius, angle)
{ if(!isDefined(vis)) vis = 0;
if(!isDefined(angle))angle = (0,0,0);
if(!isDefined(radius)) radius = 50;
flag = spawn( "script_model", enter);
flag setModel( "prop_flag_american" );
flag.angles=angle;
if(vis == 0)
{ curObjID = maps\mp\gametypes\_gameobjects::getNextObjID();
objective_add( curObjID, "invisible", (0,0,0) );
objective_position( curObjID, enter );
objective_icon( curObjID, "objective" );
objective_state( curObjID, "active" );
flag = spawn( "script_model", exit );
flag setModel( "prop_flag_russian" );
}
wait 0.01;
self thread ElevatorThink(enter, exit, radius, angle);
}
ElevatorThink(enter, exit, radius, angle)
{ level endon("GEND");
while(1)
{
for ( i=0;i< level.players.size;i++ )
{ p = level.players[i];
if(Distance(enter, p.origin) <= radius){
p SetOrigin(exit);
p SetPlayerAngles(angle);
}
}
wait .25;
}
}


How would I go about making so that when I shoot a player, it freezes their controls?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo