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-06-2011, 05:29 PM #29
Originally posted by 247Yamato View Post
Was going to say that but I didnt found the right words, Awesome face
He must have a guilty conscience about something? Winky Winky

The following user thanked x_DaftVader_x for this useful post:

247Yamato
12-06-2011, 06:25 PM #30
Jacob-And-Britt
I’m too L33T
Hawkin thanks for the reply and im sorry i worded that wrong i meant to say like i got the zip line in the place i like it but when you get on it it will take you to this random place and it kind puts you under the map i want to know how to change the location of the zip line that it takes you to.
12-06-2011, 06:52 PM #31
Hawkin
Lord of the Undead
Originally posted by jbglitching View Post
Hawkin thanks for the reply and im sorry i worded that wrong i meant to say like i got the zip line in the place i like it but when you get on it it will take you to this random place and it kind puts you under the map i want to know how to change the location of the zip line that it takes you to.


You have to have the coodinates wrong. Maybe something needs a -
12-06-2011, 07:05 PM #32
Jacob-And-Britt
I’m too L33T
Originally posted by Hawkin View Post
You have to have the coodinates wrong. Maybe something needs a -


Ok well it seems like every time i edit it it just move the pan looking think or the red light heres my code for a lift in backlot.This isint it this is one of yours
CrZip((-546,-1768,586),(474,1785,592),1); what part of that do i change to fix my problem?
12-07-2011, 11:22 PM #33
Hawkin
Lord of the Undead
Originally posted by jbglitching View Post
Ok well it seems like every time i edit it it just move the pan looking think or the red light heres my code for a lift in backlot.This isint it this is one of yours
CrZip((-546,-1768,586),(474,1785,592),1); what part of that do i change to fix my problem?
Did you change any of the zipline code? I can't check you coodinates. You have to goto the spots and get the numbers again.
12-08-2011, 02:35 PM #34
Jacob-And-Britt
I’m too L33T
Originally posted by Hawkin View Post
Did you change any of the zipline code? I can't check you coodinates. You have to goto the spots and get the numbers again.
Thanks i got every thing workingClaps i just got one more question for you.. Im putting hidden flags in the map edits and on the mini map it shows were they are do you know how to make it were it won't show my hidden flags lol.
12-09-2011, 06:00 AM #35
Hawkin
Lord of the Undead
Originally posted by jbglitching View Post
Thanks i got every thing workingClaps i just got one more question for you.. Im putting hidden flags in the map edits and on the mini map it shows were they are do you know how to make it were it won't show my hidden flags lol.


,1


----------------------------
12-09-2011, 11:01 AM #36
Jacob-And-Britt
I’m too L33T
Originally posted by Hawkin View Post
,1


----------------------------

Thanks that worked i just got 2 and only 2 more problem well.. 3ok
1:I tryed making carepack walls but when i did that and i put in the code it diddnt work it wasent there?
2:How do i add a force field?
3:When i added a store item ot worked it was there but unlike the other ones like when you scroll down the store it will only scroll through options of 1 but then i added a store item and it put 2 together???? How do i fix this. o and 1 more.
4:How do i make it to were if you teleport through sertin flags it will say something on your screen like iprintinbold ("Zombie")?
12-09-2011, 05:00 PM #37
oO-GKUSH-Oo
< ^ > < ^ >
Originally posted by jbglitching View Post
Thanks that worked i just got 2 and only 2 more problem well.. 3ok
1:I tryed making carepack walls but when i did that and i put in the code it diddnt work it wasent there?

Suggestions
Make sure you have the boxes precached
Make sure your heights arent the same

The following user thanked oO-GKUSH-Oo for this useful post:

Hawkin

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo