Jump to content

Et-win

Members
  • Posts

    1,390
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Et-win

  1. Like I said before, it expects true or false. When you fill in 0, it-will-fail. And calm the * down e.e
  2. local x, y, z = getElementPosition(*The player out of the LOOP from getElementsByType*) Atleast he is learning
  3. That can only be one very big lie.
  4. Remember to get the data first. local gData = getElementData(killer, "Kills") if (gData == false) or (gData == nil) then gData = 0 end gData = gData + 1 setElementData(killer, "Kills", gData)
  5. http://www.lua.org/manual/5.1/manual.html#pdf-tonumber 'tonumber' returns 'nil' if the given string is not a number.
  6. Test it? I have really no idea how this codes work, just defining the variables here.
  7. local mycode = [ ..., code ] triggerLatentClientEvent (localPlayer,"enviarClient",10000,localPlayer,mycode) addCommandHandler("cancel",function() local table = getLatentEventHandles ( localPlayer) local handler = table[#table] if handler then cancelLatentEvent( localPlayer, handler ) outputChatBox(tostring(getLatentEventStatus( handler)["percentComplete"])) end end) 'player' not defined. localPlayer = getLocalPlayer(), so used that.
  8. Et-win

    Q About GUI

    guiCreateStaticImage --Or if you want to render it with DX functions: dxDrawImage
  9. Again, first check or 'hitElement' is a player. >.> Also, you have 2 functions with the same name.
  10. You could also read the wiki, then you knew it...
  11. Et-win

    SetGroupData

    The last script you posted, put an 'outputChatBox' a line before 'return' and check what 'data' output's. If that isn't the problem, then go to the next part until you find what doesn't work properly. It's what I always do, and it always works. Or someone else have to see what's wrong
  12. @Talidan: Thanks for the explanation!
  13. Et-win

    SetGroupData

    Checked or it returned the data? Also, maybe it's better to just to get the file size with fileGetSize and then fileRead.
  14. Ehum, no they won't... That's the point of your script? >.>
  15. Dudes... Srsly? missionMarker = createMarker ( -1305.2, -120.3, 13.4, "cylinder", 2, 0, 255, 255, 170 ) addEventHandler("onResourceStart", resourceRoot, function ( ) missionBlip = createBlipAttachedTo(missionMarker,53) outputChatBox( "[Plane Mission] Älä vielä mene lentokone missionille. se on kesken", player, 0, 255, 255 ) end ) addEventHandler("onMarkerHit", missionMarker, function ( hitElement ) if (getElementType ( hitElement ) == 'player' ) then local plane = createVehicle ( 519, -1654, -162, 14, 0, 0, -45 ) warpPedIntoVehicle ( hitElement, plane ) outputChatBox( "[Plane Mission] Lennä punaiselle lipulle.", hitElement, 0, 255, 255 ) finalMarker = createMarker ( 338, 2505, 16, "checkpoint", 6, 255, 255, 0, 170 ) finalBlip = createBlipAttachedTo(finalMarker,19) end end ) function Remove(thePlayer) if (getElementType(thePlayer) == "player") then if (finalMarker ~= nil) and (source == finalMarker) then if isElement(finalMarker) then givePlayerMoney ( thePlayer, 10000 ) removeEventHandler("onMarkerHit", finalMarker, Remove) destroyElement(finalMarker) outputChatBox( "[Plane Mission] Kiitos kun veit lentokoneen huoltoon. Saat 10K palkkiota.", hitElement, 0, 255, 255 ) end if isElement(finalBlip) then destroyElement(finalBlip) end end end end addEventHandler("onMarkerHit", getRootElement(), Remove) Just define theElement in the function ('thePlayer') and check or it's a player.
  16. 'thePlayer' is not defined. Also, agian, check or theElement is a player. PS: Remember this is server-sided, which means, EVERY PLAYER can now touch that marker, and 'steal' the job.
  17. addEventHandler("onMarkerHit", finalMarker, Remove) 'finalMarker' wasn't yet created and so not defined. That's why it's not working. Try this: missionMarker = createMarker ( -1305.2, -120.3, 13.4, "cylinder", 2, 0, 255, 255, 170 ) addEventHandler("onResourceStart", resourceRoot, function ( ) missionBlip = createBlipAttachedTo(missionMarker,53) outputChatBox( "[Plane Mission] Älä vielä mene lentokone missionille. se on kesken", source, 0, 255, 255 ) end ) addEventHandler("onMarkerHit", missionMarker, function ( hitElement ) if (getElementType ( hitElement ) == 'player' ) then local plane = createVehicle ( 519, -1654, -162, 14, 0, 0, -45 ) warpPedIntoVehicle ( hitElement, plane ) outputChatBox( "[Plane Mission] Lennä punaiselle lipulle.", hitElement, 0, 255, 255 ) finalMarker = createMarker ( 338, 2505, 16, "checkpoint", 6, 255, 255, 0, 170 ) finalBlip = createBlipAttachedTo(finalMarker,19) end end ) function Remove( ) if (finalMarker ~= nil) and (source == finalMarker) then if isElement(finalMarker) then removeEventHandler("onMarkerHit", finalMarker, Remove) destroyElement(finalMarker) end if isElement(finalBlip) then destroyElement(finalBlip) end end end addEventHandler("onMarkerHit", getRootElement(), Remove)
  18. local clear = guiGridListClear(GUIEditor.gridlist[1]) if (clear) then You would know this, if you used /debugscript 3 in-game. It will show you all the errors found in the script.
  19. Because client-side doesn't need 6th argument, but server-side does. Probably you have it server-side. Learn to read the syntaxes: ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool synced = true ] ) ped createPed ( number model ID, number positionX, number positionY, number positionZ [, number rotation, boolean true or false ] ) As soon as you don't want to use a "Optinal Argument" then just don't fill it in. Then it's 'nil' and it will not be used.
  20. boolean (bool) = true or false Read the syntax, and you will know your last number 0 has to be true or false for: synced: A boolean value representing whether or not the ped will be synced. Disabling the sync might be useful for frozen or static peds to increase the server performance.
  21. If you do that, all players will need an account. So, also check or they are logged in @ scaryface87
  22. No, it's not wrong. Client-side scripts get started when downloading is done? So how do you even want to start the drawing of a DX element? (This is about when joining the server for the first time, or he does mean downloading with fetchRemote/downloadFile, then you can.)
  23. Et-win

    Lags :O

    Oops, didn't see that both things
×
×
  • Create New...