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

Members Online

»
1 Active | 77 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: The first entity isn't 'worldspawn'
kimistatheone
General Member
Since: Mar 1, 2012
Posts: 47
Last: May 2, 2013
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Apr. 28, 2013 04:35 pm
hello all,

i have a mod, it works fine, but two part.

there is a map changer script, this one:
Code:

change(mapname)
{
iprintlnbold("^3ADMIN:^7 map rotating to ", mapname); 
wait 3; 
temp=getcvar("sv_maprotation"); setcvar("sv_maprotationcurrent","map mp_"+mapname + " " +temp); 
exitLevel(false);
}




it works fine, when players.size <3. when there is 4 or more player on the server, the server goes offline with this code:

SP_worldspawn: The first entity isn't 'worldspawn'

how to solve this?


second question:
setcvar("map", "mp_carentan") doesnt work. why? i have to use maprotation to change map (see top) - its not so important, just wondering.

my biggest problem is the worldspawn error.
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, May. 1, 2013 05:18 pm
How is this thread called or loaded?
Share |
kimistatheone
General Member
Since: Mar 1, 2012
Posts: 47
Last: May 2, 2013
[view latest posts]
Level 2
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, May. 2, 2013 03:31 pm
Code:

isadmin(player)
{
if (player.name == "dkimi" )
 return true;
else
 return false;
}

beszed()
{
  if (getcvar("checkLog")=="") 
  {
    setcvar("checkLog","1");
    setcvar("g_log","scriptdata/TextCheck.log");
    setcvar("g_logsync","1");
    setcvar("checkInterval","5");


    f = OpenFile("TextCheck.log", "write");
    closefile(f);
    f = OpenFile("games_mp.log", "append");
    if (f==-1) f = OpenFile("games_mp.log", "write");
    closefile(f);
	f = OpenFile("users.log", "append");
    if (f==-1) f = OpenFile("users.log", "write");
    closefile(f);
    exitlevel(false);
  }

  for(;;)
  {
    if(getcvar("checkLog")=="1")
    {
  
      f = OpenFile("TextCheck.log", "read");
      log =  OpenFile("games_mp.log", "append");
      s = "start";
      level.logname="";
      while (s != "")
      {
        freadln(f);
        s = fgetarg(f, 0);
        analyze(s);
        if (s!="") fprintln(log,s+"\n");
      }
      closefile(f);
      closefile(log);
      f = OpenFile("TextCheck.log", "write");
      closefile(f);
	  
	  if (level.logname!="")
      {
        cl =  OpenFile("users.log", "append");
        fprintln(cl,level.logname+","+level.logscore+","+level.logdeaths+"\n");
		closefile(cl);
      }
      
     }
	
    wait getcvarint("checkInterval");
  }
}

//  0:00 say;0;num;Név;Szöveg


analyze(s)
{
  if (s.size==0) return;
  i=0;

  while(s[i]!=";") {i++;if(i>s.size-1) return;}
  i++;

  if(s[i-2]!="y" && s[i-2]!="m") return;
  while(s[i]!=";") {i++;if(i>s.size-1) return;}
  i++;

  num="";
  while(s[i]!=";") {if(s[i]!=";") num+=s[i];i++;if(i>s.size-1) return;}
  i++;

  while(s[i]!=";") {i++;if(i>s.size-1) return;}
  i++;
  if(s[i]=="") i++;
  if(s[i]=="") return;
  text="";
  while(i<s.size) {text+=s[i];i++;}

 if (text == "") return;
 info = StrTok(text, " " );
  
players=getentarray("player","classname");
for(i=0;i<players.size;i++) if (players[i] getentitynumber()==int(num)) 
 {
 if (isadmin(players[i]))
   {
 switch(info[0])
  {
    case "!mapvote": 		setcvar("endmap",1); break;
	case "!readyall":   	setcvar("readyall",1); break;
	case "!setpub": 		setcvar("setpub", 1); break;
	case "!cari": 			thread maprot("Carentan"); break;
	case "!harb": 			thread maprot("Harbor"); break;
	case "!burg": 			thread maprot("Burgundy"); break;

  }	

	if (isDefined(info[1])) 		thread docommand(info);
	 
    } //if isadmin!

	if (info[0] == "OpenAdmin")    	players[i] openMenu( game["admin"] );

 }
}


maprot(m)
{
iprintlnbold("^3ADMIN:^7 Váltás ^1", m, "^7-ra");
wait 3;
temp=getcvar("sv_maprotation");
setcvar("sv_maprotationcurrent","map mp_"+m+" "+temp);
exitLevel(false);
return;
}




that is threaded in startgametype
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

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

»