problems with a script

Post your scripting questions / solutions here

Moderator: Moderators

El serg
Corporal
Posts: 28
Joined: Tue Oct 07, 2003 10:38 pm
Contact:

problems with a script

Post by El serg »

well this script is a message scrpit when the yellow text is on the left of the screen for moh:SH. and when i put the stuff in it will not work. here is the script

Code: Select all

main:

setcvar "announce" "1"
setcvar "g_message1" "Modded Weapons And Names"
setcvar "g_message2" "Bazookas are Renamed And The Axis Rocket"

level waittill spawn

_message:

while (1)
{
local.message = getcvar "WELLCOME"
	wait 5
	if (local.message=="1")
	 {
	  wait 2
	  iprintln ("Welcome to " + getcvar "89th Clan Server") \n ("?|?|89TH:-?erg|?|?: " + getcvar "")
	  wait 30
	  iprintln (getcvar "Modded weapons") \n (getcvar "Thanks To CrazySniper")
		}
	else
		{
		}
wait 120
    }
end
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Why all those getcvars :?

Anyway welcome to .map :D
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

I made a remake of your script:

Code: Select all

main:
	// These 3 cvars are never used
	setcvar "announce" "1"
	setcvar "g_message1" "Modded Weapons And Names"
	setcvar "g_message2" "Bazookas are Renamed And The Axis Rocket"
	level waittill spawn
	thread message
end

message:
	while (1)
	{
		// U sure its "WELLCOME", and not "WELCOME"?
		// local.message = getcvar "WELLCOME"
		local.message = "1" // Hard coded for testing
		wait 5
		if (local.message == "1") // Failure point. If cvar above is not exactly "1", you'll get squat.
		{
			wait 2
			// This line looks strange... are U sure you know what you are doing?
			// iprintln ("Welcome to " + getcvar "89th Clan Server") \n ("?|?|89TH:-?erg|?|?: " + getcvar "")
			iprintln "Welcome to 89th Clan Server"
			iprintln "?|?|89TH:-?erg|?|?: I'm so cool"
			wait 30
			// This line looks strange as well...
			// iprintln (getcvar "Modded weapons") \n (getcvar "Thanks To CrazySniper")
			iprintln "Modded weapons Thanks To CrazySniper"
		} else {
			// Nothing here... you can remove the else part if it does nothing :)
		}
	wait 120
    }
end
As you havent really described what you are trying to do, I'm just guessing. So if this does not help you: describe what you want it to work like...
Admin .MAP Forums
Image
Head above heels.
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

Welcome to .MAP Serg - My DSL is down :( I am on dialup with a 28K download.

Anyway that script is really messed up. It does not make alot of sense the way you changed it.

I suggest you look at my original script file and study it alittle. If you have any questions, post us here.

Welcome to scripting man. Its alot of fun and stress. :twisted:
El serg
Corporal
Posts: 28
Joined: Tue Oct 07, 2003 10:38 pm
Contact:

Post by El serg »

man im soo cunfused okay this is what i want the script to say exatly:
__________________________________________________
?|Welcome To 89th Clan Server|?

Most Of The Weapons Modded And ReNamed

Admin Is ?|?|89?h:-?erg|?|?

Thank Crazysniper For Most Mods

Clan site 89th-clan.vze.com
__________________________________________________
okay i really a n00b at scrpiting lol and thanks for welcomeing me
so any ways i hope yal can help jackal tryed by i cant understand
scripting looks hard :twisted: :evil: :twisted: :x
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

Dude learning to walk was hard. Apply the same principal to scripting. Practice and read alot. Go through the original Pak3 files that came with the game. See how stuff is done and where files are stored. This forum is a great tool to use along with your practice and readings.

Regarding your script, just type something up like this.

Code: Select all

main:

setcvar "g_announce" "1"
setcvar "g_obj_alliedtext2" "============"
setcvar "g_obj_alliedtext3" "Weapons are modified"
setcvar "g_obj_axistext2" "Play By Server Rules"
setcvar "g_obj_axistext3" "============"


level waittill spawn


_mymessage:

while (1)
{
if (getcvar (g_announce)=="1")
{
thread mytext
}
wait 120
}
end

mytext:
wait 5
iprintln "?|Welcome To 89th Clan Server|?" \n iprintln ("ADMIN: " + getcvar "name")
wait 3
iprintln "Visit clan site at 89th-clan.vze.com"
wait 5
iprintln "Most mods by CrazySniper"
end
El serg
Corporal
Posts: 28
Joined: Tue Oct 07, 2003 10:38 pm
Contact:

Post by El serg »

okay thanks ill gt used to it and the scptirt worked but a thing says this
iprintinADMIN just look at the link http://www.geocities.com/sergio_p2003/index.html For admin out this if u can ?|?|89?H:-?erg|?|? and that it i think [oooohhh yeah My bithday waz the 8 of qct. i got a ATi video card woohoo]
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Come on do a bit of guessing and experimenting on your own it is a good way to learn . :)

iprintln prints what is after the command to the screen

iprintln "Visit clan site at 89th-clan.vze.com"

gee what do you think this will do ? Maybe print Visit clan site at 89th-clan.vze.com on the screen ? Are we getting warmer yet ?

iprintln "?|Welcome To 89th Clan Server|?" \n iprintln ("ADMIN: " + getcvar "name")
I don't know where the \n came from but get rid of it and put what is after it on a different line or should I say change what is after it . Warmer !
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

The \n may be used for a line break, but only in this manner:

iprintln "my line1\nmy line 2"
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

hmm looks like I had a probem with the edit feature wonder why. How do you delete your own posts ?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Press this button Image or edit and then check 'delete post'.
Image
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

Serg that prob was caused because I inadvertently left an iprintln command in the said line. You can fix it by deleting the second IPRINTLN that appears in that line. It should look like this:

Code: Select all

iprintln "?|Welcome To 89th Clan Server|?" \n ("ADMIN: " + getcvar "name")
That will correct it.

PS: Happy belated bird-day. :P
El serg
Corporal
Posts: 28
Joined: Tue Oct 07, 2003 10:38 pm
Contact:

Post by El serg »

ooohhh okay thanks jackal i try it
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You can't seem to delete a post after someone has replied .
El serg
Corporal
Posts: 28
Joined: Tue Oct 07, 2003 10:38 pm
Contact:

Post by El serg »

HUh
Post Reply