Jump to content
Sign in to follow this  
AgentJonathan

2 scripts 2 major problems

Recommended Posts

I am having a very retarded problem with this script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0

_type = _this select 1

?(_type == "anaconda"): Goto "Anaconda"

?(_type == "glock17"): Goto "Glock17"

?(_type == "glock18"): Goto "Glock18"

?(_type == "50ae"): Goto "50Auto"

?(_type == "fn57"): Goto "FN57"

?(_type == "m16a2"): Goto "M16A2"

?(_type == "m4a1"): Goto "M4A1Cobra"

?(_type == "m16m203"): Goto "M16M203"

?(_type == "ump45"): Goto "UMP45"

?(_type == "sg552"): Goto "SG552"

?(_type == "p90"): Goto "P90"

?(_type == "g36"): Goto "G36"

?(_type == "ak-47"): Goto "AK-47"

?(_type == "m249"): Goto "SAW"

?(_type == "m82a1"): Goto "M82A1"

?(_type == "psg"): Goto "PSG-1"

?(_type == "rpg7"): Goto "RPG-7"

?(_type == "6 grenades"): Goto "6_Grenades"

?(_type == "3 grenades"): Goto "3_Grenades"

?(_type == "2 grenades"): Goto "2_Grenades"

?(_type == "1 grenade"): Goto "1_Grenade"

?(_type == "2 smokeshells"): Goto "2_SmokeShells"

?(_type == "1 smokeshell"): Goto "1_SmokeShell"

?(_type == "binoculars"): Goto "Binoculars"

?(_type == "nightvision"): Goto "NV"

#Anaconda

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddWeapon "SJB_TOS_Anaconda"

#Glock17

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddWeapon "SJB_TOS_Glock17C"

#Glock18

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddWeapon "SJB_TOS_Glock18C"

#50Auto

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddWeapon "SJB_TOS_DesertEagle"

#FN57

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddWeapon "SJB_TOS_FN57"

#M16A2

_unit AddMagazine "SJB_TOS_M16A2"

_unit AddMagazine "SJB_TOS_M16A2"

_unit AddMagazine "SJB_TOS_M16A2"

_unit AddMagazine "SJB_TOS_M16A2"

_unit AddWeapon "SJB_TOS_M16A2"

#M4A1Cobra

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddWeapon "SJB_TOS_M4_Cobra"

#M16M203

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddWeapon "SJB_TOS_M16A2_M203"

#UMP45

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddWeapon "SJB_TOS_UMP45"

#SG552

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddWeapon "SJB_TOS_SG552"

#P90

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddWeapon "SJB_TOS_P90"

#G36

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddWeapon "JAM_G36"

#AK-47

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddWeapon "SJB_TOS_AK47"

#SAW

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddWeapon "SJB_TOS_M249"

#M82A1

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddWeapon "SJB_TOS_M82A1"

#PSG-1

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddWeapon "SJB_TOS_PSG1_SD"

#RPG-7

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddWeapon "JAM_CAVS_RPG7Launcher"

#6_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

#3_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

#2_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

#1_Grenade

_unit AddMagazine "HandGrenade"

#2_SmokeShells

_unit AddMagazine "SmokeShell"

_unit AddMagazine "SmokeShell"

#1_SmokeShell

_unit AddMagazine "SmokeShell"

#Binoculars

_unit AddWeapon "Binocular"

#NV

_unit AddWeapon "NVGoggles"

Exit

The Problem here is when i type [this,"anaconda"] exec "guns.sqs" it also adds the M16A2 because that's the first rifle listed, vice versa, when i type [this,"m16a2"] exec "guns.sqs" it adds the Anaconda, because its the first pistol listed.

Help fixing this will be highly appreciated. smile_o.gif

