Forum

> > CS2D > Scripts > Say commend
Forums overviewCS2D overview Scripts overviewLog in to reply

English Say commend

14 replies
To the start Previous 1 Next To the start

old Say commend

Sniper Killer
User Off Offline

Quote
hey its me again i dont know how but i want to change a commend from Chingy admin script (i have the permission for my own server) when i say thats commend [url=]@say[/url] thats come like thats
Sniper Killer[Admin] : hi
sniper Killer : hi
i want to change this :
Quote
Sniper Killer[Admin] : hi
sniper Killer : hi
to just
Sniper Killer [admin]: hi

old Re: Say commend

Mora
User Off Offline

Quote
maybe this?
1
2
3
4
5
6
7
8
9
10
11
admin={xxx}

addhook("say","adms")
function adms(id,message)
for _,usgn in ipairs(admin) do
if player(id,"usgn")==usgn then 
msg("©255255255 "..player(id,"name").." [Admin]: "..message)
return 1
end
end
end

if this not work,i will fix,but you will tell me ERROR code.
P.s-dont forget replace "xxx" to your usgn id,you may put more usgn in.

old Re: Say commend

Marcell
Super User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
----------------------------
----- Say Script for -------
-----  Sniper Killer -------
---- by Salad Fingers ------
----------------------------
-- Date:  15:00 2014.02.10.
----------------------------
admins = {6943} -- Put admins's usgn here!
cRED = "©255000000"

function table.contains(table, element)
    for key, value in pairs(table) do
        if value == element then
            return true
        end
    end
end

addhook("say","admin_say")
function admin_say(id, message)
if table.contains(admins,player(id,"usgn")) then
msg(""..cRED.." "..player(id,"name").." [Admin]: "..message)
return 1
end
end

Tested, works fine..

Anyway user Mora 's script works fine too, but i always script to somebody myself..

Do not forgot to save it in ANSI otherwise you will get something like this: IMG:https://i.imgur.com/JB7nC0q.png

old Re: Say commend

Mora
User Off Offline

Quote
@user Marcell: mine script is not correct,but it fast,title is "Say commend",but i make "admin say"(we make)

ofc your better

old Re: Say commend

Marcell
Super User Off Offline

Quote
No way dude!

Your one more simple! I just learning lua, thats why makes everything hard

old Re: Say commend

Sniper Killer
User Off Offline

Quote
@user Mora: the Script work fine and thx
@user Marcell: thx very much for help but can i add it in script and how to add it
add i forgot here is your cookies to @user Mora: ,@user Marcell:
IMG:https://www.unrealsoftware.de/img/cookies.gif

IMG:https://www.unrealsoftware.de/img/cookies.gif

and btw @user Marcell: can you do the same script whit member and mods pls
rember i'il give cookies
i think your is work but i think i have parmeter problem look how she come
IMG:https://imageshack.com/a/img856/6919/plbl.jpg
edited 1×, last 11.02.14 09:26:57 am

old Re: Say commend

MikuAuahDark
User Off Offline

Quote
you're only allowed to use 1 cs2d lua hook say at your whole scripts(with exception of HC Emoticon script, i said this because i see that you use it)

old Re: Say commend

Marcell
Super User Off Offline

Quote
Enjoy, use it, deal it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"------------------------------
---- Edited Say Script -------
------		for		 ---------
-----  Sniper Killer ---------
---- by Salad Fingers --------
------------------------------
-- Date:  13:40 2014.02.11. --
------------------------------
admins = {} -- Put admins's usgn here!
moderators = {} -- Put moderators's usgn here!
members = {6943} -- Put members's usgn here!
cRED = "©255000000"
cGREEN = "©000255000"
cWHITE = "©255255255"

function table.contains(table, element)
    for key, value in pairs(table) do
        if value == element then
            return true
        end
    end
end

addhook("say","tag")
function tag(id, message)
if table.contains(admins,player(id,"usgn")) then
msg(""..cRED.." "..player(id,"name").." [Admin]: "..message)
return 1
elseif table.contains(moderators,player(id,"usgn")) then
msg(""..cGREEN.." "..player(id,"name").." [Moderator]: "..message)
return 1
elseif table.contains(members,player(id,"usgn")) then
msg(""..cWHITE.." "..player(id,"name").." [Member]: "..message)
return 1
end
end"

old Re: Say commend

Mora
User Off Offline

Quote
@user Sniper Killer: try use mine or @user Marcell: script with out your scripts,only made by we,then tell what you see,if this works,then you use more than 1 "say" hook,because i see in your screen, ":)" and it display as smiley.

if you don`t know how to fix problem,just use one hook for all functions you have.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview