Final script, for messages in loop. Edition of specific map.scr is needed by adding this after
level waittill spawn until i find a way of calling it at server statup only.
Code: Select all
//this is below level waittill spawn
thread global/server_messages.scr::message_loop
putting the "server_messages.scr" in main/global fodler or in a "global" folder inside a pk3. Customize the mesasges and add case labels as needed.
Code: Select all
// this file is in main/global/server_messages.scr
message_loop:
local.m = 1
while(1)
{
switch(local.m)
{
case 1:
wait 5
waitexec global/server_messages.scr::print_msg "Bienvenue sur le serveur [IRQ] - http://clanirq.no-ip.com" 3
waitexec global/server_messages.scr::print_msg "Welcome on [IRQ] server - http://clanirq.no-ip.com" 3
local.m = 2
break
case 2:
wait 5
waitexec global/server_messages.scr::print_msg "Respectez les autres joueurs, restez polis, c'est un JEU!" 3
waitexec global/server_messages.scr::print_msg "Respect other players, stay polite, it's a GAME!" 3
local.m = 3
break
case 3:
wait 5
waitexec global/server_messages.scr::print_msg "Maps Fix par TheCheatPolice, Traduits par [IRQ]" 3
waitexec global/server_messages.scr::print_msg "Maps Fix by TheCheatPolice, Translated by [IRQ]" 3
local.m = 4
break
case 4:
wait 5
waitexec global/server_messages.scr::print_msg "Bazookas sans munitions, les autres armes ont plus de munitions" 3
waitexec global/server_messages.scr::print_msg "Bazookas have no ammo, other weapons have extra ammo" 3
local.m = 5
break
case 5:
wait 5
waitexec global/server_messages.scr::print_msg "http://clanirq.no-ip.com pour downloads, nouvelles et forums" 3
waitexec global/server_messages.scr::print_msg "http://clanirq.no-ip.com for downloads, news and forums" 3
local.m = 6
break
case 6:
wait 5
waitexec global/server_messages.scr::print_msg "Allez telecharger les fichiers de jeu sur le site web!" 3
waitexec global/server_messages.scr::print_msg "Downloads the game files on the website!" 3
local.m = 1
break
default: // in case something changes local.m, reset it to
local.m = 1
break;
}
wait 25 //delay between messages in seconds
}
end
// print the specified message for the specified seconds+2seconds (fade-in/fade-out)
print_msg local.msg local.duration:
// draw a shadow of the string in black
huddraw_virtualsize 50 1 // use virtual screen size of 640x480
huddraw_rect 50 37 -64 0 0 // element id, top, left, width, height (for string, width/height can be 0)
huddraw_color 50 0.0 0.0 0.0 // element id, red, green, blue (0.0 to 1.0)
huddraw_font 50 "courier-16" // element id, fontname (pak0/fonts/*)
huddraw_string 50 local.msg // element id, string
huddraw_align 50 "left" "bottom" // element id, (left/center/right), (top/middle/bottom)
// draw the overlay colored string
huddraw_virtualsize 51 1
huddraw_rect 51 35 -65 0 0
huddraw_color 51 0.9 0.9 0.1
huddraw_font 51 "courier-16"
huddraw_string 51 local.msg
huddraw_align 51 "left" "bottom"
// display a fade-in
for(local.i = 0; local.i <= 1; local.i += .2)
{
huddraw_alpha 50 local.i
huddraw_alpha 51 local.i
waitframe
}
// wait for the amount of time specified
wait local.duration
// display a fade-out
for (local.i = 1; local.i >= 0; local.i -= .1)
{
huddraw_alpha 50 local.i
huddraw_alpha 51 local.i
waitframe
}
end
I call print_message twice for each label for bilingual messages, could be called onlu once or to display a longer message.
it actually display like this:
First fully functionnal script... and i liked doing it

Thanks MJ for giving me the extra push i needed to start scripting