I wanna do lego style connecting the dots like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this,"m82a1"] exec "guns.sqs"; [this,"glock18"] exec "guns.sqs"; [this,"3 grenades"] exec "guns.sqs"; [this,"1 grenade"] exec "guns.sqs"; [this,"2 smokeshells"] exec "guns.sqs"]; [this,"binoculars"] exec "guns.sqs"

This whole big crap-heap should give me an M82A1 Sniper Rifle with 4 mags, an automatic Glock18C with 4 mags, 4 grenades, 2 smoke shells, and a Binocular.

Second Script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Player SideChat "I'm done sniping boys, you can join up with me now. Out."

~8

RuskieBob1 Sidechat "Rodger that. We have saved you the best combat weapon. Out!"

Exit

Nothing is wrong with this script or the init.sqs, but the result isn't to my liking.

Subscript

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Player AddAction ["Call in Men", "callin.sqs"]

Exit

Okay, what happens when I use this action? IT WORX PERFECTLY!!! crazy_o.gif But the action doesn't disappear, I can use it again and again, and a-freakin-gen, but it doesn't do anything anymore.

Help here would loosen my dimmed nerves, and you will have helped alot! yay.gif

Share this post


Link to post
Share on other sites

-problem 1

you just need to add an exit after each weapon/magazine allocation as without those exit, the script give you everything in the order they are appearing, not only it will not give you exactly what you want but that can lead into a CTD in specific conditions in the mission when you give more items to an unit than it can take.

example :

Quote[/b] ]

#Anaconda

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddWeapon "SJB_TOS_Anaconda"

exit

#Glock17

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddWeapon "SJB_TOS_Glock17C"

exit

etc ...

-problem 2

there is no removeaction in the script, so it is normal the action does not disappear.

modified script :

Quote[/b] ]callcode1 = Player AddAction ["Call in Men", "callin.sqs"]

Exit

Quote[/b] ]

player removeAction callcode1

Player SideChat "I'm done sniping boys, you can join up with me now. Out."

~8

RuskieBob1 Sidechat "Rodger that. We have saved you the best combat weapon. Out!"

Exit

Share this post


Link to post
Share on other sites

Also note that for problem1 an empty slot in the unit's weapon loadout is needed for weapon and/or magazine to take its place.

Share this post


Link to post
Share on other sites

u 2 rule. karantan, I did not put a removeallweapons _unit because it would keep removing weapons I add when I add a second one. Get it??? <---He's a tard! rofl.gif

Share this post


Link to post
Share on other sites

AgentJonathan, don't insult people who are helping you. Karantan did not insult you in any way, just warned of a possible mistake that very frequently comes up when new users use these commands. He didn't even suggest the idea you are insulting him about!

Share this post


Link to post
Share on other sites
u 2 rule. karantan, I did not put a removeallweapons _unit because it would keep removing weapons I add when I add a second one. Get it???                  <---He's a tard! rofl.gif

That's what one gets if he spend his free time on some 13 years old kiddo. Lesson learned.

Share this post


Link to post
Share on other sites

I will try to give a tip... let's see how it is taken... am I retarded or not...

Instead of writing:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0

_type = _this select 1

?(_type == "anaconda"): Goto "Anaconda"

?(_type == "glock17"): Goto "Glock17"

?(_type == "glock18"): Goto "Glock18"

?(_type == "50ae"): Goto "50Auto"

?(_type == "fn57"): Goto "FN57"

?(_type == "m16a2"): Goto "M16A2"

?(_type == "m4a1"): Goto "M4A1Cobra"

?(_type == "m16m203"): Goto "M16M203"

?(_type == "ump45"): Goto "UMP45"

?(_type == "sg552"): Goto "SG552"

?(_type == "p90"): Goto "P90"

?(_type == "g36"): Goto "G36"

?(_type == "ak-47"): Goto "AK-47"

?(_type == "m249"): Goto "SAW"

?(_type == "m82a1"): Goto "M82A1"

?(_type == "psg"): Goto "PSG-1"

?(_type == "rpg7"): Goto "RPG-7"

?(_type == "6 grenades"): Goto "6_Grenades"

?(_type == "3 grenades"): Goto "3_Grenades"

?(_type == "2 grenades"): Goto "2_Grenades"

?(_type == "1 grenade"): Goto "1_Grenade"

?(_type == "2 smokeshells"): Goto "2_SmokeShells"

?(_type == "1 smokeshell"): Goto "1_SmokeShell"

?(_type == "binoculars"): Goto "Binoculars"

?(_type == "nightvision"): Goto "NV"

; ... the rest of the script ...

you can write:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0

goto (_this select 1)

; ... the rest of the script ...

Makes the script a good bit shorter and also faster when all those condition checks are not present.

About using removeAllWeapons: you should use it before you execute a script like this. Maybe the design of this system is not ideal as I see you would need to call the script many times if you want to give a soldier a weapon, binoculars and NV goggles... each would require one script call with this design.

Maybe you should think first before insulting others. An apology towards karantan would not be a bad idea AgentJonathan wink_o.gif he tells you a perfectly valid point and you call him retarded?

Share this post


Link to post
Share on other sites

AgentJonathan, being a kid is not an excuse for insulting people taking on their own time to help you.

Do not be surprised if you recieve no more help for your problems.

Share this post


Link to post
Share on other sites

WHOA! Freak dudes! I wasn't being a buthole! You recieved this all wrong. I'm sorry guys, no offense meant.

I didn't know I hurt anyone. So nail me while you frikkin kan!

Share this post


Link to post
Share on other sites

OOOOOOOHH!!! The <--- hes a tard thing was about me! rofl. dude, karantan! I wasn't talkin about you man.

1 - I only thought he was mentioning a certain thing cuz i was tired. No excuse though. I'm verry sorry, karantan.

2 - the tard statement was about me cuz it was a hectic day in school, and i was making fum of my crappy thinking.

sad_o.gif I'm so sorry dudes, and i deserve to never be helped again, because I had used a wrong choice of words.

I hate myself...

Plus, I like karantan -- I would never insult someone that I consider a friend. I am so, so, so freakin sorry, and I have no way to truly prove it.

-------------------------^ I can never choose the right words, and for that I am very, truly sorry. sad_o.gifsad_o.gifsad_o.gif

karantan, i am sorry. sad_o.gif I am such a jerk.

Share this post


Link to post
Share on other sites

It's ok, a misunderstanding then. But next time try to articulate your thouths more properly so the possible future misunderstandings can be avoided.

Share this post


Link to post
Share on other sites

I actaully am a 'tard and I took offence. I was bashing my head with my keyboard and my mum had to come in and wipe the drool off the monitor.

Now they say I'm going back inn the cage because of my outburst. help.gif

P.S. you could blow karantan, that would show you were sorry.

What is this script for?

Could you use a dialogue?

Share this post


Link to post
Share on other sites

sad_o.gif(

If I can patch this up, this is what i would write in the right frame of mind.

u 2 rule. karantan, I did not put a removeallweapons _unit because it would keep removing weapons I add when I add a second one.                  <---I'm a tard! I really aint thinking clearly. crazy_o.gif

karantan, i also misunderstood you when you wrote

Quote[/b] ]Also note that for problem1 an empty slot in the unit's weapon loadout is needed for weapon and/or magazine to take its place.

This, for some reson, i do not understand. And thats why i came up with this:

Quote[/b] ]karantan, I did not put a removeallweapons _unit because it would keep removing weapons I add when I add a second one. Get it???

[EDIT]K, karantan. I just studied what you said and now i get it. Sorry for being 'unteachable'.[/EDIT]

I was, with the "<---" thing, pointing at my own avatar. I can be an absoloute bonehead at times. sad_o.gif

Heh. By sentence structure, I musta not been functioning.

banghead.gif Garshdanggit! I dropped a script. xmas_o.gif

