Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 55 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: need help to fix code
BUSH1DO
General Member
Since: Apr 2, 2014
Posts: 40
Last: Sep 9, 2016
[view latest posts]
Level 2
Category: CoD4 MP Mapping
Posted: Friday, Jun. 26, 2015 10:36 am
hi, need help to fix script. when player connected start music, if someone dont want music have one lever trigger to stop and start music manually. here is part of map gsc

Code:

#include maps\mp\_utility;

#include maps\mp\gametypes\_hud_util;

#include common_scripts\utility;

main()
{
        maps\mp\_load::main();
        thread onPlayerConnect();
        thread lever();
}

onPlayerConnect()
{
	level endon("game_ended");
	
	for(;;)
	{
		level waittill("connected", player);
		
		player.mod["music_plays"] = true;
		
		player thread musicstart();
		
	}
}
//////////////////////////////////////////////////////////////
lever()
{
	level endon("game_ended");
	
	lever = getent("lever","targetname");
	trigger = getent("levtrig","targetname");
	
	while(1)
	{
		trigger waittill("trigger", player);
		
		lever movex(8, 2);
		
		if(player.mod["music_plays"])
			player thread musicstop();
		else
			player thread musicstart();
		
		wait 2;
		lever movex(-8, 2);
		wait 2;
	}
}
///////////////////////////////////////////////
musicstart()
{
	self endon("disconnect");
	self endon("music_stop");
	
	self.mod["music_plays"] = true;
	
	while(1)
	{
		wait 2;
		self playLocalSound("song1");
		wait 611;
	}
}
///////////////////////////////////////////////
musicstop()
{
	self endon("disconnect");
	
	wait 2;
	self notify("music_stop");
	self.mod["music_plays"] = false;
	

}  

So music start play at spawn , but trigger not work correct.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»