Forum

> > CS2D > Scripts > Other users don't see commands.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Other users don't see commands.

9 replies
To the start Previous 1 Next To the start

old Other users don't see commands.

Glix
User Off Offline

Quote
How do i make script like when you say @drop100 it drops coins under player, but other people will not see in chat text "@drop100".

1
2
3
4
5
6
7
8
addhook("say","say_drop")
function say_drop(id,txt)
	if (txt=="@drop100") or (txt=="!dropc") then
		if (player(id,"money")>99) then
		parse("spawnitem 66 "..player(id,"tilex").." "..player(id,"tiley").."")
		parse("setmoney "..id.." "..player(id,"money")-100)
		end
	end




and also this. When you say "@" + command what i don't have in my script then it say "Wrong command"!

old Re: Other users don't see commands.

mafia_man
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("say","say_drop")
function say_drop(id,txt)
	if txt == "@drop100" or txt == "!dropc" then
		if player(id,"money") >= 100 then
			parse("spawnitem 66 "..player(id,"tilex").." "..player(id,"tiley"))
			parse("setmoney "..id.." "..player(id,"money")-100)
			return 1
		end
	end
end

Just add return 1.

old Re: Other users don't see commands.

Glix
User Off Offline

Quote
user mafia_man has written
1
2
3
4
5
6
7
8
9
10
addhook("say","say_drop")
function say_drop(id,txt)
	if txt == "@drop100" or txt == "!dropc" then
		if player(id,"money") >= 100 then
			parse("spawnitem 66 "..player(id,"tilex").." "..player(id,"tiley"))
			parse("setmoney "..id.." "..player(id,"money")-100)
			return 1
		end
	end
end

Ok thanx, but can you help me with this. When you say "@" + text like @eat then it says in chat "wrong command"

Just add return 1.

old Re: Other users don't see commands.

mafia_man
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("say","say_drop")
function say_drop(id,txt)
	if string.sub(txt, 1, 1) == "@" or string.sub(txt, 1, 1) == "!" then
    	 if txt == "@drop100" or txt == "!dropc" then
          	if player(id,"money") >= 100 then
               	parse("spawnitem 66 "..player(id,"tilex").." "..player(id,"tiley"))
               	parse("setmoney "..id.." "..player(id,"money")-100)
               	return 1
          	end
     	elseif txt == "@drop1000" or txt == "!dropm" then
          	if player(id,"money") >= 1000 then
               	parse("spawnitem 67 "..player(id,"tilex").." "..player(id,"tiley"))
               	parse("setmoney "..id.." "..player(id,"money")-1000)
               	return 1
          	end
		else
			msg2(id, "©255000000Unknown command!")
		end
	end
end

old Re: Other users don't see commands.

Glix
User Off Offline

Quote
user mafia_man has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("say","say_drop")
function say_drop(id,txt)
	if string.sub(txt, 1, 1) == "@" or string.sub(txt, 1, 1) == "!" then
    	 if txt == "@drop100" or txt == "!dropc" then
          	if player(id,"money") >= 100 then
               	parse("spawnitem 66 "..player(id,"tilex").." "..player(id,"tiley"))
               	parse("setmoney "..id.." "..player(id,"money")-100)
               	return 1
          	end
     	elseif txt == "@drop1000" or txt == "!dropm" then
          	if player(id,"money") >= 1000 then
               	parse("spawnitem 67 "..player(id,"tilex").." "..player(id,"tiley"))
               	parse("setmoney "..id.." "..player(id,"money")-1000)
               	return 1
          	end
		else
			msg2(id, "©255000000Unknown command!")
		end
	end
end


So just do again else if to add more drop commands?

old Re: Other users don't see commands.

Glix
User Off Offline

Quote
Thank you very much!

EDIT1:
Everything works fine, but when i write @"text" it says Unknown command, but still show the msg what i writes in chat like this..

1
2
[17:52:58] Unknown command!
[17:52:58] []´Voyaflexelª /RU: @s

I want like the msg "@s" not shows in chat player gets only Unknown Command! :X

old Re: Other users don't see commands.

Jynxxx
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("say","say_drop")
function say_drop(id,txt)
	if string.sub(txt, 1, 1) == "@" or string.sub(txt, 1, 1) == "!" then
		if txt == "@drop100" or txt == "!dropc" then
			if player(id,"money") >= 100 then
				parse("spawnitem 66 "..player(id,"tilex").." "..player(id,"tiley"))
				parse("setmoney "..id.." "..player(id,"money")-100)
			end
		elseif txt == "@drop1000" or txt == "!dropm" then
			if player(id,"money") >= 1000 then
				parse("spawnitem 67 "..player(id,"tilex").." "..player(id,"tiley"))
				parse("setmoney "..id.." "..player(id,"money")-1000)
			end
		else
			msg2(id, "©255000000Unknown command!")
		end
		return 1
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview