Page 1 of 2
Weapon mod...its a hard one
Posted: Thu Apr 30, 2009 10:34 pm
by HeavenBound
Ok, so I don't even come close to knowing how to do this, but here's what I want.
I have a rifles mod already that does what I want, but on Stalli I want something different. I want sniper only on Stali, but the rest to go back to my rifles mod....So $or or any other smart person, how do I do that?

Posted: Fri May 01, 2009 7:08 am
by jv_map
* Sees an opportunity to shamelessly push own mod *
Get squadmaker
http://medalofhonor.filefront.com/file/Squadmaker;69103
It's not difficult to make squad configs for rifle only and sniper only, and you can tell the server to use a particular config for a specific map.
Posted: Fri May 01, 2009 4:45 pm
by HeavenBound
Looks interesting, BUT....Couldn't I just do a waitthread global/rifle.scr::sniper if i make a thread in my rifles mod to give snipes instead of rifles?
Posted: Fri May 01, 2009 5:57 pm
by $oldier Of Ra
Show what's in that rifle script.
Posted: Sat May 02, 2009 2:13 am
by HeavenBound
Code: Select all
if !(getcvar "rifle") {end}
waitframe
waitframe
local.n = randomint 99999
self weaponcommand mainhand targetname ("w" + local.n)
local.weapon = $("w" + local.n).model
self weaponcommand mainhand targetname ""
switch(local.weapon)
{
case "models/weapons/springfield.tik":
case "models/weapons/thompsonsmg.tik":
case "models/weapons/bar.tik":
case "models/weapons/bazooka.tik":
self takeall
self give "models/weapons/kar98.tik"
self give "models/weapons/m2frag_grenade.tik"
self give "models/weapons/colt45.tik"
waitframe
self use "models/weapons/kar98.tik"
break
case "models/weapons/kar98sniper.tik":
case "models/weapons/mp40.tik":
case "models/weapons/mp44.tik":
case "models/weapons/panzerschreck.tik":
self takeall
self give "models/weapons/m1_garand.tik"
self give "models/weapons/steilhandgranate.tik"
self give "models/weapons/p38.tik"
waitframe
self use "models/weapons/m1_garand.tik"
break
}
...
Posted: Sat May 02, 2009 10:56 am
by $oldier Of Ra
Keep the script, but change it to:
Code: Select all
main:
if (self == NULL)
end
waitframe
waitframe
local.n = randomint 99999
self weaponcommand mainhand targetname ("w" + local.n)
local.weapon = $("w" + local.n).model
self weaponcommand mainhand targetname ""
if (getcvar "rifle" == "1")
{
switch(local.weapon)
{
case "models/weapons/springfield.tik":
case "models/weapons/thompsonsmg.tik":
case "models/weapons/bar.tik":
case "models/weapons/bazooka.tik":
self takeall
self give "models/weapons/kar98.tik"
self give "models/weapons/m2frag_grenade.tik"
self give "models/weapons/colt45.tik"
waitframe
self use "models/weapons/kar98.tik"
break
case "models/weapons/kar98sniper.tik":
case "models/weapons/mp40.tik":
case "models/weapons/mp44.tik":
case "models/weapons/panzerschreck.tik":
self takeall
self give "models/weapons/m1_garand.tik"
self give "models/weapons/steilhandgranate.tik"
self give "models/weapons/p38.tik"
waitframe
self use "models/weapons/m1_garand.tik"
break
}
}
else if ( (getcvar "sniper") == "1")
{
case "models/weapons/springfield.tik":
case "models/weapons/thompsonsmg.tik":
case "models/weapons/bar.tik":
case "models/weapons/bazooka.tik":
self takeall
self give "models/weapons/KAR98sniper.tik"
self give "models/weapons/m2frag_grenade.tik"
self give "models/weapons/colt45.tik"
waitframe
self use "models/weapons/KAR98sniper.tik"
break
case "models/weapons/kar98sniper.tik":
case "models/weapons/mp40.tik":
case "models/weapons/mp44.tik":
case "models/weapons/panzerschreck.tik":
self takeall
self give "models/weapons/springfield.tik"
self give "models/weapons/steilhandgranate.tik"
self give "models/weapons/p38.tik"
waitframe
self use "models/weapons/springfield.tik"
break
}
}
end
Now set the "rifle" cvar to 0 and the "sniper" cvar to 1 on that specific map (in that mapscript after prespawn)
Posted: Sat May 02, 2009 9:11 pm
by HeavenBound
Your so smart

Posted: Sat May 02, 2009 10:35 pm
by HeavenBound
Cept...its not working....
When I add it to the map script, Freeze-Tag doesn't work....
Posted: Sun May 03, 2009 9:50 am
by $oldier Of Ra
Why in the world would you add it to the mapscript??

Of couse it won't work, scripts unload when there are 2 duplicate labels.
I told you to replace the rifle.scr with this new script (keep the name) and put this after waittill spawn/prespawn on the map you want snipers instead of rifles:
Code: Select all
setcvar "rifle" "0"
setcvar "sniper" "1"

Posted: Sun May 03, 2009 5:57 pm
by HeavenBound
oh, i read it wrong....
but how in the world would i do it automatically?
I mean, its rifles only the whole time, but 1 map. Can i do that w/ mefy's ext gametype in my cfg? ex.:
Code: Select all
set g_extgametype_mohdm2 ft set rifle 1
set g_extgametype_mohdm6 ffa set sniper 1
set g_extgametype_mohdm3 ft set rifle 1
set g_extgametype_mohdm1 ffa set rifle 1
set g_extgametype_mohdm7 ft set rifle 1
I know that won't work, but how can I do it automatically? lol
Posted: Sun May 03, 2009 9:02 pm
by $oldier Of Ra
Automatically? Well I just told you twice (3 times now); add these 2 lines after prespawn in stalingrad's mapscript:
Code: Select all
setcvar "rifle" "0"
setcvar "sniper" "1"
Posted: Mon May 04, 2009 2:00 am
by HeavenBound
ahhh im blind, stupid, and well anything but smart @ the moment.

Sorry Sor.
Posted: Mon May 04, 2009 7:22 pm
by HeavenBound
well...now that i've done everything u said..it still does not work. The rifle part of it doesn't even work. but its ok, apperently the other Clan Leader just wants a seprate server to run Stali 24/7 lol
Thanks anyway =)
Posted: Wed May 06, 2009 1:59 pm
by SilentAngel
I'm not sure to have understood very well...
Why don't ya seply run a script from your maps, where you set the weapons..or make your own script to be exec from dmprechace that exploit the map cvar and select different mods dipending on it...
should be easyer in my opinion then use other peopple mods..if you're not the maker(almost for me), it's hard to use a mod with all his functions...

Posted: Wed May 06, 2009 2:09 pm
by $oldier Of Ra
That's why I never use someone else's scripts.