Page 1 of 1

Weapon given to specified player....

Posted: Sat May 08, 2004 8:03 pm
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

Posted: Sun May 09, 2004 11:06 am
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...

Posted: Sun May 09, 2004 5:09 pm
by DON
well, yeah how can i do this, were can i start with?

thanks

Posted: Sun May 09, 2004 5:28 pm
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.

Posted: Sun May 09, 2004 7:58 pm
by kai0ty
u mean kina like for SH when u change the model u get a different set of guns?

Posted: Sun May 09, 2004 8:48 pm
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

Posted: Mon May 10, 2004 5:36 pm
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