V.I.P مؤسس المنتدى
| موضوع: كومندات الادمن | CS2D |الحلقة رقم 1 | Admin Commends الجمعة يوليو 14, 2017 11:05 am | |
| السلام عليكم و رحمة الله اليوم اشارككم كود في لعبة CS2D من صنعي و هو عن ادمن كومندز | Admin Commends لا نطيل عليكم هاهو الكود - الكود:
-
[right]Admin_Table = {160589}[/right] [right]RGBCLR = "255255255"[/right] [right][/right] [right]function table.find(tab,val)[/right] [right] for k, v in pairs(tab) do[/right] [right] if v == val then[/right] [right] return k[/right] [right] end[/right] [right] end[/right] [right] return false[/right] [right]end[/right] [right][/right] [right]function isAdmin(id)[/right] [right] return table.find(Admin_Table,player(id,"usgn"))[/right] [right]end[/right] [right][/right] [right]function string:split(b)[/right] [right] local cmd = {}[/right] [right] if type(self) == "string" then[/right] [right] if not b then match = "[^%s]+" else match = "[^"..b.."]+" end[/right] [right] for word in string.gmatch(self,match) do[/right] [right] table.insert(cmd,word)[/right] [right] end[/right] [right] end[/right] [right] return cmd[/right] [right]end[/right] [right][/right] [right]addhook("say","onSay")[/right] [right]function onSay(id,txt)[/right] [right] if txt == "rank" then[/right] [right] return 0[/right] [right] end[/right] [right] local s = txt:split()[/right] [right] if s[1] == "@say" then[/right] [right] txt = string.sub(txt,6)[/right] [right] if isAdmin(id) then[/right] [right] msg("©"..RGBCLR..player(id,"name").." (Admin): "..txt)[/right] [right] return 1[/right] [right] end[/right] [right] elseif s[1] == "!kick" then[/right] [right] local pl = tonumber(s[2])[/right] [right] if pl and player(pl,"exists") then[/right] [right] parse('kick '..pl)[/right] [right] end[/right] [right] return 1[/right] [right] end[/right] [right]end[/right] و السلام مسك الختام | |
|