script help

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Turbo2233
CJ Fan
CJ Fan
Posts: 116
Joined: December 8th, 2011, 1:38 pm
Location: unknown

script help

Post by Turbo2233 » January 20th, 2012, 2:15 pm

hi guys i need help on a script i want my door to open if a player press use key can you post a script that will do that

thanks

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: script help

Post by Goro92 » January 20th, 2012, 2:34 pm

Code: Select all

main()
{
thread door1_rotate();
}
door1_rotate()
{
door1 = getent("door", "targetname");
trig = getent("trig_door", "targetname");
while (1)
{
trig waittill("trigger");
door1 playsound("dooropen");
door1 rotateyaw(90, 1.5, 0.7, 0.7);
door1 waittill("rotatedone");
wait (3);
door1 playsound("doorclose");
door1 rotateyaw(-90, 1.5, 0.7, 0.7);
door1 waittill("rotatedone");
}
}
in mp_yourmapname.gsc you have to put this:

Code: Select all

main()
{
maps\mp\_load::main(); 
maps\mp\mp_filename::main();
}
Image

User avatar
Turbo2233
CJ Fan
CJ Fan
Posts: 116
Joined: December 8th, 2011, 1:38 pm
Location: unknown

Re: script help

Post by Turbo2233 » January 20th, 2012, 4:11 pm

doesnt work i get could not find maps/mp/_open.gsc

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: script help

Post by Pedsdude » January 20th, 2012, 5:24 pm

Turbo2233 wrote:doesnt work i get could not find maps/mp/_open.gsc
I'm guessing you meant "maps/mp/mp_open.gsc"?

A .gsc file isn't automatically created for your map, you have to make one from scratch. If that's the case, copy Goro92's code, paste it into wordpad/notepad and save as mp_open.gsc
Image
Image

User avatar
Turbo2233
CJ Fan
CJ Fan
Posts: 116
Joined: December 8th, 2011, 1:38 pm
Location: unknown

Re: script help

Post by Turbo2233 » January 20th, 2012, 5:28 pm

Pedsdude wrote:
Turbo2233 wrote:doesnt work i get could not find maps/mp/_open.gsc
I'm guessing you meant "maps/mp/mp_open.gsc"?

A .gsc file isn't automatically created for your map, you have to make one from scratch. If that's the case, copy Goro92's code, paste it into wordpad/notepad and save as mp_open.gsc
nvm i got the anser from this link

http://modsonline.com/Tutorials-read-658.html

thanks goro

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: script help

Post by Pedsdude » January 20th, 2012, 5:37 pm

Yes, thanks Goro for wasting your time responding to someone who clearly pays no attention to advice and then uses a tutorial he could have viewed before posting in the first place! :roll:
Image
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest