Forum

> > CS2D > Scripts > Custom gun for only you
Forums overviewCS2D overview Scripts overviewLog in to reply

English Custom gun for only you

6 replies
To the start Previous 1 Next To the start

old Custom gun for only you

Dovahkin
User Off Offline

Quote
Hey guys! I need help for one of my script. (It's actually from Avobolt - Credits to you)

How can I make my custom weapon name only to me. But whenever someone uses the same weapon. They have the custom weapon name too.

1
2
3
4
5
6
7
8
9
10
11
12
names={["2"]="Psycho Gun"}
addhook("hit","_hit")
function _hit(id,source,weapon,hpdmg)
	if player(id,"health")-hpdmg<=0 then
		wpn=tostring(weapon)
		nm=names[wpn]
		if nm==nil then nm=item(weapon,"name") end
		parse('customkill '..source..' "'..nm..'" '..id..'')
		return 1
	end
end
end


Everyone who uses the Glock(2) they show desame name. How can I change it for me only?E

old Re: Custom gun for only you

Cure Pikachu
User Off Offline

Quote
By USGN ID:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
names={["2"]="Psycho Gun"}
addhook("hit","_hit")
function _hit(id,source,weapon,hpdmg)
	if player(source,"usgn") == 43653 then
		if player(id,"health")-hpdmg<=0 then
			wpn=tostring(weapon)
			nm=names[wpn]
			if nm==nil then nm=item(weapon,"name") end
				parse('customkill '..source..' "'..nm..'" '..id..'')
				return 1
			end
		end
	end
end

old Re: Custom gun for only you

Dovahkin
User Off Offline

Quote
@user Rainoth: Thanks for the help. But still not right.

It's like this.

There is 2 choices in a menu.
1 is a Psycho Gun
2 is a Hobo Gun


But still the same gun [Glock(2)]

Whenever I buy any of those two. The name updates. But all of the names are shared to all players. I want it to be mine only.

old Re: Custom gun for only you

Cure Pikachu
User Off Offline

Quote
If it's on its own, it would be
1
2
3
4
5
6
7
8
9
10
11
12
13
nm={}
names={["2"]="Psycho Gun"}
addhook("hit","_hit")
function _hit(id,source,weapon,hpdmg)
	if player(id,"health")-hpdmg<=0 then
		wpn=tostring(weapon)
		nm[source]=names[wpn]
		if nm[source]==nil then nm=item(weapon,"name") end
			parse('customkill '..source..' "'..nm[source]..'" '..id..'')
			return 1
		end
	end
end
Otherwise, try and adapt it.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview