Page 1 of 1

Spearhead Nationality

Posted: Tue Sep 12, 2006 12:39 pm
by abstraxion
I've had a quick scout around and not come up with anything on this subject, but I'm hoping that somebody can help..

Is there a way of getting / working out the nationality of the skin a client has selected from the server.

For example, I want to give everyone an SMG, but I want all of the UK skinned players to get a Sten, all of the Russians to get a PPSH, and all of the Americans to get a Thomson. I need to know which skin type they are using to determine which weapon to give therefore.

Hopefully that's easily understandable, and easy to do!

Baz

Posted: Tue Sep 12, 2006 3:23 pm
by neillomax
That would be a give/take weapons script.

Posted: Tue Sep 12, 2006 4:22 pm
by Rookie One.pl
I wrote this for the Spearhead version of my Fire For Effect mod (lowercase is just a thread that turns all letters in a string to lower case):

Code: Select all

get_player_nation:
	local.mdl = waitthread lowercase self.model
	if (local.mdl[15] == "l")
	{
		if (local.mdl[21] == "b" && local.mdl[22] == "r" && local.mdl[23] == "i" && local.mdl[24] == "t" && local.mdl[25] == "i" && local.mdl[26] == "s" && local.mdl[27] == "h" && local.mdl[28] == "_")
			local.nation = "british"
		else if (local.mdl[21] == "r" && local.mdl[22] == "u" && local.mdl[23] == "s" && local.mdl[24] == "s" && local.mdl[25] == "i" && local.mdl[26] == "a" && local.mdl[27] == "n" && local.mdl[28] == "_")
			end "russian"
		else
			end "american"
	}
	else if ((local.mdl[14] == "a" && local.mdl[15] == "x" && local.mdl[16] == "i" && local.mdl[17] == "s") || (local.mdl[14] == "g" && local.mdl[15] == "e" && local.mdl[16] == "r" && local.mdl[17] == "m" && local.mdl[18] == "a" && local.mdl[19] == "n"))
		end = "german"
end "american"
Use it like this:

Code: Select all

local.nation = local.player waitthread get_player_nation