Sorry all, if you took any offense. goodnight.gif

Share this post


Link to post
Share on other sites
I actaully am a 'tard and I took offence. I was bashing my head with my keyboard and my mum had to come in and wipe the drool off the monitor.

Now they say I'm going back inn the cage because of my outburst.  help.gif

P.S. you could blow karantan, that would show you were sorry.

What is this script for?

Could you use a dialogue?

Quote[/b] ]P.S. you could blow karantan, that would show you were sorry.

1.) Dude, Archy. wow_o.gif ---^ Don't you say that's a little perverse/vulgar. goodnight.gif  EEEEWWW!!!!!

2.) This script is used for adding a desired weapon by typing: [this,"M16A2"] exec "guns.sqs". In other words it is a big script with all addweapons, and magazines rather than a million little files that are labeled: Anaconda.sqs, Glock17.sqs" ect...

3.) Wat do you mean, dialogue?

Share this post


Link to post
Share on other sites

Lastly. Here's our script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0

_type = _this select 1

?(_type == "Anaconda"): Goto "Anaconda"

?(_type == "Glock 17"): Goto "Glock17"

?(_type == "Glock 18"): Goto "Glock18"

?(_type == "50AE"): Goto "50Auto"

?(_type == "FN57"): Goto "FN57"

?(_type == "M16A2"): Goto "M16A2"

?(_type == "M4A1"): Goto "M4A1Cobra"

?(_type == "M16 M203"): Goto "M16M203"

?(_type == "UMP45"): Goto "UMP45"

?(_type == "SG552"): Goto "SG552"

?(_type == "P90"): Goto "P90"

?(_type == "MP5"): Goto "MP5A4"

?(_type == "G36"): Goto "G36"

?(_type == "AK-47"): Goto "AK-47"

?(_type == "M249"): Goto "SAW"

?(_type == "M82A1"): Goto "M82A1"

?(_type == "PSG"): Goto "PSG-1"

?(_type == "RPG7"): Goto "RPG-7"

?(_type == "6 Grenades"): Goto "6_Grenades"

?(_type == "3 Grenades"): Goto "3_Grenades"

?(_type == "2 Grenades"): Goto "2_Grenades"

?(_type == "1 Grenade"): Goto "1_Grenade"

?(_type == "2 SmokeShells"): Goto "2_SmokeShells"

?(_type == "1 SmokeShell"): Goto "1_SmokeShell"

?(_type == "Binocular"): Goto "Binocular"

?(_type == "Night Vision"): Goto "NV"

_errorText = Format["ERROR: INVALID GUN %1", _type]

HintC _errorText

Exit

#Anaconda

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddWeapon "SJB_TOS_Anaconda"

Exit

#Glock17

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddWeapon "SJB_TOS_Glock17C"

Exit

#Glock18

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddWeapon "SJB_TOS_Glock18C"

Exit

#50Auto

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddWeapon "SJB_TOS_DesertEagle"

Exit

#FN57

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddWeapon "SJB_TOS_FN57"

Exit

#M16A2

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddWeapon "SJB_TOS_M16A2"

Exit

#M4A1Cobra

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddWeapon "SJB_TOS_M4_Cobra"

Exit

#M16M203

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddWeapon "SJB_TOS_M16A2_M203"

Exit

#UMP45

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddWeapon "SJB_TOS_UMP45"

Exit

#SG552

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddWeapon "SJB_TOS_SG552"

Exit

#P90

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddWeapon "SJB_TOS_P90"

Exit

#MP5A4

_unit AddMagazine "JAM_MP5SAmag"

_unit AddMagazine "JAM_MP5SAmag"

_unit AddMagazine "JAM_MP5SAmag"

_unit AddMagazine "JAM_MP5SAmag"

_unit AddWeapon "SJB_TOS_MP5N"

Exit

#G36

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddWeapon "JAM_G36"

Exit

#AK-47

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddWeapon "SJB_TOS_AK47"

