Jump to content

roaddog

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by roaddog

  1. Your code is exactly same as mine, but urs nakes no sense. How is it you put sRes variable instead of resName at line #11 and #12? Cuz its always gonna be "job", And the code wont start other loaded resources cuz if the loop sense the resource running then you return it. yiu just make it worse.
  2. Nope only resources with name Job_... There are 23 of them. When they all start, console says long execution. I just wanna know other method.
  3. Hey i made a command to start resources but, i got warning on ythe console saying Warning: Long execution (cmstart), is this okay to ignore? addCommandHandler("startup", function(p, cmd, suf) if suf == "job" then if scripter[getAccountName(getPlayerAccount(p))] then for i, res in ipairs(getResources()) do local resName = getResourceName(res) if resName:find("Job_") then startResource(res, true) end end end end end) Ps: i got 23 Job resources any method to get rid the warning?
  4. Because youre trying to match attacker to a team element change if attacker == police to if getPlayerTeam(attacker) == police
  5. function onCrimKill (ammo, attacker, weapon, bodypart) local police = getTeamFromName("Police Officer") local criminal = getPlayerWantedLevel(source) if ( getElementType (attacker) == "player" ) then if (attacker) then if attacker == police then if criminal > 0 then outputChatBox("You are arrested",source,255,0,0) return end outputChatBox("Police mistaken, killed you unwanted",source,255,0,0) else outputChatBox("You are not permitted to kill a criminal",attacker,255,0,0) end elseif not attacker then outputChatBox(getPlayerName ( source ).."died from environment") end end end end addEventHandler("onPlayerWasted", getRootElement(), onCrimKill)
  6. Use scrollpane https://wiki.multitheftauto.com/wiki/Gu ... ScrollPane
  7. Open source and easy to install https://github.com/404rq/GTW-RPG
  8. No, They dont stop. Look at bugs section, https://bugs.multitheftauto.com/changelog_page.php
  9. roaddog

    Help

    You got an extra quotation in the last line of code after root here: addEventHandler("onPlayerJoin", root", loadMatrix)
  10. Compile original source. You cant compile an already compiled script.
  11. What's the impact of having sqlite db in each resources and its frequendly save and load?
  12. Nope it wont crash but it will reset your client preferance settings. But if only resources folder then you good to go.
  13. Try changin your line triggerServerEvent("m4", root) to triggerServerEvent("m4", localPlayer, localPlayer) And dont change anything on serverside code
  14. Update for this I added this if getResourceState(getResourceFromName(stringResource)) == "running" then But i got warning expected resourcedata at arg 1 got boolean. Im using onClientResourceStart event and resourceRoot. This happens on join. The resource is running ofc.
  15. addEventHandler("onClientObjectDamage", root, function( _, attacker) if getElementModel(source) == id then if attacker then cancelEvent() end end end) So object is not gonna break by bullets but still breakable by rocks.
  16. That was very long but i got another method by using onClientObjectDamange and cancel for certain model and if attacker exists.
  17. Hi, Im editing haystack resource. The hays are breakable, I want to know how can i like set it not to break if it got hit by bullets but it will only break by rocks. Basically i have players trying to destroy hays by going on top of building and shoot it by sniper. The hays and rocks are in marker if that can help for exception. Ps. Hay objects are servrr side Thank you.
  18. Lets do some magic. objectMagic = createObject(...) -- create an object vehicleMagic = createVehicle(...) -- create vehicle to later attach with setElementAlpha(objectMagic, 0) -- magic starts attachElements ( vehicleMagic, objectMagic) -- yes make it stick to the object moveObject (objectMagic, ...) -- the magic happens Walah
  19. roaddog

    [HELP] Hud

    Change your line 4 with this if not ( getPedWeapon(getLocalPlayer()) == 0 or getPedWeapon(getLocalPlayer()) == 1) then
  20. Lol sorry i forgot the strings in op but i got correct in script. The warning only happend on join and it randomly show up.
×
×
  • Create New...