Can someone help me please SCRIPTING (i think)
Moderator: Core Staff
Can someone help me please SCRIPTING (i think)
On mp_trial_2 how can i get the script that stops you switching to rpg unless you pick it up? please help me thanks alot CJ <3
Check out my YouTube channel - http://www.youtube.com/user/CodGlitchesHD
Re: Can someone help me please SCRIPTING (i think)
Bump someone please try to help me
Check out my YouTube channel - http://www.youtube.com/user/CodGlitchesHD
-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Can someone help me please SCRIPTING (i think)
If you want the actual script itself, then:
You'll want to create the trigger yes_rpg where the player can finally use the RPG, and a no_rpg trigger along with editing the code according to the comment in the script if you have a place in which you specifically want the player to have no RPG in, and not elsewhere.
Code: Select all
// Add these 2 lines to your main() function
thread no_rpg(undefined, false); // Use getEnt("no_rpg", "targetname") thread no_rpg(undefined, true); if there is a trigger for no RPG usage in
getEnt("yes_rpg", "targetname") thread yes_rpg();
no_rpg(p, type)
{
if(!isDefined(p))
{
if(type)
{
for(;;)
{
self waittill("trigger", p);
if(!isDefined(p.no_rpg) && !isDefined(p.yes_rpg))
self thread no_rpg(p, type);
}
}
else
{
for(;;)
{
level waittill("connected", p);
thread no_rpg(p, type);
}
}
}
else
{
p endon("disconnect");
p.no_rpg = true;
for(;((isDefined(self) && p isTouching(self)) || !type) && !isDefined(p.yes_rpg);)
{
if(!p isOnLadder() && !p isMantling() && weaponType(p getCurrentWeapon()) == "projectile")
{
p iPrintLn("You cannot use an RPG yet!");
if(p hasWeapon("beretta_mp"))
p switchToWeapon("beretta_mp");
else if(!p hasWeapon("beretta_mp") && p hasWeapon("deserteaglegold_mp"))
p switchToWeapon("deserteaglegold_mp");
else if(!p hasWeapon("beretta_mp") && !p hasWeapon("deserteaglegold_mp") && p hasWeapon("colt45_mp"))
p switchToWeapon("colt45_mp");
else if(!p hasWeapon("beretta_mp") && !p hasWeapon("deserteaglegold_mp") && !p hasWeapon("colt45_mp") && p hasWeapon("usp_mp"))
p switchToWeapon("usp_mp");
else
{
p giveWeapon("beretta_mp");
p switchToWeapon("beretta_mp");
}
wait 1;
}
wait 0.75;
}
p.no_rpg = undefined;
}
}
yes_rpg()
{
for(;;)
{
self waittill("trigger", p);
if(!isDefined(p.yes_rpg))
{
p iPrintLn("You can now use your RPG");
p.yes_rpg = true;
}
}
}
Last edited by _DanTheMan_ on January 7th, 2011, 10:45 pm, edited 1 time in total.
Re: Can someone help me please SCRIPTING (i think)
Thank You dan <3 im a newb 2 mapping so ya lol
Check out my YouTube channel - http://www.youtube.com/user/CodGlitchesHD
Re: Can someone help me please SCRIPTING (i think)
dan how can i use it from a map im making how would i set it out or what ever? i want no rpg all the way till near end
Check out my YouTube channel - http://www.youtube.com/user/CodGlitchesHD
-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Can someone help me please SCRIPTING (i think)
1)Right click in the grid area in the left side of CoD4Radiant, and go down to trigger>multiple, which should create a trigger._DanTheMan_ wrote:You'll want to create the trigger yes_rpg where the player can finally use the RPG
2)Place it where you want the player to activate his RPG.
3)Making sure the trigger is selected, press N, (which should bring up an Entity pop-up menu) where you will put targetname in the Key box, and yes_rpg in the Value box.
4)Go to your map's .gsc file, and add the two commands at the top of the code I posted at the bottom of your main() function
5)Add the two functions in the code I posted (no_rpg() and yes_rpg()) at the bottom of your map's .gsc file
Re: Can someone help me please SCRIPTING (i think)
go on xfire please dan xD im the 1 hu told u CJ#1 Rank Mod with Cheat engine and you wnet to god <3scott wrote:dan how can i use it from a map im making how would i set it out or what ever? i want no rpg all the way till near end
Edit i get script compile error { line 12
Check out my YouTube channel - http://www.youtube.com/user/CodGlitchesHD
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Can someone help me please SCRIPTING (i think)
Thats half a lol.scott wrote:go on xfire please dan xD im the 1 hu told u CJ#1 Rank Mod with Cheat engine and you wnet to god <3scott wrote:dan how can i use it from a map im making how would i set it out or what ever? i want no rpg all the way till near end

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Who is online
Users browsing this forum: No registered users and 4 guests