Page 1 of 1

no rpg area

Posted: January 29th, 2011, 4:53 pm
by bigbabol
is it possible to make an area (not a map),probably with a trigger multiple,where u cannot use rpg or an area where u must use 125 fps?pls help :D

Re: no rpg area

Posted: January 29th, 2011, 5:03 pm
by Pedsdude
Given what I know about restricting RPG/FPS, I think it almost certainly is possible, but I don't know enough to be able to help you :P Someone should be able to though, I would imagine Drofder, DanTheMan, Rezil among others should know!

Re: no rpg area

Posted: January 29th, 2011, 5:40 pm
by bigbabol
Pedsdude wrote:Given what I know about restricting RPG/FPS, I think it almost certainly is possible, but I don't know enough to be able to help you :P Someone should be able to though, I would imagine Drofder, DanTheMan, Rezil among others should know!
ok thx i wait them :D

Re: no rpg area

Posted: January 29th, 2011, 9:16 pm
by Hoogie
It is possible. Dan did it in mp_trial_2 i believe. Like the expert mode was 125 no rpg or something.

Re: no rpg area

Posted: February 11th, 2011, 3:33 am
by waywaaaard
Yeah u can force the user to have an special fps and take him the rpg.. Search for force fps here in the forums and u will find a script

Re: no rpg area

Posted: February 18th, 2011, 11:18 pm
by denzil3009
MP_Digital has it, maybe ask the person who created that map ?

Re: no rpg area

Posted: February 19th, 2011, 1:49 pm
by Pedsdude
denzil3009 wrote:MP_Digital has it, maybe ask the person who created that map ?
I did, although I can't really help him - on mp_digital you can't use RPG anywhere on the map. He wants it so that it's only certain areas you can't use it.

Re: no rpg area

Posted: February 19th, 2011, 7:07 pm
by Buzzard

Code: Select all

main()
{
       	[...]

	addFunc("no_rpg", ::no_rpg);
       	addFunc("fps", ::fps);
}

addFunc(targetname, function)
{
	entArray = getEntArray(targetname, "targetname");

	for(Idx = 0;Idx < entArray.size;Idx++)
	{
		if(isDefined(entArray[Idx]))
			thread [[function]](entArray[Idx]);
	}
}

no_rpg(trigger, user)
{
	if(!isDefined(user))
	{
		for(;;)
		{
			trigger waittill("trigger", user);

			if(isDefined(user.no_rpg))
				continue;

			thread no_rpg(trigger, user);
		}
	}

	user endon("disconnect");

	user.no_rpg = true;
      
	for(;user isTouching(trigger);)
	{
		if(!user isOnLadder() && !user isMantling() && weaponType(user getCurrentWeapon()) == "projectile")
		{
			if(user hasWeapon("beretta_mp"))
				user switchToWeapon("beretta_mp");
			else if(!user hasWeapon("beretta_mp") && user hasWeapon("deserteaglegold_mp"))
				user switchToWeapon("deserteaglegold_mp");
			else if(!user hasWeapon("beretta_mp") && !user hasWeapon("deserteaglegold_mp") && user hasWeapon("colt45_mp"))
				user switchToWeapon("colt45_mp");
			else if(!user hasWeapon("beretta_mp") && !user hasWeapon("deserteaglegold_mp") && !user hasWeapon("colt45_mp") && user hasWeapon("usp_mp"))
				user switchToWeapon("usp_mp");
			else
			{
				user giveWeapon("beretta_mp");
				user switchToWeapon("beretta_mp");
			}

			wait 1;
		}

		wait 0.75;
	}

	user.no_rpg = undefined;
}

fps(trigger, user)
{
	if(!isDefined(user))
	{
		for(;;)
		{
			trigger waittill("trigger", user);

			if(isDefined(user.fps))
				continue;

			thread fps(trigger, user);
		}
       	}

       	user endon("disconnect");

       	user.fps = true;

       	for(;user isTouching(trigger);)
       	{
               	user setClientDvar("com_maxFPS", 125);

		wait 0.05;
	}

	user.fps = undefined;
}
1: Put script into your map.gsc
2: Create Trigger Mulitple(s) for the area(s) where the player can't have a rpg or just can have 125 FPS
3: Link the trigger(s) to the script with giving the trigger(s) the targetname "no_rpg" or "fps"

Note: The "no_rpg"-Part was created by _DanTheMan_. I just changed some things to make it possible working on certain areas.

Re: no rpg area

Posted: February 20th, 2011, 12:46 pm
by Moustache
I have not tested it but I have a question.

Why do you use:
for(;user isTouching(trigger);)
Instead of:
while( user isTouching(trigger) )

Re: no rpg area

Posted: February 20th, 2011, 2:05 pm
by Drofder2004
Moustache wrote:I have not tested it but I have a question.

Why do you use:
for(;user isTouching(trigger);)
Instead of:
while( user isTouching(trigger) )
I would guess it is simply an adaption of previously used languages learned.
So, if you are shown only to sue the for loop, and only using the 'while' section of it to mimic a while loop, then thats what you will always do.