Yellow text under compas while running a server

Want to recruit some people for your mod ? Want to work on a mod ? Post the relevant info here. Not for mapping questions.

Moderator: Moderators

Post Reply
=DXD=GaTeCRaSHeR
Private
Posts: 9
Joined: Sun Jul 31, 2005 8:28 pm

Yellow text under compas while running a server

Post by =DXD=GaTeCRaSHeR »

Hi Every one,

I am new to this forum and i looked here for a script where i can put some custom text in,

i read things about to use iprintln to send the text there
i just want a custom.cfg where i place my ads in like ,

pls visit or site,

or ,

We are now recruiting

and the text must come back every 2 mins,


i have no experience with customs.cfg files so can some 1 pls tell me how i have to make it work .

uhm and sorry for my bad english, :) i'm working on it :)

Greeetzz Gatecrasher
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

UTFSB, Luke. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
=DXD=GaTeCRaSHeR
Private
Posts: 9
Joined: Sun Jul 31, 2005 8:28 pm

Post by =DXD=GaTeCRaSHeR »

Ok thanks :) for the fast replying.
but, now i have to know how i can make this work with the
iprintln

How does the *.scr file look to if i want just 2 lines in it that can print every 120 seconds the text "welcome to our server"

maybe?

========= test.scr =======
mainloop:
120 iprintln "line1"
120 iprintln "line1"
end
======================
and how do i habe to save it , i have a program called pakscape to edit pk3 files,

But in witch direcoty i have to put the test.scr i tought the

==== my.pk3 ===
- Global
|- test.scr
=============


Thanks for the one who is able to help me.



( and still my apolojucie for my bad english ) :wink:
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

save your .scr file under the same name as your map file, in other words if you map file is Normandy.map, then save your script as Normandy.scr

MOHAA script is very easy to use, not all the commands are executed at once like some languages do, so you don't need to specify how long to wait on commands, they're executed in order.

So to make your thread wait 120 seconds then you just put

wait 120

wherever you need it to wait.

so your thread to do the server loop would be...

Code: Select all

serverMsg:
// displays the server message every 2 minutes

while(1) // this command tells the script to keep execute the lines between the brackets.
{// it's a loop, so you'll need an opening brackt...

    wait 120 // wait 120 seconds
    iprintln "Please visit our website!"
    iprintln "www.mywebsite.com"

}// and a closing bracket.
end
;)

Sorry to overburden you, but i should add that you'll need to have another thread in your script, it's the thread that's first executed. i'll link a tutorial explaining waht you need in it...
http://dynamic.gamespy.com/%7Emap/mohaa/t.php?id=35

as for folder structure, theres a tutorial on that too ;)
http://dynamic.gamespy.com/%7Emap/mohaa/t.php?id=19


EDIT: also, this thread should be in hte scripting forum ;)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
=DXD=GaTeCRaSHeR
Private
Posts: 9
Joined: Sun Jul 31, 2005 8:28 pm

Post by =DXD=GaTeCRaSHeR »

Thanks for the reply :D it seems very help fully :)

Only u said that i have save the scr as the same name of my map,
is there not a normal name else cause it have to work on all of the maps there are running
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

If you want it on all the maps that run on your server, you'll need to take a few more steps.

change your thread to this...

Code: Select all

start: 
// displays the server message every 2 minutes 

while(1) // this command tells the script to keep execute the lines between the brackets. 
{// it's a loop, so you'll need an opening brackt... 

    wait 120 // wait 120 seconds 
    iprintln "Please visit our website!" 
    iprintln "www.mywebsite.com" 

}// and a closing bracket. 
end
all i changed was the thread name.

now save it any name you like, as long as it's .scr

put that into a folder, the common one is global, place it in your pk3, and instead of calling that thread from main, do this isntead. you'll still have to mod each map script, but it's a lot easier on harddrive space and coding to use a global script.

Code: Select all

exec global/serverMsg.scr
assuming you named your script serverMsg.scr and put it in the global folder.

Code: Select all

main:
// first thread to be called i na map

level waittill prespawn // prespawn is when all the geometry is loaded
// but not any models such as radios and chairs.
level waittill spawn
// spawn is when everything is loaded, the round hasnt started tho
level waittill roundstart
// gameplay has begun.

// any threads, put your exec...serverMsg  here.

end

// other threads go down here
Do not use that as a script, it's only to show you the basic layout of an MP script, i linked the basic DM script in my last reply ;)

Sorry if it's a but confusing, i think i probably went too fast with too much info, but hopefully you'll get it. if you have trouble and the script isnt too bit for the map i'll show you where you should put it.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
=DXD=GaTeCRaSHeR
Private
Posts: 9
Joined: Sun Jul 31, 2005 8:28 pm

Post by =DXD=GaTeCRaSHeR »

Thanks again for replying :)

Ok my problem is a have a dedicated server, if the server is offline a start him with a server1.bat file,

Then the bat file tells my computer to start a custom.cfg file with the server configs, and the server starts

The map list is DM & OBJ maps, it depensd what my clan mates want to play,

Now i just want to created a simpel myname.pk3 file ( that automatic will load when the console server start ) that send every 120 second a message in the game about that lines :) i just already did what u told me ,

I created a myname.scr file and put the text,

Code: Select all

serverMsg: 
// displays the server message every 2 minutes 

while(1) // this command tells the script to keep execute the lines between the brackets. 
{ // it's a loop, so you'll need an opening brackt... 

    wait 10 // wait 120 seconds 
    iprintln "Please visit our website!" 
    iprintln "www.mywebsite.com" 

} // and a closing bracket. 
end
into it, and save it as myname.scr
after that i started pakscape and made a new map named "global" and there i put that file in and save them,

I placed the myname.pk3 to the main folder but it still not working, and if i look to to dedivated console i see that is loaded but thats all, in the game self i dont see the text :(
=DXD=GaTeCRaSHeR
Private
Posts: 9
Joined: Sun Jul 31, 2005 8:28 pm

Post by =DXD=GaTeCRaSHeR »

IT WORKS :) THANKS TO ALL :)


i Just take a view more other files to find out my problem,

instead of using myname.scr i changed it to DMprecache.scr


Greetz
Post Reply