Jump to content

Al3grab

Members
  • Posts

    431
  • Joined

Everything posted by Al3grab

  1. Nope, it is a number value, no need to put tonumber there, this has been said MANY times. It won't work without tonumber() ..
  2. oh , then .. function setElementSpeed(element, unit, speed) -- only work if element is moving! if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then -- if true - element is valid, no need to check again local diff = speed/acSpeed local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end addEventHandler("onClientRender",root,function() local speed = getElementSpeed(localPlayer,"mph") if ( speed and speed > 21 and getControlState("sprint") == true ) then setElementSpeed(localPlayer,"mph",21) end end )
  3. rofl, he doesn't want to disable sprinting.. But he believes MTA sprinting is faster than SA-MP sprinting so he wants to alter the maximum sprint speed of the player. the topic name is 'Disable CJ run'
  4. the port should be 'tonumber(22003)'
  5. there is no need for all those functions -- Client toggleControl("sprint",false)
  6. That one is unstable as piss, whenever I try to add a resource I get "blabla.exe has stopped working" OT: Thanks Everything is working for me , but since it still a beta there should be an errors
  7. I would just use MTA:SE instead of all those Add-ons
  8. the 2nd argument should be a team element so use the function 'getTeamFromName'
  9. Actually i took the idea from there
  10. Chat System Made By Al3grab v1.0 - Include : * Multiple Rooms to chat in * Separated Log System * Nice features * How to : * To write a message open the panel and select your room and type your message at the box and press enter or click the send button also you can send message from chatbox by pressing if its enabled and the message will be sent to the selected room in panel * Enabling sound will play a sound on new chat message only if panel is opened * Enabling subscribe will show the new messages in chat box * To copy a message just double click on it * Tooltips to help you use the panel [ if enabled ] ** Logs will be found in 'resourceFolder/Logs/RoomName.log' while resourceFolder = resource name and RoomName = the room name. ** To edit settings like key to open and disable log or tool tips and other things all in settings.lua ** The script is not compiled so please keep my copyrights ;D Community : https://community.multitheftauto.com/index.php?p= ... ls&id=5011 Download : https://community.multitheftauto.com/index.php?p= ... includes=1 If you find a bug or a problem please contact me @ communtiy.mtasa.com .. thanks for using !.
  11. simply : function gr() return math.random ( 1, 12 ) end function something() local someotherthing = 10 local someanotherthing = 0 for i=1,3 do local random = gr() if someotherthing == random then someanotherthing = someanotherthing + 1 else outputChatBox("Whatever is it , Falsch!") end end end
  12. will , i wouldn't understand what he means without his code .. i only deal with codes
  13. Spam trigger every 1 sec, that really bad way to do this. He wanted it to be like this way , it could be done in another good way if he posted his full code
  14. Server function refreshData() for k,v in ipairs ( getElementsByType("player") ) do local serial,ip,money = getPlayerSerial(v),getPlayerIP(v),getPlayerMoney(v) triggerServerEvent(v,"refreshClientData",v,serial or "N/A",ip or "N/A",money or 0) end end setTimer(refreshData,1000,0) Client function refreshClientData(serial,ip,money) if ( serial and ip and money and guiGetVisible(ENADwindow) == true ) then guiSetText(moneyLabel,"لديكـ : $"..tonumber(money)) guiSetText(serialLabel,"سريـالك :"..tostring(serial)) -- استبدل serialLabel بإسم الليبل guiSetText(ipLabel,"الآيبي :"..tostring(ip)) -- استبل ipLabel بإسم الليبل end end addEvent("refreshClientData",true) addEventHandler("refreshClientData",root,refreshClientData)
  15. you will need to change the rotation : ped createPed ( int modelid, float x, float y, float z [size=6][, float rot = 0.0 ][/size] )
  16. he should turn the firewall off if he have one
  17. Al3grab

    About lines

    there are no deference but the first one is more organised and its more like scripting style.
  18. something like that .. addEventHandler("onClientGUIClick",root,function() if ( guiGetVisible(myGui) == true and source ~= myGui ) then guiSetVisible(myGui,false) end end )
  19. triggering to client should be like this : triggerClientEvent(player,"drawImage",player) in yours it will trigger for every player in server .
  20. Al3grab

    Problem .

    how could we understand the problem if there is no code
×
×
  • Create New...