Weapon given to specified player....

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
DON
Lance Corporal
Posts: 19
Joined: Fri Sep 12, 2003 5:50 pm

Weapon given to specified player....

Post by DON »

Hello,

How do i make a script file that does this: when i made a skin with a name, i choose that skin i select the MP44 (german then) and the script gives him instead of a MP44 a FG42, but when i selects the MP40 he gets the MP40, same with rifle, sniper etc. just the MP44 changes into a FG42, but when i select a regular skin, the skin gets the MP44, there was something like this before, can some1 help me on this one?

thanks
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Never tried it but I guess you could loop through the plauer array and check for the model, an then replace the waepon... but that would be in the map script and thus be map specific... I guess you want it on all maps...
Admin .MAP Forums
Image
Head above heels.
DON
Lance Corporal
Posts: 19
Joined: Fri Sep 12, 2003 5:50 pm

Post by DON »

well, yeah how can i do this, were can i start with?

thanks
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Just an untested scanner:

Code: Select all

player_scanner:
	while (1) {
		for(local.i = 1; local.i <= $player.size; local.i++) {
			local.player = $player[local.i]
			if(isAlive local.player) {
				if(local.player.model == "some/scpecific/model.tik") {
					// Swap weapons
					// Search the forum
					// on how to do it.
				}
			}
			waitframe
		}
		wait 1
	}
end
...but this is a good start I think.
Admin .MAP Forums
Image
Head above heels.
kai0ty
Brigadier General
Posts: 507
Joined: Fri Mar 19, 2004 1:45 am

Post by kai0ty »

u mean kina like for SH when u change the model u get a different set of guns?
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Yeah I guess buying SH would be the fool proof way to do it. LOL
But seriously: look around the forum, there are threads that deal with giving and taking weapons...

Also this may help: http://www.modtheater.com/forum/showthread.php?t=13801
Admin .MAP Forums
Image
Head above heels.
DON
Lance Corporal
Posts: 19
Joined: Fri Sep 12, 2003 5:50 pm

Post by DON »

hey thanks!

i need to look through the stuff, if i dont get it to work can u guys help me out it then?

thanks
Post Reply