Exit

#SAW

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddWeapon "SJB_TOS_M249"

Exit

#M82A1

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddWeapon "SJB_TOS_M82A1"

Exit

#PSG-1

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddWeapon "SJB_TOS_PSG1_SD"

Exit

#RPG-7

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddWeapon "JAM_CAVS_RPG7Launcher"

Exit

#6_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

Exit

#3_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

Exit

#2_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

Exit

#1_Grenade

_unit AddMagazine "HandGrenade"

Exit

#2_SmokeShells

_unit AddMagazine "SmokeShell"

_unit AddMagazine "SmokeShell"

Exit

#1_SmokeShell

_unit AddMagazine "SmokeShell"

Exit

#Binocular

_unit AddWeapon "Binocular"

Exit

#NV

_unit AddWeapon "NVGoggles"

Exit

If you wanna put this to some use, download the SJB Weaponpack:

<a href="http://operationflashpoint.filefront.com/file/gofetch/ZmlsZWZyb250fHx8NDc0NTl8fHxVMHBDSUZkbFlYQnZibk1nVUdGamF3PT18fHwxLjF8fHw5MHx8fC9BZGRvbnMvV2

VhcG9uc3x8fHNqYl93ZWFwb25zcGFja192MS4xLmNhYnx8fDc3MjE2NjQ3NDU5NzMxMQ==" target="_blank">SJB WeaponPack</a>

If you have downloaded it (or already have it), just make some mission and insert this script into it. RUN CODE: [this"_typeName"] exec "WhateverYouWannaCallIt.sqs"

Share this post


Link to post
Share on other sites

As I said AgentJonathan, forget about it, it's all past now. wink_o.gif

Sorry but I still don't understand how you make the place in player's weapons loadout for those new magazines and weapons? Are you doing it in/with some other script or something?

EDIT: And don't worry about The-Architect. Sometimes he have such an erratic outbursts towards me, but don't blame him, he's not guilty if he was bornad that way, as tardo and not being fit for the outside world, and with 26 years still dependent on mama's breasts milk.

Share this post


Link to post
Share on other sites

OK man. wink_o.gif I'm glad things are back to normal. smile_o.gif I am now wondering if you know him personally or something, or if he just dosen't like you.

As I have said, if you wanna put some use to this script, you can download the SJB WeaponPack on my link.

P.S. Make sure you dont use a civillian or a sniper unit, otherwise, some weapons (Such as mac guns) wont work with the unit. yay.gif

Share this post


Link to post
Share on other sites
As I said AgentJonathan, forget about it, it's all past now. wink_o.gif

Sorry but I still don't understand how you make the place in player's weapons loadout for those new magazines and weapons? Are you doing it in/with some other script or something?

EDIT: And don't worry about The-Architect. Sometimes he have such an erratic outbursts towards me, but don't blame him, he's not guilty if he was bornad that way, as tardo and not being fit for the outside world, and with 26 years still dependent on mama's breasts milk.

Flamebaiting is not tolerated here.

+1 WL

Share this post


Link to post
Share on other sites

What is Flamebaiting? Did I, karantan, or Archy do that.

I really do not think me or karantan did that...

Share this post


Link to post
Share on other sites
Sorry but I still don't understand how you make the place in player's weapons loadout for those new magazines and weapons? Are you doing it in/with some other script or something?

For this q, i guess Ill give you a walk through. K? smile_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0

_type = _this select 1

?(_type == "Anaconda"): Goto "Anaconda"

?(_type == "Glock 17"): Goto "Glock17"

?(_type == "Glock 18"): Goto "Glock18"

?(_type == "50AE"): Goto "50Auto"

?(_type == "FN57"): Goto "FN57"

?(_type == "M16A2"): Goto "M16A2"

?(_type == "M4A1"): Goto "M4A1Cobra"

?(_type == "M16 M203"): Goto "M16M203"

