-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
addCommandHandler("dd", function(player) if not getPlayerTeam(player) then table.sort(theTeams, sortAtPlayersInTeam) local teamName = theTeams[1] local team = getTeamFromName(teamName) if team then -- does the team exist? if teamName == "US Army" then setPlayerTeam(player, getTeamFromName("US Army")) spawnPlayer(player, 1585.5485839844, -1677.8289794922, 5.8969912528992) setCameraTarget(player, player) fadeCamera(player, true) setElementModel(player, 163) giveWeapon(player, 31, 500) giveWeapon(player, 29, 200) giveWeapon(player, 24, 100) setPlayerNametagColor(player, 221, 177, 0) blipua = createBlipAttachedTo(player, 0, 2, 221, 177, 0) outputChatBox("#0000ff(Mission) #8e8c00Kill the #328c6eDrug Lord #8e8c00before he delievers the drugs!", player, 255, 255, 255, true) elseif teamName == "Drug Dealers" then setPlayerTeam(player, team) spawnPlayer(player, 1484.75549, -666.62592, 95.60126) setCameraTarget(player, player) fadeCamera(player, true) setElementModel(player, 29) giveWeapon(player, 30, 500) --Give him a weapon pack giveWeapon(player, 23, 50) giveWeapon(player, 25, 30) setPlayerNametagColor(player, 168, 0, 255) blipdd = createBlipAttachedTo(player, 0, 2, 168, 0, 255) outputChatBox("#008AB0(Mission) #8e8c00Help the #328c6eDrug Lord #8e8c00to deliever the drugs!", player, 255, 255, 255, true) end end else outputChatBox("#FF0000Error: You can not change your team now", player, 255, 255, 255, true) end end)
-
This will fix those errors. [2016-04-21 00:08:05] ERROR: [gameplay]\(SARS)DugTrans\JobLS.lua:13: Valid wanted levels are between 0 and 6 inclusive setPlayerWantedLevel(attackerLV, math.min(getPlayerWantedLevel(attackerLV)+4, 6)) [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:14: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:15: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] [2016-04-21 00:08:05] WARNING: [gameplay]\(SARS)DugTrans\JobLV.lua:16: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] if isElement(markerLV) then destroyElement ( markerLV ) end if isElement(blipLV) then destroyElement ( blipLV ) end if isElement(carlv) then destroyElement ( carlv ) end But about this bug, you probably have to ask the owner to fix it. Because I am not going to check and rewrite the entire resource.
-
https://wiki.multitheftauto.com/wiki/ToJSON https://wiki.multitheftauto.com/wiki/FromJSON
-
addCommandHandler("dd", function(player) if getPlayerTeam(player) then -- the rest of the code. else outputChatBox("You can not change your team now!", player) end end)
-
Then you are already in a team or you added it wrong.
-
if getPlayerTeam(player) then --... else outputChatBox("You can not change your team now!", player) end
-
News: Starting cooperation with Gothem and his File editor resource. Direct line edit based on the error. Click the link below for more information about this resource: https://forum.multitheftauto.com/viewtopic.php?f ... or#p876547 Example scenario, why this feature might have a lot of value: A user finds an error in one of his resources. He clicks on the error and it will show information about it. Also next to the information a button becomes active, a button to edit the file of the responsible resource. He clicks on the button, the file editor opens up and scrolls down to the line of the error.
-
local playersInTeamA = #getPlayersInTeam (teamA) local playersInTeamB = #getPlayersInTeam (teamB)
-
https://wiki.multitheftauto.com/wiki/On ... eCollision Possible, (there are some vehicles that don't work, especially planes) See my bug report: https://bugs.multitheftauto.com/view.php?id=8265
-
I can't find errors, except that the code will be bugged, when used by multiple users at the same time. Debug your code! Check if the speed is actually 0! if vx+vy+vz == 0 then --... else outputDebugString("Velocity: ".. (vx+vy+vz)) end Line 27: null doesn't exist in lua, but nil does. Use locals! and store them inside with tables or elementdata. You script serverside, so tables or elementdata's are required when you use the script for multiple players!
-
local theTeams = {"Drug Dealers", "Police"} local sortAtPlayersInTeam = function (teamNameA,teamNameB) local teamA, teamB = getTeamFromName(teamNameA), getTeamFromName(teamNameB) if teamA and teamB then local playersInTeamA = getPlayersInTeam (teamA) local playersInTeamB = getPlayersInTeam (teamB) return playersInTeamA > playersInTeamB or (playersInTeamA == playersInTeamB and math.random(2) == 1) end return false end addCommandHandler("dd", function(player) table.sort(theTeams, sortAtPlayersInTeam) local teamName = theTeams[1] local team = getTeamFromName(teamName) if team then -- does the team exist? if teamName == "Police" then setPlayerTeam(player, getTeamFromName("Police")) spawnPlayer(player, 1585.5485839844, -1677.8289794922, 5.8969912528992) setCameraTarget(player, player) fadeCamera(player, true) setElementModel(player, 280) giveWeapon(player, 22, 200) setPlayerNametagColor(player, 0, 0, 255) outputChatBox("#0000ff(Mission) #8e8c00Kill the #fff000Drug Lord #8e8c00before he delievers the drugs!", player, 255, 255, 255, true) elseif teamName == "Drug Dealers" then setPlayerTeam(player, team) spawnPlayer(player, 1585.5485839844, -1677.8289794922, 5.8969912528992) setCameraTarget(player, player) fadeCamera(player, true) setElementModel(player, 280) giveWeapon(player, 22, 200) setPlayerNametagColor(player, 0, 0, 255) outputChatBox("#0000ff(Mission) #8e8c00Kill the #fff000Drug Lord #8e8c00before he delievers the drugs!", player, 255, 255, 255, true) end else outputDebugString("Team not found!") end end)
-
np. Don't forget to check out this Debug resource.
-
np. Don't forget to check out this Debug resource.
-
Try this: local theTeams = {"Drug Dealers", "Police"} local sortAtPlayersInTeam = function (teamNameA,teamNameB) local teamA, teamB = getTeamFromName(teamNameA), getTeamFromName(teamNameB) if teamA and teamB then local playersInTeamA = getPlayersInTeam (teamA) local playersInTeamB = getPlayersInTeam (teamB) return playersInTeamA > playersInTeamB or (playersInTeamA == playersInTeamB and math.random(2) == 1) end return false end addCommandHandler("dd", function(player) table.sort(theTeams, sortAtPlayersInTeam) local team = getTeamFromName(theTeams[1]) if team then -- does the team exist? setPlayerTeam(player, team) spawnPlayer(player, 1585.5485839844, -1677.8289794922, 5.8969912528992) setCameraTarget(player, player) fadeCamera(player, true) setElementModel(player, 280) giveWeapon(player, 22, 200) setPlayerNametagColor(player, 0, 0, 255) outputChatBox("#0000ff(Mission) #8e8c00Kill the #fff000Drug Lord #8e8c00before he delievers the drugs!", player, 255, 255, 255, true) else outputDebugString("Team not found!") end end)
-
Try this: local theTeams = {"Drug Dealers", "Police"} local sortAtPlayersInTeam = function (teamNameA,teamNameB) local teamA, teamB = getTeamFromName(teamNameA), getTeamFromName(teamNameB) if teamA and teamB then local playersInTeamA = getPlayersInTeam (teamA) local playersInTeamB = getPlayersInTeam (teamB) return playersInTeamA > playersInTeamB or (playersInTeamA == playersInTeamB and math.random(2) == 1) end return false end addCommandHandler("dd", function(player) table.sort(theTeams, sortAtPlayersInTeam) local team = getTeamFromName(theTeams[1]) if team then -- does the team exist? setPlayerTeam(player, team) spawnPlayer(player, 1585.5485839844, -1677.8289794922, 5.8969912528992) setCameraTarget(player, player) fadeCamera(player, true) setElementModel(player, 280) giveWeapon(player, 22, 200) setPlayerNametagColor(player, 0, 0, 255) outputChatBox("#0000ff(Mission) #8e8c00Kill the #fff000Drug Lord #8e8c00before he delievers the drugs!", player, 255, 255, 255, true) else outputDebugString("Team not found!") end end)
-
People who already gave feedback after testing the resource: _EVO_ -Blaze- MoDeR2014 Don't be afraid to give feedback, I won't eat you
-
People who already gave feedback after testing the resource: _EVO_ -Blaze- MoDeR2014 Don't be afraid to give feedback, I won't eat you
-
Then you only have to read the bottom of my post. There is the answer.
-
Then you only have to read the bottom of my post. There is the answer.
-
A table wut? There is no information about that. function createVehicleByKeyName (player, cmd, name, color1, color2, tint, owner) --... end local createVehicleKeyNames = {"createvehicle", "makeveh", "makevehicle", "makecar"} for i=1, #createVehicleKeyNames do addCommandHandler(createVehicleKeyNames[i], createVehicleByKeyName) end local xml = xmlLoadFile("vehicles.xml") Why global? Makes no sense. local reload = xmlLoadFile("vehicles.xml") local mapRootElement = loadMapData ( reload, root ); --xmlSaveFile(reload) -- No need for double save. xmlUnloadFile(reload)
-
A table wut? There is no information about that. function createVehicleByKeyName (player, cmd, name, color1, color2, tint, owner) --... end local createVehicleKeyNames = {"createvehicle", "makeveh", "makevehicle", "makecar"} for i=1, #createVehicleKeyNames do addCommandHandler(createVehicleKeyNames[i], createVehicleByKeyName) end local xml = xmlLoadFile("vehicles.xml") Why global? Makes no sense. local reload = xmlLoadFile("vehicles.xml") local mapRootElement = loadMapData ( reload, root ); --xmlSaveFile(reload) -- No need for double save. xmlUnloadFile(reload)
-
You can reload a map file. Add these functions to your list: loadMapData -- restart, destory the element created by loadMapData destroyElement -- Re-use loadMapData
-
You can reload a map file. Add these functions to your list: loadMapData -- restart, destory the element created by loadMapData destroyElement -- Re-use loadMapData
-
I will start building on the new features this Friday. So I hope you can send your feedback and suggestions before then. Thank you
-
local valueOfoption1 = get("Option") local firstNumber = gettok ( valueOfoption1, 1, string.byte(',') ) local secondNumber = gettok ( valueOfoption1, 2, string.byte(',') )
