Forum

> > CS2D > Scripts > @report - May I Please Have Some Help?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch @report - May I Please Have Some Help?

26 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Re: @report - May I Please Have Some Help?

KimKat
GAME BANNED Off Offline

Zitieren
that xSmilex dude knows what I'm talking about... since you don't want to report yourself either. A Lua script shouldn't be able to produce errors and cause Lua script to exit itself, like it usually does. Some Lua scripts can go on even if errors, I forgot how to do that, lol. MiroslavR had a Lua like that though.

alt Re: @report - May I Please Have Some Help?

cortz
Super User Off Offline

Zitieren
xlSmilelx's script reminds me of Kossrifle's lua script.

Since he also outputted the file to a .html and uses "ERROR: Correct Syntax is @report [ID] [reason]."

I could be wrong since I'm too lazy to check.
------

Another good anti-spam method could be setting a timeout.

alt Re: @report - May I Please Have Some Help?

Cirium
User Off Offline

Zitieren
I have this:
but its not much use, cause I still get a ERROR

addhook("say", "startsay")

function startsay(id, message)
for i=1,table.getn(saycom) do
table.remove(saycom, i)
end
for key,value in pairs(split(message, " ")) do
saycom[key]=value
end

saycom[1]="@report" then
     if rankid[id] < 1 then msg2(id, Color(255, 0, 0), "ERROR: You do not have enough power to execute that command.") ; return 1; end
          if table.getn(saycom)==3 then
               if isnumber(saycom[2]) then
                    saycom[2]=saycom[2]-1+1
                         if player(saycom[2], "exists") then
                              if saycom[2]==id then
                              msg2(id, Color(255, 0, 0), "ERROR: You may not report yourself.")
                              return 1
                              else
                                   file2=io.open("/var/www/reported.html", "a+")
                                   file2:write("<br>\n<br>\n"..os.date().."<br>\n"..player(id, "name").." ("..myname[id]..") IP: "..player(id, "ip").." USGN: "..myusgn[id].." REPORTED <br>\n"..player(saycom[2], "name").." IP: "..player(saycom[2], "ip").." USGN: "..myusgn[saycom[2]].."<br>\nReason: "..saycom[3])
                                   file2:close()
                                   msg(Color(255,255,255), player(id, "name").." used "..string.lower(message.."."))
                                   return 1
                                   end
                                        msg2(id, Color(255, 0, 0), "ERROR: Player does not exist.")
                                        return 1
                                        end
                              else
                                   msg2(id, Color(255, 0, 0), "ERROR: Correct Syntax is @report [ID] [reason].")
                                   return 1
                              end
                         else
                              msg2(id, Color(255, 0, 0), "ERROR: Correct Syntax is @report [ID] [reason].")
                              return 1
                         end

alt Re: @report - May I Please Have Some Help?

KimKat
GAME BANNED Off Offline

Zitieren
The Lua contains lacking ends! you basicly need to "end" each "if" statement in the script. Then it will work again.

I also want to remind you to use [ code ] [ /code ] tags when posting Lua script code.

alt Re: @report - May I Please Have Some Help?

Hanz
User Off Offline

Zitieren
NeedlerGamer hat geschrieben
I have this:
but its not much use, cause I still get a ERROR

addhook("say", "startsay")

function startsay(id, message)
for i=1,table.getn(saycom) do
table.remove(saycom, i)
end
for key,value in pairs(split(message, " ")) do
saycom[key]=value
end

saycom[1]="@report" then
     if rankid[id] < 1 then msg2(id, Color(255, 0, 0), "ERROR: You do not have enough power to execute that command.") ; return 1; end
          if table.getn(saycom)==3 then
               if isnumber(saycom[2]) then
                    saycom[2]=saycom[2]-1+1
                         if player(saycom[2], "exists") then
                              if saycom[2]==id then
                              msg2(id, Color(255, 0, 0), "ERROR: You may not report yourself.")
                              return 1
                              else
                                   file2=io.open("/var/www/reported.html", "a+")
                                   file2:write("<br>\n<br>\n"..os.date().."<br>\n"..player(id, "name").." ("..myname[id]..") IP: "..player(id, "ip").." USGN: "..myusgn[id].." REPORTED <br>\n"..player(saycom[2], "name").." IP: "..player(saycom[2], "ip").." USGN: "..myusgn[saycom[2]].."<br>\nReason: "..saycom[3])
                                   file2:close()
                                   msg(Color(255,255,255), player(id, "name").." used "..string.lower(message.."."))
                                   return 1
                                   end
                                        msg2(id, Color(255, 0, 0), "ERROR: Player does not exist.")
                                        return 1
                                        end
                              else
                                   msg2(id, Color(255, 0, 0), "ERROR: Correct Syntax is @report [ID] [reason].")
                                   return 1
                              end
                         else
                              msg2(id, Color(255, 0, 0), "ERROR: Correct Syntax is @report [ID] [reason].")
                              return 1
                         end


wrong repair your end to like this

1
2
3
end
     end
end

alt Re: @report - May I Please Have Some Help?

244453211332112
User Off Offline

Zitieren
Guys i meant:

You will say:
@report 4 He is speedhacking

than by the admins will come:
Someone has reported [Here the name of ID 4]: He is speedhacking


Also i mean, that you can make your own reporttext and not a setted text

alt O_O

Cirium
User Off Offline

Zitieren
Okay, i ended it off with

end
end
end

and it seems to work. but now i get a nil error

LUA ERROR: sys/lua/server.lua:1: attempt to index global 'saycom' (a nil value)

based on what i know it should work correctly??
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht