Spearhead Nationality

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
abstraxion
Private
Posts: 1
Joined: Tue Sep 12, 2006 12:35 pm

Spearhead Nationality

Post 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
neillomax
Lieutenant General
Posts: 880
Joined: Thu Jun 23, 2005 6:57 am

Post by neillomax »

That would be a give/take weapons script.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply