Page 1 of 1

When I script, it adds bad weapons to me! Help!

Posted: Fri Dec 19, 2008 6:09 pm
by Lillemann1993
If I make a script like this:

Code: Select all

main:

exec global/ambient.scr 
exec global/cardgame.scr
exec global/loadout.scr 

level waittill prespawn

wait 2
$player stufftext "tmstartloop sound/music/Kleveburg.mp3"

level waittill spawn

thread disguise

disguise: 
$trigger waittill trigger 
$suit remove 
$papers remove 
iprintlnbold "Show your papers when asked."
local.key = getboundkey1 "toggleitem"
iprintlnbold_noloc (loc_convert_string "Press the ( ") local.key (loc_convert_string " ) key to show your papers.")
$player playsound pickup_papers 
$player playsound pickup_uniform 
waitthread global/items.scr::add_item "papers_level1" 
waitthread global/items.scr::add_item "uniform" 
end
It adds a sniper/colt and some more weapons, and I don't want them in my map, I'm making a undercover map and the player start is close to the first quard and I don't have time to press "Q" to hide weapons.

What should I do to stop my script to add this weapons?

Posted: Fri Dec 19, 2008 6:48 pm
by $oldier Of Ra
Comment exec global/loadout.scr out. It automatically adds weapons when you spawn. If you want to choose your own weapons for the player use these command. But you must use the modelpath of the weapons, models/weapons/... Like so:

Code: Select all

$player giveweapon "models/weapons/my_weapon.tik"
You can find all the correct paths for the weapons in pak0.pk3/models/weapons/. You can give the player as many weapons as you want. You can also give him binoculars by using "models/items/binoculars.tik".
When you give them like this, the player won't be holding the weapon in his hands, he has to scroll through his gear; use the following command to make the player hold the weapon you want when he starts the mission:

Code: Select all

$player use "models/weapons/my_weapon.tik"
A player can only hold/use 1 weapon/item ;) So do this only once for the weapon/item you want! Of course the player must have been given this model!
Now when you did this all, you can holster the player's weapon immediately:

Code: Select all

$player safeholster 1
Use "$player safeholster 0" to make the player take out the weapon he was holding before you used the "$player safeholster 1" command

NOTE: Make sure you do all these commands after level waittill spawn!!