Jump to content

joaosilva099

Members
  • Posts

    199
  • Joined

  • Last visited

Everything posted by joaosilva099

  1. but i want to trigger to the player who quits and that event only triggers on the players who dont quitted
  2. joaosilva099

    SOLVED

    Hi all. My problem is that onClientResourceStop doesn't trigger qhen the player quits... i tested to stop the resource ad it gget triggered but when he quits not
  3. hi all i'm needing a resource that creates markers and wwhen player hits the marker a gui is showed with hood, nitro, hydraulics... for the player buy for his car... I could do that but i think is a simple thing that i can find already done at the community and it will be easy to install but i don't find it so i posted here Hope u can help me!
  4. et-win i cant find your script...
  5. If u have skype can gime ur name?
  6. Found the bug... "name" and "nam". Not tested yet but soon give u feedback
  7. Edited some things that were error like "no elements in the function getPlayerFromName" and "table concat instead of table contact but still not working function findPlayer(player) if (player and type(player) == "string") then local plr = getPlayerFromName(player) if (plr ~= false) then return plr end local pC = 0 local player = string.lower(player) local spl = split(player, string.byte("[")) if spl then player = table.concat(spl, ";") end for k, v in ipairs(getElementsByType("player")) do local nam = string.lower(getPlayerName(v)) local spl = split(nam, string.byte("[")) if spl then nam = table.concat(spl, ";") end if string.find(name, player) then plr = v pC = pC + 1 end end if plr and pC == 1 then return plr end return false else return false end end
  8. I think you helped me!! I cant test now in my mobile but tomorow i test on pc. This will return the player element right? Or the player's complete name?
  9. Can do some sample to me? I think that to but dont worked
  10. No it is not i want get the player element from a part of his nickname
  11. Hi all i have commands in my server that should have an arg that is a player nickname My problem is that i have to type the nickname exactly same the player's nickname. I saw other servers that you just type (example) "t/loc Joao" and the script gets my full name that is (example) "|SS|Joao|F" I searched the wiki already but how can i get the player's nick with approximated name?
  12. joaosilva099

    SOLVED

    Hi all... I Have this SIMPLE script to download and replace vehicle mods: function replaceModel() txd = engineLoadTXD("429.txd", 429 ) engineImportTXD(txd, 429) dff = engineLoadDFF("429.dff", 429 ) engineReplaceModel(dff, 429) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) But the problem is that with more mods i add it is raising the ammount of MB that the player has to download. That script downloads mods and after that the player can join the game I want is a script that only downloads the mods when the player logs in so that he can play same time the mods are downloading... Hope u can help me Thanks!
  13. All that i know getTeamFromName needs a string containing the tem name and createTeam already returns the team element so i dont understand why u used getTeamFromName to get the team element if u have it already. setPlayerTeam(thePlayer, civilTeam
  14. 'MTA ROOT DIR'/mods/deathmatch/resources/[gameplay]/interiors.zip
  15. [*]If u want to the message be outputed when enter the vehicle you can use onVehicleEnter event. Otherwise idk
  16. It dont work bcs you have.to change " Staff" acl name to aclGetGroup("Staff")
  17. global you are saying is the T chat or is an chatbox that u created called global?
  18. thanks man i changed some code and now it works good, realy you helped me a lot!!
  19. Sorry for double poSt but i need help please
  20. Hi community. I made my own jobs resource for my server but it has a problem. It works good but passing 5--10min its start it starts consuming about 50% CPU and all player ping gets to about 600ms and i have to restart it and returns all again happening. Codes are at the end of the post and i hope you can help me * I checked CPU consumption at server's web page * I checked ping at default admin panel of the server and at scoreboard * When the player get 600 ping then returns network trouble message and he has to reconnect. Codes: Server-side: ped = { } weapon = { } function getBlipAttachedTo( thePlayer ) local blips = getElementsByType( "blip" ) for k, theBlip in ipairs( blips ) do if getElementAttachedTo( theBlip ) == thePlayer then return theBlip end end return false end addEventHandler("onResourceStart", getRootElement(), function() ped["Staff"] = createPed(217, 853.7255859375, -2385.216796875, 12.906106948853, 0, false) setTimer( setElementHealth, 50, 0, ped["Staff"], 100 ) setTimer( setElementPosition, 50, 0, ped["Staff"], 853.7255859375, -2385.216796875, 12.906106948853 ) function job1(mouse, state, player) if(mouse == "left" and state == "down") then if(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin"))) then r, g, b = getTeamColor(getTeamFromName("Staff")) triggerClientEvent(player, "PedClicked", getRootElement(), "Staff", "As a Staff Member you need to manage STORM:RPG Players: Attend to their problems/questions and solve the Bugs. You have to Punish the ones that dont follow the Rules!", r, g, b) else exports.ac_message:outputTopbar(player, 255, 0, 0, "Job: You cannot take this Job!") end end end addEventHandler("onElementClicked", ped["Staff"], job1) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Staff", 0xFF390874, 853.7255859375, -2385.216796875, 12.906106948853, 20, 0, "default-bold", 2) end) -- ped["Criminal"] = createPed(0, 438.4970703125, -1733.09765625, 9.421875, 0, false) createBlipAttachedTo(ped["Criminal"], 59, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Criminal"], 100 ) setTimer( setElementPosition, 50, 0, ped["Criminal"], 438.4970703125, -1733.09765625, 9.421875 ) function job2(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Criminal")) triggerClientEvent(player, "PedClicked", getRootElement(), "Criminal", "As a Criminal you will be the real protagonist of STORM:RPG. Being a Criminal means that you will be aable to: Rob Houes, Rob Stores, Rob Banks, Hack ATM's and much more as you will discove in this new adventure!", r, g, b) end end addEventHandler("onElementClicked", ped["Criminal"], job2) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Criminal", 0xFFEB6767, 438.4970703125, -1733.09765625, 9.421875, 20, 0, "default-bold", 2) end) -- ped["Trashman"] = createPed(132, -76.7373046875, -1136.515625, 1.078125, 50.0, false) createBlipAttachedTo(ped["Trashman"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Trashman"], 100 ) setTimer( setElementPosition, 50, 0, ped["Trashman"], -76.7373046875, -1136.515625, 1.078125 ) function job3(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Trashman")) triggerClientEvent(player, "PedClicked", getRootElement(), "Trashman", "As a TrashMan you need to go arround SA to catch some trash bags that will be bliped into your radar!", r, g, b) end end addEventHandler("onElementClicked", ped["Trashman"], job3) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Trashman", 0xFFFFFF00, -76.7373046875, -1136.515625, 1.078125, 20, 0, "default-bold", 2) end) -- ped["Police"] = createPed(280, 1553.033203125, -1677.6357421875, 16.1953125, 0, false) weapon["Police"] = 3 createBlipAttachedTo(ped["Police"], 61, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Police"], 100 ) setTimer( setElementPosition, 50, 0, ped["Police"], 1553.033203125, -1677.6357421875, 16.1953125 ) function job4(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Police")) triggerClientEvent(player, "PedClicked", getRootElement(), "Police", "As a Police man you need to drive around San Andreas to catch Wanted Criminals. You will level up by ammount of Arrests you have!", r, g, b) end end addEventHandler("onElementClicked", ped["Police"], job4) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Police", 0xFF2572FF, 1553.033203125, -1677.6357421875, 16.1953125, 20, 0, "default-bold", 2) end) -- ped["TrafficUnit"] = createPed(284, 1582.0888671875, -1683.302734375, 6.21875, 0, false) weapon["TrafficUnit"] = 43 createBlipAttachedTo(ped["TrafficUnit"], 61, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["TrafficUnit"], 100 ) setTimer( setElementPosition, 50, 0, ped["TrafficUnit"], 1582.0888671875, -1683.302734375, 6.21875 ) function job5(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("TrafficUnit")) triggerClientEvent(player, "PedClicked", getRootElement(), "TrafficUnit", "As a Traffic Unit you need to catch the Speeders of STORM:RPG!", r, g, b) end end addEventHandler("onElementClicked", ped["TrafficUnit"], job5) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("TrafficUnit", 0xFF2572FF, 1582.0888671875, -1683.302734375, 6.21875, 20, 0, "default-bold", 2) end) -- ped["Criminal1"] = createPed(0, 1632.458984375, -1521.83984375, 13.609195709229, 180, false) createBlipAttachedTo(ped["Criminal1"], 59, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Criminal1"], 100 ) setTimer( setElementPosition, 50, 0, ped["Criminal1"], 1632.458984375, -1521.83984375, 13.609195709229 ) function job6(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Criminal")) triggerClientEvent(player, "PedClicked", getRootElement(), "Criminal", "As a Criminal you will be the real protagonist of STORM:RPG. Being a Criminal means that you will be aable to: Rob Houes, Rob Stores, Rob Banks, Hack ATM's and much more as you will discove in this new adventure!", r, g, b) end end addEventHandler("onElementClicked", ped["Criminal1"], job6) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Criminal", 0xFFEB6767, 1632.458984375, -1521.83984375, 13.609195709229, 20, 0, "default-bold", 2) end) -- ped["Pilot"] = createPed(255, 2122.1162109375, -2412.15234375, 13.546875, 180.0, false) createBlipAttachedTo(ped["Pilot"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Pilot"], 100 ) setTimer( setElementPosition, 50, 0, ped["Pilot"], 2122.1162109375, -2412.15234375, 13.546875 ) function job7(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Pilot")) triggerClientEvent(player, "PedClicked", getRootElement(), "Pilot", "As a Pilot you must drive the people to their selected destination!", r, g, b) end end addEventHandler("onElementClicked", ped["Pilot"], job7) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Pilot", 0xFFFFFF00, 2122.1162109375, -2412.15234375, 13.5468755, 20, 0, "default-bold", 2) end) -- ped["Criminal2"] = createPed(0, 2434.25, -2056.2509765625, 13.549994468689, 90, false) createBlipAttachedTo(ped["Criminal2"], 59, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Criminal2"], 100 ) setTimer( setElementPosition, 50, 0, ped["Criminal2"], 2434.25, -2056.2509765625, 13.549994468689 ) function job8(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Criminal")) triggerClientEvent(player, "PedClicked", getRootElement(), "Criminal", "As a Criminal you will be the real protagonist of STORM:RPG. Being a Criminal means that you will be aable to: Rob Houes, Rob Stores, Rob Banks, Hack ATM's and much more as you will discove in this new adventure!", r, g, b) end end addEventHandler("onElementClicked", ped["Criminal2"], job8) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Criminal", 0xFFEB6767, 2434.25, -2056.2509765625, 13.549994468689, 20, 0, "default-bold", 2) end) -- ped["Hobo"] = createPed(239, 2438.427734375, -1885.396484375, 13.553356170654, 270.0, false) createBlipAttachedTo(ped["Hobo"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Hobo"], 100 ) setTimer( setElementPosition, 50, 0, ped["Hobo"], 2438.427734375, -1885.396484375, 13.553356170654 ) function job9(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Hobo")) triggerClientEvent(player, "PedClicked", getRootElement(), "Hobo", "As a Hobo you dont need to do nothing... just walk forthere searching food and money!", r, g, b) end end addEventHandler("onElementClicked", ped["Hobo"], job9) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Hobo", 0xFFFFFF00, 2438.427734375, -1885.396484375, 13.553356170654, 20, 0, "default-bold", 2) end) -- ped["Medic"] = createPed(275, 2035.73828125, -1401.685546875, 17.309717178345, 180.0, false) weapon["Medic"] = 14 createBlipAttachedTo(ped["Medic"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Medic"], 100 ) setTimer( setElementPosition, 50, 0, ped["Medic"], 2035.73828125, -1401.685546875, 17.309717178345 ) function job10(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Medic")) triggerClientEvent(player, "PedClicked", getRootElement(), "Medic", "As a Medic you will get Flower that you should hit player with it so they take health!", r, g, b) end end addEventHandler("onElementClicked", ped["Medic"], job10) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Medic", 0xFF00FFFF, 2035.73828125, -1401.685546875, 17.309717178345, 20, 0, "default-bold", 2) end) -- ped["Medic1"] = createPed(275, 1173.220703125, -1312.7294921875, 13.983285903931, 270.0, false) createBlipAttachedTo(ped["Medic1"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Medic1"], 100 ) setTimer( setElementPosition, 50, 0, ped["Medic1"], 1173.220703125, -1312.7294921875, 13.983285903931 ) function job11(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Medic")) triggerClientEvent(player, "PedClicked", getRootElement(), "Medic", "As a Medic you will get Flower that you should hit player with it so they take health!", r, g, b) end end addEventHandler("onElementClicked", ped["Medic1"], job11) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Medic", 0xFF00FFFF, 1173.220703125, -1312.7294921875, 13.983285903931, 20, 0, "default-bold", 2) end) -- ped["Taxi"] = createPed(220, 1624.8583984375, -1137.515625, 23.90625, 0.0, false) createBlipAttachedTo(ped["Taxi"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Taxi"], 100 ) setTimer( setElementPosition, 50, 0, ped["Taxi"], 1624.8583984375, -1137.515625, 23.90625 ) function job12(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Taxi")) triggerClientEvent(player, "PedClicked", getRootElement(), "Taxi", "As a Taxist you need to drive arround SA with your taxi finding people to transport and then transport them to selected destination!", r, g, b) end end addEventHandler("onElementClicked", ped["Taxi"], job12) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Taxi", 0xFFFFFF00, 1624.8583984375, -1137.515625, 23.90625, 20, 0, "default-bold", 2) end) -- ped["Trucker"] = createPed(125, 123.326171875, -296.8349609375, 1.578125, 90.0, false) createBlipAttachedTo(ped["Trucker"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Trucker"], 100 ) setTimer( setElementPosition, 50, 0, ped["Trucker"], 123.326171875, -296.8349609375, 1.578125 ) function job13(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Trucker")) triggerClientEvent(player, "PedClicked", getRootElement(), "Trucker", "As a Trucker you need to deliver charges to the selected destination!", r, g, b) end end addEventHandler("onElementClicked", ped["Trucker"], job13) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Trucker", 0xFFFFFF00, 123.326171875, -296.8349609375, 1.578125, 20, 0, "default-bold", 2) end) -- ped["PizzaDelivery"] = createPed(155, 2105.4541015625, -1808.9091796875, 13.5546875, 90.0, false) createBlipAttachedTo(ped["PizzaDelivery"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["PizzaDelivery"], 100 ) setTimer( setElementPosition, 50, 0, ped["PizzaDelivery"], 2105.4541015625, -1808.9091796875, 13.5546875 ) function job14(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("PizzaDelivery")) triggerClientEvent(player, "PedClicked", getRootElement(), "PizzaDelivery", "As a Pizza Delivery man you need to deliver the pizza's to the indicaded location in the map (blip)!", r, g, b) end end addEventHandler("onElementClicked", ped["PizzaDelivery"], job14) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("PizzaDelivery", 0xFFFFFF00, 2105.4541015625, -1808.9091796875, 13.5546875, 20, 0, "default-bold", 2) end) -- ped["Mechanic"] = createPed(50, 1035.291015625, -1024.533203125, 32.1015625, 180.0, false) createBlipAttachedTo(ped["Mechanic"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Mechanic"], 100 ) setTimer( setElementPosition, 50, 0, ped["Mechanic"], 1035.291015625, -1024.533203125, 32.1015625 ) function job15(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b = getTeamColor(getTeamFromName("Mechanic")) triggerClientEvent(player, "PedClicked", getRootElement(), "Mechanic", "As a Mechanic you have to drive arround SA and find people that needs repairing on their cars. You have to drive Towtruck too and find broken vehicles and take them to the delivery point!", r, g, b) end end addEventHandler("onElementClicked", ped["Mechanic"], job15) addEventHandler("onPlayerLogin", getRootElement(), function() exports.TextLabel:create3DTextLabel("Mechanic", 0xFFFFFF00, 1035.291015625, -1024.533203125, 32.1015625, 20, 0, "default-bold", 2) end) -- LV JOBS ped["Medic2"] = createPed(275, 1612.2548828125, 1815.2421875, 10.8203125, 0.0, false) createBlipAttachedTo(ped["Medic2"], 60, 2, 0, 0, 0, 0, 0, 200) setTimer( setElementHealth, 50, 0, ped["Medic2"], 100 ) setTimer( setElementPosition, 50, 0, ped["Medic2"], 1612.2548828125, 1815.2421875, 10.8203125 ) function job16(mouse, state, player) if(mouse == "left" and state == "down") then r, g, b =
  21. Hi all. I have a simple question... If i use giveweapon to give a weapon tto a player and he already has that weapon willlç the ammo raise? Or shouçd i make ome code o chek if he has the weapon nd then set the ammo?
×
×
  • Create New...