Jump to content

Wei

Members
  • Posts

    814
  • Joined

  • Last visited

Everything posted by Wei

  1. Wei

    Label

    Yes it is ! guiLabelGetTextExtent
  2. addEventHandler("onResourceStart", getRootElement(), teamgui) onResourceStart is server-side event!
  3. You must calculate it. https://forum.multitheftauto.com/viewtopic.php?f=91&t=69692
  4. Wei

    Help me!

    waitTimer = {} waitTime = 5000 -- time in miliseconds function giveCar ( thePlayer, commandName ) if getElementType ( thePlayer ) == "player" then if (waitTimer[thePlayer]) then return -- add here outputChatBox if you want it! end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local x, y, z = getElementPosition(thePlayer) if isObjectInACLGroup ("user."..accName, aclGetGroup ("VIP")) then local comet = createVehicle ( 480, x, y, z+0.5 ) warpPlayerIntoVehicle ( thePlayer, comet ) waitTimer[thePlayer] = setTimer(waitTime, 1, function() end) else outputChatBox("You are not a VIP.",thePlayer,255,60,60) end end end addCommandHandler ( "pc", giveCar ) I know you can use getTickCount but this is easyer
  5. screenWidth/2 - 1229 maybe because of this ?
  6. I am scripting for like realy long time, and I still don't understand how to calculate dx draws for all resolutions ? like i want a reactangle at 300 300 300 300 at my resolution (1024/768). How would I make that player wich has bigger resolution would have in same place? (it would be more than 300) Thanks, Wei
  7. You must script it with fetchRemote. You have all information on wiki.
  8. Wei

    Funny problem.

    function cancelPedDamage ( attacker ) cancelEvent() -- cancel any damage done to peds end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage )
  9. function removeOneVSOneWeapon ( markerhit, matchingDimension ) if ( markerhit == outOneVSOneMarkertoPrincipalInterior ) then takeWeapon ( thePlayer, 2 ) takeWeapon ( thePlayer, 4 ) takeWeapon ( thePlayer, 5 ) takeWeapon ( thePlayer, 6 ) takeWeapon ( thePlayer, 8 ) takeWeapon ( thePlayer, 9 ) takeWeapon ( thePlayer, 10 ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), removeOneVSOneWeapon ) You've defined markerhit, but you used makerHit
  10. addEventHandler("onClientGUIClick", buttton, function, false) -- False must be at the end of event handler!
  11. Wei

    Helping

    You didn't define driver and mechanic
  12. Wei

    JSON problem

    Working, Thank you !
  13. Wei

    JSON problem

    ([ { "5": "30,1" } ] notIn
  14. Wei

    JSON problem

    Still same, yeah I will fix that later...
  15. Wei

    JSON problem

    Yes, that I will override it later
  16. Wei

    JSON problem

    local storWeapon = fromJSON(getElementData(housePickup[houseID], "IGChousing.storedweapons")) if (type(storWeapon) == "table") then local tableWeapon = storWeapon if tableWeapon[getSlotFromWeapon(weapon)] then tableWeapon[getSlotFromWeapon(weapon)] = weapon..","..tableWeapon[getSlotFromWeapon(weapon)]+ammo setElementData(housePickup[houseID], "IGChousing.storedweapons", toJSON(tableWeapon)) outputChatBox("In") else table.insert(tableWeapon, getSlotFromWeapon(weapon), weapon..","..ammo) setElementData(housePickup[houseID], "IGChousing.storedweapons", toJSON(tableWeapon)) outputChatBox("NotIn") end Chatbox allways outputs NotIn. No debug!
  17. Yes it is, but you can't use it if you wanna have it on element like source or parameter... From where you wanna get the vehicle element ?
  18. Your parameters are wrong, every event has difrend parameters!
  19. Wei

    Little help

    You're welcome!
  20. replace the function attemptRegister in s_account.lua with this one function attemptRegister(thePlayer, username, password) if ( username ~= "" and password ~= "" ) then local success, error = exports.sql:query_free("INSERT INTO `accounts` VALUES('', '".. tostring(username) .."', '".. md5( tostring( password ) ) .."', '".. getPlayerSerial(thePlayer) .."', '0','0')") if ( error ) then return outputDebugString( error ) else return outputChatBox("Successfully registered your account!", thePlayer, 100, 0, 100) end end end
×
×
  • Create New...