Ab-47

Members
  • Content Count

    409
  • Joined

  • Last visited

Community Reputation

12 Decent

2 Followers

About Ab-47

  • Rank
    Thug
  • Birthday 31/07/1997

Details

  • Gang
    Criminals
  • Location
    Muscat
  • Occupation
    Developer
  • Interests
    Scripting/Programming, Football, Political Discussion, Physical Education, Driving, Music, Other sports and etc.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. "scoreboard" is an old resource, check to see if scoreboard even exists in your resource folder. The new one is dxscoreboard, same syntax I guess. Also, I would advise you to remove your code and just leave the exports, as far as I could see your code should work fine. Just the exports that aren't being called properly. Syntax looks correct, no typos spotted either. If you do have the old scoreboard, try updating to dxscoreboard and running the code again, let me know if there's any errors.
  2. Ab-47

    anti afk

    Could you be more specific about what you want? I could walk you through setting it up or creating one yourself.
  3. To answer your question, just use "takeWeapon" at the else. Also, it'd be more convenient using tables for these sorts of things. Element data is not the wisest choice. For example: local using_phone = {} function togglePhone(player) if (not using_phone[player]) then using_phone[player] = true --You could also add giveWeapon here (to continue your script) --Animation here else using_phone[player] = false --And here you could add takeWeapon here. --End animation here end end addCommandHandler("phone", togglePhone) Furthermore, I suggest you rethink your code, it doesn't look that great and you'll encounter issues in the future. For example, calling root to set a walking style.. First of, there's no need for the walking style as when the phone is enabled I assume you have a cursor enabled too, so the player couldn't move either way (unless you're using it as an idling position). Secondly, you're calling the root element of everything, not really efficient. You have "playerSource" defined, so just call it for "playerSource". Personal advice, remove that whole server function and client trigger for walking style. In addition to all this, I would add a triggerClientEvent to toggle the phone from this function and change the commandHandler to a bindKey. Drop a message if you need any help, we'll be of assistance. Good-luck.
  4. I was just thinking about this, getRealTime could actually work. I assume getRealTime would use the servers local time otherwise you could create a custom script where you could use fetchRemote to return a specific time using PHP. It's not that difficult either, PHP is somewhat similar to Lua. However you would need an online website for that. I wouldn't really recommend fetchRemote, just the standard MTA getRealTime should do the trick.
  5. Ab-47

    Warp player to

    Or you could just do this.. addCommandHandler("easr", function() local sx, sy, sz = getElementPosition(source) for i, v in pairs(getElementsByType("player")) do setElementPosition(v, sx + math.random(5, 10), sy, sz) end end )
  6. Ab-47

    The last reply

    You won't get away that easy hehuheuh
  7. Ab-47

    Drag'n'Drop

    You're creating a GUI in your code, I just modified the code you sent above including the variables you mentioned in your code. Try this isHolding = false addEventHandler( "onClientGUIMouseDown", getRootElement( ), function ( btn, x, y ) if (source ~= inventoryGridlist["inventory"]) then return end if btn == "left" and getElementType(source) == "gui-gridlist" then clickedElement = source local elementPos = { guiGetPosition( source, false ) } offsetPos = { x - elementPos[ 1 ], y - elementPos[ 2 ] } isHolding = true end end ) addEventHandler( "onClientGUIMouseUp", getRootElement( ), function ( btn, x, y ) if btn == "left" then if isHolding then isHolding = false clickedElement = nil end end end ) addEventHandler( "onClientCursorMove", getRootElement( ), function ( _, _, x, y ) if clickedElement and isHolding then guiSetPosition( clickedElement, x - offsetPos[ 1 ], y - offsetPos[ 2 ], false ) end end )
  8. Sorry for the late reply, in simple terms you can just call the setAccountData function again and again for as many variables as you like but the name must change setAccountData(account, "objectID1", id1) setAccountData(account, "objectID2", id2) setAccountData(account, "objectID3", id3) But to retrieve it you must call each piece of data, objectID1, objectID2, objectID3 and so on. But that's all time consuming and pointless A better way to do that is by setting the toJSON converted table to the account data and use fromJSON to retrieve it as stPatrick mentioned above. If you need any additional help, do let us know.
  9. Your code is a bit messy, I fixed a few typos that you had. Not gonna suggest SQL, it may be a bit more complex for you so for now just use accountData to save the ID. Player has to be logged in for this to work. Also added an extra function for when the player logs in, if the data was saved to their account it'll respawn on login. [[ Client ]] function finel () local item = guiGridListGetSelectedItem (myGirld) ID = guiGridListGetItemText (myGirld, item,3) body = guiGridListGetItemText (myGirld, item,4) rot = guiGridListGetItemText (myGirld, item,5) prices = guiGridListGetItemText (myGirld, item,2) triggerServerEvent( "give",localPlayer, localPlayer, prices,ID,body,rot) showCursor(false) destroyElement(window) end addEventHandler("onClientGUIClick", buying, finel) [[ Server ]] local obj = {} function maske_kaldir2(plr,pay,id,bdy,rot) local money = getPlayerMoney(plr) if (money > tonumber (pay)) then local account = getPlayerAccount(plr) if (not account) then return end setAccountData(account, "objectID", id) takePlayerMoney (plr,(pay)) obj[plr] = createObject ( id, 0, 0, 0, 0, 0, 0 ) exports.bone_attach:attachElementToBone(obj[plr],plr,1,0,0,-0.61,0,0,90) else outputChatBox ("You dont have Money" ,plr ,255,0,0) end end addEvent("give",true) addEventHandler("give", root, maske_kaldir2) addEventHandler("onPlayerLogin", root, function() if (isElement(source) and getElementType(source) == "player") then if (getPlayerAccount(source)) then local account = getPlayerAccount(source) local object = getAccountData(account, "objectID") if (object) then obj[source] = createObject ( object, 0, 0, 0, 0, 0, 0 ) exports.bone_attach:attachElementToBone(obj[source],source,1,0,0,-0.61,0,0,90) outputChatBox("Object given", source, 255, 0, 0) end end end end )
  10. Ab-47

    Drag'n'Drop

    You could use the following functions/events > (Event) -> onClientClick -> Returns: you'll need to identify the clickedElement as the type of GUI you want to move button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement Instead of the above you could use: (Event) -> onClientGUIClick -> which returns the clicked GUI element rather than an element clicked -> returns: button, state, absoluteX, absoluteY (Event) -> onClientCursorMove -> Returns: use absoluteX, absoluteY as your X / Y params needed to move. cursorX, cursorY, absoluteX, absoluteY, worldX, worldY, worldZ (Function) -> guiSetPosition() -> usage: guiSetPosition(clickedElement, absoluteX, absoluteY, false) Use onClientRender/onClientPreRender to render the moving transition of the element you're moving. Not sure if this is the best way, but most simple. Goodluck
  11. I did mention above to remove your headphones lol, but anyways, I guess you have your sound/devices default as your monitor. Open your control panel > click "Hardware and Sound" > click "Sound" > a box should appear, try select the device you want to use to output your sound and click on "Set Default". Maybe that would help, maybe your default device is set to the wrong thing. If that doesn't work, right click your sound icon and click "Troubleshoot sound problems" and run the troubleshooter, it should fix your issue. If after changing your default device and your sound doesn't work, try reboot your PC and it should be fine.
  12. Well at-least you're getting somewhere now. Does MTA run fluently as-well, just without sound? Just double check that your sound drivers are updated and your sound is enabled in MTA settings > Audio tab.
  13. Honestly I don't know what the issue could be, so I'm sorry. Don't give up yet, try do the following: Delete the gta_sa.set file located in the GTA San Andreas User Files in your Documents folder. Check in your GTA San Andreas installation directory for a D3D9.dll. If one is present, delete it. Then install MTA SA's latest version without starting up GTA SA. Then install the latest patch: https://nightly.mtasa.com/?mtasa-1.5-rc-latest After all of that, try run MTA SA and click "Host Server", just enter your own local server to see if you could actually load the game without issues. If that works, try join a server preferably without mods or such, or if you could launch your local server through MTA / Server / MTA Server application and join your server in the locals tab. Let me know your findings/outcome of this, if you're able to join a local server fine, if you're able to connect to a random server etc. I'll keep on looking for solutions to help you.
  14. Ab-47

    mta timed out

    Well to test if the issue is actually there, try playing directly through your modem rather than the router and see for yourself. I'm not sure if there's a way around this as it's nothing to do with the configuration, rather the gateway between the 2 devices causing the jitter which is enough to take you offline for a few seconds. Maybe do a little google search to see if other gamers had this issue, I'm guessing your best bet would be to buy a better router lol