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-05-2011, 11:34 PM #20
bad_carma
Usertitle?
i know its a dumb question, but im new to this as i only started looking into patches about a week ago. ive been trying to make my own personal edit just to try and learn how to do it and gradually attempt my own patch. and i was wondering how to change the color of a black shader. i have the shaders working i just ended up with a lime green color and i would like to put red. could you show me how shaders are color?
12-06-2011, 04:29 AM #21
Hawkin
Lord of the Undead
Originally posted by Correy View Post
your never on skype :(

yeah new games been busy

---------- Post added at 11:16 PM ---------- Previous post was at 11:15 PM ----------

Originally posted by 247Yamato View Post
GSC Coding questions, this is not a: I´ll make your mod.


no it is definitely not

---------- Post added at 11:25 PM ---------- Previous post was at 11:16 PM ----------

Originally posted by x. View Post
Dear Mr Hawkin,

I'm not sure if we've ever spoken before, so hi, nice to meet you.

I'm hoping you can help me with something.
Could you please tell me how to take an old Call of Duty mod, say a merry go round or something, and re write it so it looks like I did it myself.
It's just that I've seen quite a lot of this sort of thing going on lately and want to do it myself so I can release a video and get loads of "+rep" from the kids on here..

I know you're probably busy and you probably won't be able to reply to this, so let me just say that I've never actually played your "Zombie" games but I've been told they're ****ing brilliant so keep up the good work.

Thanks in advance,

Vader.

ps. Do you know how I can Jailbreak my PS3 so I can make some zombies for MW3 ?


Really, do we have to go there again? I've just packed all the weapons away, and thought the truce would stand. Please don't make me have to pull out all the BFGs again. As they are heavy and I am too bored to want do the work, but...
12-06-2011, 05:12 AM #22
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by Hawkin View Post
yeah new games been busy

---------- Post added at 11:16 PM ---------- Previous post was at 11:15 PM ----------



no it is definitely not

---------- Post added at 11:25 PM ---------- Previous post was at 11:16 PM ----------



Really, do we have to go there again? I've just packed all the weapons away, and thought the truce would stand. Please don't make me have to pull out all the BFGs again. As they are heavy and I am too bored to want do the work, but...

---------- Post added at 11:29 PM ---------- Previous post was at 11:25 PM ----------



umm no and I forget this is gsc question & answer only.


I did remember that this was a question towards Correy haha about gsc
12-06-2011, 07:44 AM #23
Jacob-And-Britt
I’m too L33T
Hey hawkin i am editing your cod 4 zombies im just adding a few store items and zip location how do i connect the ziplines and i added a new store item but its no there?? how do i fix please reply asap thanksSmile
12-06-2011, 12:01 PM #24
Originally posted by x. View Post
Dear Mr Hawkin,

I'm not sure if we've ever spoken before, so hi, nice to meet you.

I'm hoping you can help me with something.
Could you please tell me how to take an old Call of Duty mod, say a merry go round or something, and re write it so it looks like I did it myself.
It's just that I've seen quite a lot of this sort of thing going on lately and want to do it myself so I can release a video and get loads of "+rep" from the kids on here..

I know you're probably busy and you probably won't be able to reply to this, so let me just say that I've never actually played your "Zombie" games but I've been told they're ****ing brilliant so keep up the good work.

Thanks in advance,

Vader.


ps. Do you know how I can Jailbreak my PS3 so I can make some zombies for MW3 ?
wow you cant stop can you.
you call me a sad person lawl look at your self.
i said ill show you my scripts but no you keep saying no.

Ontopic: nice post hawkin this will help alot of people

The following user thanked IELIITEMODZX for this useful post:

1337HaXaLoT
12-06-2011, 01:21 PM #25
1337HaXaLoT
Bounty hunter
Nice post........
12-06-2011, 05:13 PM #26
Hawkin
Lord of the Undead
Originally posted by .Choco View Post
How would I go about making so that when I shoot a player, it freezes their controls?

Put this line in your OnPlayerSpawned thread before the for statement.

    self thread FireFreeze();


then put these threads somewhere else that is included in the same gsc with the onplayerSpawned.

    FireFreeze()
{ self endon("disconnect");
for(;Winky Winky
{ self waittill ( "damage", damage, attacker);
if(isAlive(self) && isDefined(attacker) && isPlayer(attacker) && attacker==level.players[0]) self thread Freezzyy();
wait .05;
}
}
Freezzyy()
{ self freezeControls( true );
wait 5;
self freezeControls( false );
}


the line wait 5 is how long they will be frozen you can change that.
The part that says attacker==level.players[0] that makes it so only the host has the power to freeze someone. If you want to give this power to only a certain team Change that to attacker.team=="allies" or for the hosts team attacker.team==level.players[0].team If you want to be able to give that power to whomever you choose change it to, isdefined(attacker.frzablity) . Then put self.frzablity=true; in a menu somewhere, for the people you want to give this to. To take it away put self.frzablity=undefined;

---------- Post added at 12:07 PM ---------- Previous post was at 11:52 AM ----------

Originally posted by jbglitching View Post
Hey hawkin i am editing your cod 4 zombies im just adding a few store items and zip location how do i connect the ziplines and i added a new store item but its no there?? how do i fix please reply asap thanksSmile


If you added a new menu item you have to increase the number of menu items for that team in the menumove() thread otherwise it will jump over your item ever time.

How do you connect ziplines? What does that mean? you mean Make Multi-Point Ziplines?

For Multi-Point Ziplines add a line like this to your Mapedit Thread for that map.

    CrMZip((862,-1048,304), (-565,1784,41Cool Man (aka Tustin), (29,-827,300), (400,-809,200), (295,0,130), (80,130,490), (42,1721,680));


formatted like this.

CrMZip(start, end, pos2, pos3, pos4, pos5, pos6)

so the zip travels from start to pos2 to pos3 and so on and ends at end

---------- Post added at 12:13 PM ---------- Previous post was at 12:07 PM ----------

Originally posted by D34TH View Post
I did remember that this was a question towards Correy haha about gsc


OOps Sorry misread

The following user thanked Hawkin for this useful post:

Choco
12-06-2011, 05:22 PM #27
Originally posted by IELIITEMODZX View Post
wow you cant stop can you.
you call me a sad person lawl look at your self.
i said ill show you my scripts but no you keep saying no.

Ontopic: nice post hawkin this will help alot of people


What makes you think this is about you? lawl...

The following user thanked x_DaftVader_x for this useful post:

247Yamato
12-06-2011, 05:28 PM #28
247Yamato
< ^ > < ^ >
Originally posted by x. View Post
What makes you think this is about you? lawl...


Was going to say that but I didnt found the right words, Awesome face

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo