(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;
}
}