Forum

> > CS2D > Scripts > Announce a killer "WANTED" script.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Announce a killer "WANTED" script.

10 replies
To the start Previous 1 Next To the start

old Announce a killer "WANTED" script.

muxarus
User Off Offline

Quote
Hello us nrealSoftWare!

Today i maked one script and me need your help.
So, i want to make script e.t. if your team is terrorsts and you killed somebody you will be wanted, my example but it didn't work :

1
2
3
4
5
6
addhook("kill","playerkill")
function playerkill(killer,victim)
		if player(killer,id) team==1 then
		msg2("©255000000Caution cops! ..player(killer,name).. WANTED FOR MURDER!")
end
end

old Re: Announce a killer "WANTED" script.

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
addhook("kill","playerkill")
function playerkill(killer,victim)
	if player(killer,"team") == 1 then
          msg2("\169255000000Caution cops! "..player(killer,"name").." WANTED FOR MURDER!")
	end
end

The function "player" requires two arguments - player id and value you want to get.
player(id,"value") is the correct way to check stuff about a player
your killer id is "killer" so "id" is not valid whereas your value is "team" so it should be called as a function argument, otherwise lua won't understand it. Finally, all values in messages have to be properly concatenated or they won't work.
edited 1×, last 01.02.15 09:31:06 pm

old Re: Announce a killer "WANTED" script.

Rainoth
Moderator Off Offline

Quote
My mistake. I didn't look through your code properly. You had made another mistake but I didn't correct it. Value has to be enclosed in quote symbol "
so what you wrote was
name
when it had to be
"name"

I edited the code in my previous reply. It should not give that error now.

old Re: Announce a killer "WANTED" script.

muxarus
User Off Offline

Quote
@user Rainoth: Thank you! but i have error in msg2 ''bad argument', and there fix: msg(string.char(169).."255000000Caution cops! "..player(killer,"name").." WANTED FOR MURDER!") '

Thank you! Thank you VERY MUCH!!!

old Re: Announce a killer "WANTED" script.

Muxye
User Off Offline

Quote
user muxarus has written
Hello us nrealSoftWare!

Today i maked one script and me need your help.
So, i want to make script e.t. if your team is terrorsts and you killed somebody you will be wanted, my example but it didn't work :

1
2
3
4
5
6
addhook("kill","playerkill")
function playerkill(killer,victim)
		if player(killer,id) team==1 then
		msg2("©255000000Caution cops! ..player(killer,name).. WANTED FOR MURDER!")
end
end

try this code
1
2
3
4
5
6
addhook("kill","playerkill")
function playerkill(killer,victim)
     if player(killer,"team") == 1 then
{
          msg2(@2552552555"@169255000000Caution cops! "..player(killer,"name").." WANTED FOR MURDER!")
}

old Re: Announce a killer "WANTED" script.

RedizGaming
GAME BANNED Off Offline

Quote
You can try to use it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function Array(size,value) 
	local array = {}
	for i = 1, size do
		array[i]=value
	end
	return array
end

criminal = Array(32,0)

addhook("kill","a")
function a(killer,victim,wpn)
	if criminal[victim]==true then
		criminal[killer]=false
		parse('setmoney '..id..' '..player(id,'money')+1500..' ')
		msg2(killer,"000255000","You Kill A Criminal!!, We Pay to you 1500$!")
	else
		criminal[killer]=true
		parse('setmoney '..id..' '..player(id,'money')-1500..' ')
		msg2(killer,"255000000","You Kill A Inosent Player!. Money less 1500$!")
	end
end

Try to use it

old that theme is closed

muxarus
User Off Offline

Quote
user RedizGaming has written
You can try to use it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function Array(size,value) 
	local array = {}
	for i = 1, size do
		array[i]=value
	end
	return array
end

criminal = Array(32,0)

addhook("kill","a")
function a(killer,victim,wpn)
	if criminal[victim]==true then
		criminal[killer]=false
		parse('setmoney '..id..' '..player(id,'money')+1500..' ')
		msg2(killer,"000255000","You Kill A Criminal!!, We Pay to you 1500$!")
	else
		criminal[killer]=true
		parse('setmoney '..id..' '..player(id,'money')-1500..' ')
		msg2(killer,"255000000","You Kill A Inosent Player!. Money less 1500$!")
	end
end

Try to use it

good script but some user helped me with that script.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview