Jump to content


Scripting Moderators
  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by NeXuS™

  1. You have to check if the player is in a vehicle, you can use getPedOccupiedVehicle for this. If he is in a vehicle, you set the vehicle's position instead of the player, which is returned by the function mentioned above. Also, your function will throw errors, as "thePlayer" value defined in your function is actually the command name that was executed, in this case "gotosf", check addCommandHandler for more info on this topic.
  2. Because onPlayerLogout is called after the logout was successful, at that point the user is in the "guest" account. Check the wiki page for more info, you need to use the first argument of the event which is the previous account the user was in before logging out.
  3. Seems like restarting the resource causes the element datas to break. Adding a check on the side fixes the issue, but creates another issue, you gotta reenter your car after each resource restart. Also, I'm not sure how your code ran, as there is no "distance" value defined in your snippet. If it's needed, readd it in the line please. addEventHandler ("onPlayerVehicleEnter", getRootElement(), function (theVehicle, seat, jacked) if theVehicle and seat == 0 then theVehicle:setData("lastPos", theVehicle:getPosition()) end end) setTimer(function() for k, veh in ipairs(getElementsByType("vehicle")) do if veh then local pos = veh:getPosition() local vec = veh:getData("lastPos") if pos and vec and getUserdataType(vec) == "vector3" then local value = getDistanceBetweenPoints3D(vec:getX(), vec:getY(), vec:getZ(), pos:getX(), pos:getY(), pos:getZ()) if value then end end end end end, 2000, 0)
  4. This post was created back in 2018, why was this bumped? Do you still require help @Notorious^?
  5. Because you are getting the vehicle's speed at the resource startup. You'll have to use a timer to check more than once.
  6. There is probably a cancelEvent in the gamemode for debugscript 3. We also dont provide help for downloaded gamemodes.
  7. You can cancelEvent() the pickup with onPlayerPickupHit, then create your own system for respawning and managing pickups.
  8. If it uses downloadFile, you can use onClientFileDownloadComplete.
  9. Easy way would be using two objects. moveObject and setCameraMatrix with the object's position.
  10. Any error in the debugscript?
  11. @killingyasoon You'll have to add an event to remove the eventhandler when the player logins.
  12. function DestinationB(hitPlayer) if hitPlayer == localPlayer then markerB = createMarker( -498.54946899414, 191.89947509766, 723.70001220703, "corona", 1, 0, 255, 255, 200, localPlayer ) blipB = createBlip( -498.54946899414, 191.89947509766, 723.70001220703, 0, 2.5, 0, 255, 255, 255, 0, 99999, localPlayer) addEventHandler("onClientMarkerHit", markerB, DestinationC) end end And you'll have to add this to all of your marker creations.
  13. What do you mean by "for i = 10,1"?
  14. local wallpaperDirectory = "wallpapers/" local selectedWallpaper = 1 local wallpapersTable = { "moutain", "horse", "car", "river" } function drawWallpapers() dxDrawImage(0, 0, 512, 512, wallpaperDirectory .. wallpapersTable[selectedWallpaper] .. ".png") end addEventHandler("onClientRender", root, drawWallpapers) setTimer(function() selectedWallpaper = wallpapersTable[selectedWallpaper+1] and selectedWallpaper+1 or 1 end, 5000, 0)
  15. How is "DestinationA" and "DestinationB" called?
  16. You can't. guiLabels are created when you call the function, and don't update automatically. You'll have to create a function that'd update the text accordingly to the player's health.
  17. Easy way. As you have a compiled script, this means you can add a line into it. local givenSerial = -- The player's serial who bought the script. function resourceLoad() if givenSerial == getPlayerSerial(localPlayer) then -- Loading functions end end addEventHandler("onClientResourceStart", resourceRoot, resourceLoad) This means you'll have to get their serial, when they make the purchase, and then compile the resource this way.
  18. Or you can just use fetchRemote and use the responseInfo/success part to check if his serial is in the database. I'd reconsider this resource, as this means you have to have an internet connection to be able to use the script. Are you planning to give them a compiled script, or a source code?
  19. If you have accounts associated to players, you can easily save a name using setAccountData and use setPlayerName after they logged into their account.
  20. A player cannot join your server if he has no internet connection, unless you are hosting a local server and that player is connected to your internet.
  21. I don't get what you are trying to achieve. On a local server, you'll be the only player connected to the server. If you open the ports for it, the player has to have an internet connection to join your server.
  22. It's more complicated than that. The createWeapon function doesn't create a player held weapon, but a weapon on the world. You can use models, attach it to the players body, and create a custom damage system. You'd have to create a texture that would hide the "default" weapon that the player is holding all the time. Then using that custom damage system, you'd be able to create weapons till you'd run out of usable world models that you'd overwrite.
  23. "Magyarul minden pozícióra keresel embert, ami azt jelenti, hogy te semmit nem nyújtasz. " Igen, ez is a te kommented, es ez boven tamadas jellegu.
  24. Why do you need those passwords?
  25. I suppose you are using Accounts, there are ways to create a workaround to save the passwords, but you should hash those datas, as if someone gets damaged because you have saved his/her password as plain text, you'll be in trouble.
  • Create New...