?(_type == "UMP45"): Goto "UMP45"

?(_type == "SG552"): Goto "SG552"

?(_type == "P90"): Goto "P90"

?(_type == "MP5"): Goto "MP5A4"

?(_type == "G36"): Goto "G36"

?(_type == "AK-47"): Goto "AK-47"

?(_type == "M249"): Goto "SAW"

?(_type == "M82A1"): Goto "M82A1"

?(_type == "PSG"): Goto "PSG-1"

?(_type == "RPG7"): Goto "RPG-7"

?(_type == "6 Grenades"): Goto "6_Grenades"

?(_type == "3 Grenades"): Goto "3_Grenades"

?(_type == "2 Grenades"): Goto "2_Grenades"

?(_type == "1 Grenade"): Goto "1_Grenade"

?(_type == "2 SmokeShells"): Goto "2_SmokeShells"

?(_type == "1 SmokeShell"): Goto "1_SmokeShell"

?(_type == "Binocular"): Goto "Binocular"

?(_type == "Night Vision"): Goto "NV"

_type means what you type in the exec runcode, so as u know, _unit select 0 represents [this, , _type select 1 represents the name "_typeName"].

Sticking it together forms [this,"_typename"]

e.g. : [this,"Anaconda"] exec "guns.sqs"; [this,"P90"] exec "guns.sqs"

this gives you a P90 and an Anaconda pistol.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Text = Format["ERROR: INVALID GUN %1", _type]

HintC _errorText

Exit

this is a typocheck for ingame if you mess up.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#Anaconda

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddMagazine "SJB_TOS_Anaconda_Mag"

_unit AddWeapon "SJB_TOS_Anaconda"

Exit

This here is what i used in my example text above, this adds an Anaconda revolver, and 4 mags.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#Glock17

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddMagazine "SJB_TOS_Glock17C_Mag"

_unit AddWeapon "SJB_TOS_Glock17C"

Exit

#Glock18

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddWeapon "SJB_TOS_Glock18C"

Exit

#50Auto

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddMagazine "SJB_TOS_DesertEagle_Mag"

_unit AddWeapon "SJB_TOS_DesertEagle"

Exit

#FN57

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddMagazine "SJB_TOS_FN57_Mag"

_unit AddWeapon "SJB_TOS_FN57"

Exit

#M16A2

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddWeapon "SJB_TOS_M16A2"

Exit

#M4A1Cobra

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddMagazine "SJB_TOS_M4_Mag"

_unit AddWeapon "SJB_TOS_M4_Cobra"

Exit

#M16M203

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M16A2_Mag"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddMagazine "SJB_TOS_M203_Grenade"

_unit AddWeapon "SJB_TOS_M16A2_M203"

Exit

#UMP45

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddMagazine "SJB_TOS_UMP45_Mag"

_unit AddWeapon "SJB_TOS_UMP45"

Exit

#SG552

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddMagazine "SJB_TOS_SG552_Mag"

_unit AddWeapon "SJB_TOS_SG552"

Exit

#P90

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddMagazine "SJB_TOS_P90_Mag"

_unit AddWeapon "SJB_TOS_P90"

Exit

#MP5A4

_unit AddMagazine "JAM_MP5SAmag"

_unit AddMagazine "JAM_MP5SAmag"

_unit AddMagazine "JAM_MP5SAmag"

_unit AddMagazine "JAM_MP5SAmag"

_unit AddWeapon "SJB_TOS_MP5N"

Exit

#G36

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddMagazine "JAM_W556_G36_30Mag"

_unit AddWeapon "JAM_G36"

Exit

#AK-47

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddWeapon "SJB_TOS_AK47"

Exit

#SAW

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddMagazine "SJB_TOS_M249_Mag"

_unit AddWeapon "SJB_TOS_M249"

Exit

#M82A1

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddMagazine "SJB_TOS_M82A1_Mag"

