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-09-2011, 05:20 PM #38
Jacob-And-Britt
I’m too L33T
Originally posted by 9484
Suggestions
Make sure you have the boxes precached
Make sure your heights arent the same

what you mean precached like the com_plasticase_beige_big
12-09-2011, 05:35 PM #39
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by jbglitching View Post
what you mean precached like the com_plasticase_beige_big


precacheModel("com_plasticase_beige_big");

That's what he means Winky Winky.

The following user thanked IVI40A3Fusionz for this useful post:

Hawkin
12-20-2011, 12:36 AM #40
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...


Hawkin, its your long lost bestfriend speaking, and you need to get on skype now! We have lots to do Awesome face

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo