Jump to content

-Jigsaw

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by -Jigsaw

  1. -Jigsaw

    command hook

    uhm, I think not, because if you type /command what it basically does is that it writes in the player's console 'command' so it's the same. Plus i tested it and it works with onConsole ^^
  2. -Jigsaw

    command hook

    Ok, I made it with onConsole. Thanks for the help
  3. -Jigsaw

    command hook

    Hello, is it possible(and if yes how) to detect when a certain command is called, and get its arguments? For example, when I type '/comand argument' which is set in a random script, can I acquire that 'argument' to use it in another resource? Thank you in advance
  4. Works like a charm, thank you!
  5. Hello, I have this: local r, g, b local playerTeam = getPlayerTeam(source) r, g, b = getTeamColor(playerTeam) However, I need to get the team's color in HEX color code, how can I convert it ? Thank you in advance!
  6. Sorry for the late answer. The script works and I haven't metioned anything wrong after some tests. Thank you!
  7. So, I got a code that's supposed to set the vehicle's color to white if the source aint in a team. Problem is that sometimes when the player spawns the vehicle is a different and random color. What's wrong with it? Thank you in advance addEventHandler("onPlayerSpawn", getRootElement(), function() if isPedInVehicle(source) then local team = getPlayerTeam(source) local vehicle = getPedOccupiedVehicle(source) if team then return end setVehicleColor(vehicle, 255, 255, 255) end end )
  8. Damn, really stupid.. Anyway, thx bro!
  9. What I got: addEventHandler("onResourceStart", root, startTimer) function startTimer() if not question then tInterval = math.random(180000, 360000) setTimer(postQuestion, tInterval, 1) end end What I get: Bad argument @ ' addEventHandler'[Expected function at aergument 3, got nil] Anybody knows what's wrong I seriously don't see nothing being wrong
  10. -Jigsaw

    .edf - spawn

    Hi all, I have made a map editor definition and i want to connect it with a script, but I am not sure on how to do that. Let's say that I got a spawnpoint which is successfully saved in the .map file and contains all the xyz pos and rot I need. What functions should I use to read the position numbers, and spawn the player at these numbers ? Thank you in advance!
  11. It stills says " port testing service unavailable Try this: https://nightly.multitheftauto.com/ports/
  12. Well, I tried this one if not getPlayerTeam(player) then and it woked as I wanted it to.. My bad I didn't think of it before opening the topic
  13. Uhm, so how would I check if the player is not in a team? Whould something like this work: if not getPlayerTeam(player) then
  14. I know it may be a silly question, but I am a bit confused.. I have this: function checkForTeam() if getPlayerTeam(player) == nil then --Output some stuff end end function ResourceStart() local players = getElementsByType("player") for k,v in ipairs(players) do setPlayerTeam (v, nil) bindKey(v, "F1", "down", checkForTeam) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), ResourceStart) The problem is that when I press the 'F1' key, I get this error: Bad argument @ 'getPlayerTeam' Ty in advance
×
×
  • Create New...