_unit AddWeapon "SJB_TOS_M82A1"

Exit

#PSG-1

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddMagazine "SJB_TOS_PSG1_SD_Mag"

_unit AddWeapon "SJB_TOS_PSG1_SD"

Exit

#RPG-7

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddMagazine "JAM_CAVS_RPG7ALLRocket"

_unit AddWeapon "JAM_CAVS_RPG7Launcher"

Exit

#6_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

Exit

#3_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

Exit

#2_Grenades

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

Exit

#1_Grenade

_unit AddMagazine "HandGrenade"

Exit

#2_SmokeShells

_unit AddMagazine "SmokeShell"

_unit AddMagazine "SmokeShell"

Exit

#1_SmokeShell

_unit AddMagazine "SmokeShell"

Exit

#Binocular

_unit AddWeapon "Binocular"

Exit

#NV

_unit AddWeapon "NVGoggles"

Exit

Any of these will work. This whole pila crap is like 20 or 30 different scripts jammed into one, so you can add a variety of weapons from one script rather than having to type:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this] exec "Anaconda.sqs"; [this] exec "P90.sqs"; [this] exec "Binocular.sqs"

Instead rather than craploads of scripts, you can just do this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this,"Anaconda"] exec "guns.sqs"; [this,"P90"] exec "guns.sqs"; [this,"Binoculars"] exec "guns.sqs"

BTW: No subscripts smile_o.gif

If you still don't understand, I'll just give you a wizard, rather than a tute... smile_o.gif

Share this post


Link to post
Share on other sites

As I see you did not listen to a previous tip I gave, I will give it to you for a second time.

Maybe the design of this system is not ideal as I see you would need to call the script many times if you want to give a soldier a weapon, binoculars and NV goggles... each would require one script call with this design.

Think about this for a couple of minutes at least:

Any of these will work. This whole pila crap is like 20 or 30 different scripts jammed into one, so you can add a variety of weapons from one script rather than having to type:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this] exec "Anaconda.sqs"; [this] exec "P90.sqs"; [this] exec "Binocular.sqs"

Instead rather than craploads of scripts, you can just do this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this,"Anaconda"] exec "guns.sqs"; [this,"P90"] exec "guns.sqs"; [this,"Binoculars"] exec "guns.sqs"

The two methods you described are equally flawed.

I recommend you switch your design into loadouts tailored for unit types.

In your script you would give all equipment at one go for each unit, for example:

SpecOp loadout:

- give silenced weapon + magazines

- give satchel charges

- give binoculars

- give nvgoggles

Antitank soldier loadout:

- give normal assault rifle + magazines

- give antitank rocket launcher + rockets

- give pistol + magazines

etc...

Share this post


Link to post
Share on other sites

I think I know what you mean now, is this a good enough picture to your suggestion:

_unit = _this Select 0

_type = _this Select 1

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(_type == "Terrorist Loadout"): Goto "Terrorist"

#Terrorist

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddMagazine "SJB_TOS_AK47_Mag"

_unit AddWeapon "SJB_TOS_AK47"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "HandGrenade"

_unit AddMagazine "SmokeShell"

_unit AddMagazine "Mine"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddMagazine "SJB_TOS_Glock18C_Mag"

_unit AddWeapon "SJB_TOS_Glock18C"

Exit

Is that what you meant, Baddo? I had indeed considered doing this, but i will have to werk on my scrippy. smile_o.gif

Share this post


Link to post
Share on other sites

Yes that is what I meant. You then have to execute the script only once for each soldier.

Also use the removeAllWeapons.

Share this post


Link to post
Share on other sites

Yea. You may 'think' my theory is equally flawed, but it is alot more organized to have one script rather than 20 or 30 scripts.

But! I still think of using yer idea... smile_o.gif

oh, and i did not put in removeallweapons cuz i can easily do that in the editor. nener.giftounge2.gif  pistols.gif                                                                          wow_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×