Forum

> > CS2D > Scripts > @report - May I Please Have Some Help?
Forums overviewCS2D overview Scripts overviewLog in to reply

English @report - May I Please Have Some Help?

26 replies
Page
To the start Previous 1 2 Next To the start

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

KimKat
GAME BANNED Off Offline

Quote
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.

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

cortz
Super User Off Offline

Quote
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.

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

Cirium
User Off Offline

Quote
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

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

KimKat
GAME BANNED Off Offline

Quote
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.

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

Hanz
User Off Offline

Quote
NeedlerGamer has written
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

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

244453211332112
User Off Offline

Quote
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

old O_O

Cirium
User Off Offline

Quote
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??
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview