Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. JR10

    Redirect

    And here is the one for your first code function joinserverHandlerFunction (playerSource, commandName, playerName, serverIP, serverPort, serverPassword) if serverIP and serverPort then --if IP and Port were specified if not getPlayerFromName(playerName) then return end if serverPassword then --if also a password was specified redirectPlayer (getPlayerFromName(playerName), serverIP, tonumber(serverPort), serverPassword) --redirect the player else -- else if no password was specified redirectPlayer (getPlayerFromName(playerName), serverIP, tonumber(serverPort)) --redirect the player without using the serverPassword parameter end else -- if no IP or Port have been specified outputChatBox ("Error! Correct Syntax: /joinserver IP Port [Password]", playerSource) --output an Error message to the chatbox end end addCommandHandler ("joinserver", joinserverHandlerFunction) use it like this: /joinserver
  2. Oh, you are right i didn't pay attention, if i understand you correctly you want to rotate the ped on cursor move check the superman resource.
  3. This event is triggered each time the user moves the mouse on top of a GUI element.
  4. Maybe the + is the problem.
  5. Nice idea, maybe i will add it in next versions. (if i could )
  6. Thanks. No, i can't, because it's just how it is in SANL and i am not gonna copy. With markers or something like that?
  7. Well, this compiler has been just added FabienWang asked ransom to add it, i recommend you using this compiler http://www.multiupload.com/L0I5EO8NV0 But again, it's not good to compile something then release it, but if you are doing so, you should add as much settings as you can, so your resource can be adjustable by the owners.
  8. IF the player is cuffed he will follow the cuffer and if the cuffer enters a car the cuffed will enter it too.
  9. Resource is no longer available...
  10. dxDrawText( "test", 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) 44, screenHeight-43, screenWidth, screenHeight If i'm right it can't be like that. The position and width, height are wrong
  11. forgot that. function removeHEXFromString(str) return str:gsub("#%x%x%x%x%x%x", "") end
  12. function removeHEXFromString(str) str:gsub("#%x%x%x%x%x%x", "") end
  13. JR10

    Problems

    client side: addCommandHandler ( "save", function() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if (vehicle) then local x, y, z = getElementPosition(getLocalPlayer()) local model = getElementModel(vehicle) local code1 = x, y, z, model outputChatBox ("Saved ",source) triggerServerEvent("savevehicle",getLocalPlayer(),code1) elseif (player) then local x, y, z = getElementPosition(getLocalPlayer()) local code = x, y, z triggerServerEvent("saveplayer",getLocalPlayer(),code) end end) And you didn't send upvalue you are using server side.
  14. It won't output any thing because what you sent to client side is a vehicle variable.
  15. Maybe: addEvent("alertRadar",true) function showAlertAdvice() addEventHandler ( "onClientRender", getRootElement(), firstAppear) end addEventHandler("alertRadar", getRootElement(), showAlertAdvice) function firstAppear () X,Y = guiGetScreenSize () X = X * (1/5.5) Y = Y * (1/3) local alpha = 255 dxDrawText ( "Slaineeed!", X, Y, X, Y, tocolor(255, 64, 64, alpha), 5) seTimer(hideAlert, 1500, 1) end setTimer(function() if alpha == 0 then alpha = 255 else alpha = 0 end, 500, 3) function hideAlert() removeEventHandler("onClientRender", getRootElement(), firstAppear) end
  16. For your first question no it's executed as soon as the timer start. addEvent("alertRadar",true) function showAlertAdvice() addEventHandler ( "onClientRender", getRootElement(), firstAppear) end addEventHandler("alertRadar", getRootElement(), showAlertAdvice) function firstAppear () X,Y = guiGetScreenSize () X = X * (1/5.5) Y = Y * (1/3) local alpha = 255 dxDrawText ( "Slaineeed!", X, Y, X, Y, tocolor(255, 64, 64, alpha), 5) setTimer(function() if alpha == 0 then alpha = 255 else alpha = 0 end, 500, 3) seTimer(hideAlert, 1500, 1) end function hideAlert() removeEventHandler("onClientRender", getRootElement(), firstAppear) end Not tested.
  17. JR10

    Problems

    -- client side local username = guiGetText(usernameEditBox) local pass = guiGetText(passEditBox) triggerServerEvent("register", root, username, pass) --server side addEvent("register", true) addEventHandler("register", root, function(username, pass) if client then addAccount(username, pass) end end) There should be more checking so the player won't leave the edit box empty.
  18. JR10

    Problems

    Hmm?, what you mean save them username it's already saved, password you can setAccountData for it and it's already saved but hashed.
  19. local myMarkers = { createMarker( 0, 0, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 2, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 4, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 6, 4, 'cylinder', 1, 255, 0, 0, 150 ), createMarker( 0, 8, 4, 'cylinder', 1, 255, 0, 0, 150 ) } function PlayerMarkerHit( markerHit, matchingDimension ) local player = source for k, marker in ipairs(myMarkers) do if marker == markerHit then table.remove(myMarkers, markerHit) destroyElement ( markerHit ) break end end if #myMarkers == 0 then giveWeapon ( player, 31 ) end end addEventHandler( "onPlayerMarkerHit", root, PlayerMarkerHit )
  20. Source is not defined. function myTest() local x, y, z = getPedBonePosition(getLocalPlayer(), 6) local object = createObject(1369, 0, 0, 0) attachElements(object, getLocalPlayer(), x, y, z) end addCommandHandler("testing", myTest) But this won't do what you want here is what you want: function myTest() local x, y, z = getPedBonePosition(getLocalPlayer(), 6) local object = createObject(1369, x, y, z) attachRotationAdjusted(object, getLocalPlayer()) end addCommandHandler("testing", myTest) function attachRotationAdjusted ( from, to ) local frPosX, frPosY, frPosZ = getElementPosition( from ) local frRotX, frRotY, frRotZ = getElementRotation( from ) local toPosX, toPosY, toPosZ = getElementPosition( to ) local toRotX, toRotY, toRotZ = getElementRotation( to ) local offsetPosX = frPosX - toPosX local offsetPosY = frPosY - toPosY local offsetPosZ = frPosZ - toPosZ local offsetRotX = frRotX - toRotX local offsetRotY = frRotY - toRotY local offsetRotZ = frRotZ - toRotZ offsetPosX, offsetPosY, offsetPosZ = applyInverseRotation ( offsetPosX, offsetPosY, offsetPosZ, toRotX, toRotY, toRotZ ) attachElements( from, to, offsetPosX, offsetPosY, offsetPosZ, offsetRotX, offsetRotY, offsetRotZ ) end function applyInverseRotation ( x,y,z, rx,ry,rz ) local DEG2RAD = (math.pi * 2) / 360 rx = rx * DEG2RAD ry = ry * DEG2RAD rz = rz * DEG2RAD local tempY = y y = math.cos ( rx ) * tempY + math.sin ( rx ) * z z = -math.sin ( rx ) * tempY + math.cos ( rx ) * z local tempX = x x = math.cos ( ry ) * tempX - math.sin ( ry ) * z z = math.sin ( ry ) * tempX + math.cos ( ry ) * z tempX = x x = math.cos ( rz ) * tempX + math.sin ( rz ) * y y = -math.sin ( rz ) * tempX + math.cos ( rz ) * y return x, y, z end
  21. its client side only btw local x, y, z = getPedBonePosition(getLocalPlayer(), 6) fxAddBlood(x, y, z, x, y, z+3, 50, 1) A blood on his head 6 is the bone id 6 is the head2 You can find the ids here: https://wiki.multitheftauto.com/wiki/File:Bones.jpg
×
×
  • Create New...