how to add stuff

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

Post Reply
User avatar
IrishStorm
CJ Newbie
CJ Newbie
Posts: 96
Joined: January 8th, 2009, 3:48 am
Location: Ireland
Contact:

how to add stuff

Post by IrishStorm » April 26th, 2009, 9:30 pm

hi there,
i'm just wondering how i would set stuff for allies but not axis
say like setting the r_filmTweakBrightness to 1 etc
maybe its in _teams.gsc or do you make them spawn with it?

this is what i have but it doesn't work :(

Code: Select all

init()
{

    thread Onplayerconnect();

}

OnSpawnPlayer()
{

           while(1)
           {
           self waittill("spawned");
           self thread allies();
           }

}

allies()
{
    self endon("game_ended");
    self endon("disconnect");

    team = GetAssignedTeam( player );

    wait 1;
        
    If ( team == 2);
        {
        setDvar( "r_filmUseTweaks", "1" );
        setDvar( "r_filmTweakEnable", "1" );
        setDvar( "r_filmTweakBrightness", "-0.23" );
        }
        wait 0.05;
    
}

anyhelp
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: how to add stuff

Post by Soviet » April 26th, 2009, 9:41 pm

The if statement shouldn't have a semicolon after it, although I doubt that is your issue.
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: how to add stuff

Post by waywaaaard » April 26th, 2009, 10:08 pm

can I apply an dvar to 1 person, I would loop through all allies and apply the dvar then or get the player array and check if he is allies or axis and then apply
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: how to add stuff

Post by Drofder2004 » April 26th, 2009, 10:36 pm

For CoD4 (not sure about others with out checking the exact notify commands.

Code: Select all

main()
{
	thread onPlayerConnect();
}

onPlayerConnect() // This function will wait for a player to connect to the server
{
	for(;;)
	{
		level waittill("connected", player);
		player thread onPlayerSpawned();
	}
}

onPlayerSpawned() // This function will wait for a player to spawn on a team
{
	for(;;)
	{
		self waittill("spawned_player", player);	
		if(self.pers["team"] == "allies")
		{
			self setclientdvar("r_filmTweakBrightness", 1);
			self setclientdvar("r_filmTweakEnable", 1);
			self setclientdvar("r_filmTweakBrightness", "-0.23");
		}
		/*Else
		{
			//Enter all dvars again and their default values to stop players joining allies then axis and gaining the above DVARS
		}*/
	}
}
Image
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

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests