How do you tell how many passenegr slots are in a vehecle?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

How do you tell how many passenegr slots are in a vehecle?

Post by small_sumo »

How do you tell how many passenegr slots are in a vehecle? I can open the skd in milk or lightray to see the names of the bones.

Thanks
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well no idea but this little script will tell you ;)... just put the vehicle in a map and give it targetname 'vehicle'.

Code: Select all

main:
	level waittill spawn
	
	wait 5
	
	thread findpassengerslots
end

findpassengerslots:
	local.num = 0
	while(1)
	{
		local.guy = spawn models/human/german_wehrmact_nco.tik targetname removeme
		local.slotid = $vehicle QueryFreePassengerSlot
		if(local.slotid == NIL || local.slotid == NULL)
			break
		$vehicle AttachPassengerSlot local.slotid local.guy
		local.num++
	}
	iprintln $vehicle.model " has " local.num " passenger slots"
	for(local.i = 1; local.i <= $removeme.size; local.i++)
		$removeme[local.i] commanddelay 0.05 remove
end
Image
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post by small_sumo »

Oh thats great, I am thinking of gluesing ai and mgs to different vehecles and putting them in mp levels, do you like my chances?

We will see what happens, thanks so much JV.
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
Post Reply