Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!
Moderator: Core Staff
-
IrishStorm
- CJ Newbie
- Posts: 96
- Joined: January 8th, 2009, 3:48 am
- Location: Ireland
-
Contact:
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
- Posts: 7760
- Joined: April 23rd, 2005, 9:12 pm
- Location: Plano, Texas
-
Contact:
-
waywaaaard
- Core Staff
- Posts: 2214
- Joined: February 6th, 2006, 3:18 pm
- Location: Germany/Bayern
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
-
Drofder2004
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
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
}*/
}
}
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
Users browsing this forum: No registered users and 27 guests