-
Posts
313 -
Joined
-
Last visited
Everything posted by MAB
-
There are alot of examples at the wiki, check the link in below. Click_Here! If i understood it, what i am doing here? wasting time?
-
I didn't understand your code but from this word i understood i thought that when you do "time = getTickCount" for example it starts counting from 0 not the server running time
-
that mean "if the tick count we set to the player crossed 3000 or equal to it." so it should be if antiSpamChat[source] >= 3000 then
-
I don't understand if not antiChatSpam[source] or antiChatSpam[source] + 3000 <= getTickCount() then antiChatSpam[source] = getTickCount()
-
yea yea i need an example.. doesn't matter example??
-
thanks for helping .. yes it is better to cancel event but there is no argument for reason
-
what is the problem with that anti-spam? function unmute() if isElement(p) then setElementMuted(p,false) end end spams = {} -- anti chat spam function mute() local name = getPlayerName(source) for i,v in pairs(spams) do if v == name then setPlayerMuted(source,true) setTimer(unmute,3000,1,source) else table.insert(spams,name) end end end addEventHandler("onPlayerChat",root,mute) setTimer(function() spams={} end,3000,0)
-
How to create a chat channel? How to set settings for my resources? Can i get an example of SQL codes that saves the name color or something? I know SQL but never used it with MTA.
-
nothing in debug.. i am sure that the code is right... and not working!!!!!!!!!! note that the localPlayer "loginpanel" data is set to true by another function...this isn't the full code.. it is the code that contains the problem.. when i click on the flag image nothing happens local sx,sy = guiGetScreenSize() local languages = { {name = "English",user = "Username:",pass = "Password:",login = "Login",register = "Register",flag = "images/uk.png"}, {name = "Arabic",user = "اسم المستخدم:",pass = "كلمة السر:",login = "دخول",register = "تسجيل",flag = "images/ksa.png"} } function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function draw() if getElementData(localPlayer,"loginpanel") == true then for i=1,#languages do if getElementData(localPlayer,"loginlanguage") == languages[i].name then dxDrawImage(sx - 70,10,58,34,languages[i].flag) end end end end addEventHandler("onClientRender",root,draw) function click(b,s) if getElementData(localPlayer,"loginpanel") == true then if b == "left" and s == "up" then if isMouseInPosition(sx - 70,10,58,34) then for i=1,#languages do if getElementData(localPlayer,"loginlanguage") == languages[#languages].name then setElementData(localPlayer,"loginlanguage",languages[1].name) else i = i + 1 setElementData(localPlayer,"loginlanguage",languages[i].name) end end end end end end addEventHandler("onClientClick",root,click)
-
nah.. by thanks for the try Lindesy Stirling
-
I am triggering an client event to add some strings to a table.. not working.. or let me by more clear.. ty is not found always... Always says "Name Joined the game." but never "Name left the game." that is because ty is not found so what to do? NOTICE: tested by increasing the time of the timer client: local sx,sy = guiGetScreenSize() local joins = {} function delete2(n,t) for i=1,#joins do if joins[i].name == n and joins[i].ty == t then table.remove(joins,i) end end end function addOnQuit(n,t) table.insert(joins,{name = n, ty = t}) setTimer(delete2,3000,1,n,t) end addEvent("addone2",true) addEventHandler("addone2",root,addOnQuit) function draw() for i=1,#joins do if joins[i].ty then local ty = joins[i].ty dxDrawImage(10,(sy/2)+(i*10),16,16,"images/quit.png") dxDrawText(joins[i].n.." left the game. ["..ty.."]",30,(sy/2)+(i*10)+3,nil,nil,tocolor(255,255,255,255),1,"default-bold") else local name = joins[i].name dxDrawImage(10,(sy/2)+(i*10),16,16,"images/join.png") dxDrawText(name.." joined the game.",30,(sy/2)+(i*10)+3,nil,nil,tocolor(255,255,255,255),1,"default-bold") end end end addEventHandler("onClientRender",root,draw) server: function trigger2(t) local name = getPlayerName(source) triggerClientEvent("addone2",root,name,t) end addEventHandler("onPlayerQuit",root,trigger2)
-
Very nice... what about positions? X , Y ... ??
-
Can someone make a simple dxDrawRoundedRectangle() function (Draws a rounded rectangle)
-
OH MY GOD The link plays the music.. must it be downloadable so it works?