Jump to content

Ryan123

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by Ryan123

  1. So no away for fix it? Edit: Already fixed local hit = {} function Mission2(px, py, pz, pb, dx, dy, dz, db, name, t) if (currentlyEvent == true) then outputChatBox("Already an event going on", client) return end pMarker = createMarker ( px, py, pz-1, "cylinder", 2, 255, 167, 0, 255) pBlip = createBlipAttachedTo ( pMarker, pb) dMarker = createMarker ( dx, dy, dz-1, "cylinder", 2, 255, 167, 0, 255) dBlip = createBlipAttachedTo ( dMarker, db) setElementVisibleTo ( dMarker, root, false ) setElementVisibleTo ( dBlip, root, false ) local city = getZoneName(px, py, pz, true) local zone = getZoneName(px, py, pz) eventName = "for delivery their cups of glasses to IKEA!" timer = setTimer(messageForCivilians,50,0,name, eventName, city, zone, pMarker, pBlip) --timing = (deliveryStuff, t*1000*60, 1) outputChatBox("You created an Event: "..eventName, root) currentlyEvent = true addEventHandler ("onMarkerHit", pMarker, pickupStuff) end addEvent("SOEvent.startDeliveryGlasses", true) addEventHandler("SOEvent.startDeliveryGlasses", root, Mission2) function pickupStuff (plr) for i, plr in ipairs(getElementsByType ( "player" )) do if (isPedInVehicle ( plr )) then if (not deliveryVehicles[getElementModel ( getPedOccupiedVehicle ( plr ) )] ) then outputChatBox("You need one vehicle of delivery man!", plr) return end if (getElementHealth(getPedOccupiedVehicle ( plr ))/10 <= 95) then outputChatBox("You need fix your car. Is below 95%", plr) return end if (not isPlayerInTeam(plr, "Civilian Workers")) then return end if ((hit[plr] == true) and (isElementWithinMarker ( plr, pMarker)) then cancelEvent () return end hit[plr] = true setElementVisibleTo ( pMarker, plr, true ) setElementVisibleTo ( pBlip, plr, true ) setElementVisibleTo ( dMarker, plr, true ) setElementVisibleTo ( dBlip, plr, true ) setElementVisibleTo ( pMarker, plr, false ) setElementVisibleTo ( pBlip, plr, false ) addEventHandler ("onMarkerHit", dMarker, deliveryStuff ) outputChatBox("Delivery the glasses at IKEA!", plr) end end end
  2. I've that usefull function at my script. I just posted only that 2 functions cause I want do that: One player hit the marker and then another should do too it. And what's happening now is one player hit the marker and then another one cannot pick the marker. If I remove the "removeEventHandler", the script will appear that "[2016-02-12 23:32:48] WARNING: event\server.lua:117: Bad usage @ 'addEventHandler' ['onMarkerHit' with this function is already handled]" This is mentioning that part: addEventHandler ("onMarkerHit", dMarker, deliveryStuff )
  3. hello there, I'm creating this topic because I already tried fix it but I still to not fix it. Bug: When someone go to that marker, the next one cannot go to that marker Objetive: When someone go to that marker, next one should go there for have for delivery the goods. Script function Mission2(px, py, pz, pb, dx, dy, dz, db, name, t) if (currentlyEvent == true) then outputChatBox("Already an event going on", client) return end pMarker = createMarker ( px, py, pz-1, "cylinder", 2, 255, 167, 0, 255) pBlip = createBlipAttachedTo ( pMarker, pb) dMarker = createMarker ( dx, dy, dz-1, "cylinder", 2, 255, 167, 0, 255) dBlip = createBlipAttachedTo ( dMarker, db) setElementVisibleTo ( dMarker, root, false ) setElementVisibleTo ( dBlip, root, false ) local city = getZoneName(px, py, pz, true) local zone = getZoneName(px, py, pz) eventName = "for delivery their cups of glasses to IKEA!" timer = setTimer(messageForCivilians,50,0,name, eventName, city, zone, pMarker, pBlip) --timing = (deliveryStuff, t*1000*60, 1) outputChatBox("You created an Event: "..eventName, root) currentlyEvent = true addEventHandler ("onMarkerHit", pMarker, pickupStuff) end addEvent("SOEvent.startDeliveryGlasses", true) addEventHandler("SOEvent.startDeliveryGlasses", root, Mission2) function pickupStuff (plr) for i, plr in ipairs(getElementsByType ( "player" )) do if (isPedInVehicle ( plr )) then if (not deliveryVehicles[getElementModel ( getPedOccupiedVehicle ( plr ) )] ) then outputChatBox("You need one vehicle of delivery man!", plr) return end if (getElementHealth(getPedOccupiedVehicle ( plr ))/10 <= 95) then outputChatBox("You need fix your car. Is below 95%", plr) return end if (not isPlayerInTeam(plr, "Civilian Workers")) then return end removeEventHandler ("onMarkerHit", pMarker, pickupStuff) setElementVisibleTo ( pMarker, plr, true ) setElementVisibleTo ( pBlip, plr, true ) setElementVisibleTo ( dMarker, plr, true ) setElementVisibleTo ( dBlip, plr, true ) setElementVisibleTo ( pMarker, plr, false ) setElementVisibleTo ( pBlip, plr, false ) addEventHandler ("onMarkerHit", dMarker, deliveryStuff ) outputChatBox("Delivery the glasses at IKEA!", plr) end end end
  4. Sorry for double post, but I'll provide the Screenshot. And I increased for 1 second.
  5. So I'll set it for 1 second. If doesn't work, I'll post here again
  6. Hello, I've here one trouble. When I'm alone, this function is working fine, but when someone login, need only more 1, my chat will be spammed. Someone could help me please?: local civilianTeam = false function messageForCivilians (name, en, c, m, b, z) for i, plr in ipairs(getElementsByType ( "player" )) do if (isPlayerInTeam(plr, "Civilian Workers")) and (civilianTeam == false) then civilianTeam = true if (not m) and (not b) and (not z) then outputChatBox("State Official "..name.." is hosting a event "..en, plr) outputChatBox("Clue: "..c, plr) else outputChatBox("State Official "..name.." is hosting a event "..en, plr) outputChatBox("Location: "..z..", "..c, plr) setElementVisibleTo(m, plr, true) setElementVisibleTo(b, plr, true) end elseif (not isPlayerInTeam(plr, "Civilian Workers")) and (civilianTeam == true) then civilianTeam = false setElementVisibleTo(m, plr, false) setElementVisibleTo(b, plr, false) end end end ---- timer = setTimer(messageForCivilians,50,0,name, eventName, city, pMarker, pBlip, zone )
  7. Isn't working, check this image http://imgur.com/Tr4GSKM
  8. function searchMission() local text = guiGetText(SearchEdit) local sItems = { } for i, v in pairs(Mission) do if not (text == "" ) then if (string.find(string.upper(v[1]), string.upper(text), 1, true)) then table.insert(sItems, v[1]) end else table.insert(sItems, v[1]) end end guiGridListClear(ChooseEvent) for i, v in pairs(sItems) do local row = guiGridListAddRow(ChooseEvent) guiGridListSetItemText(ChooseEvent, row, 1, v, false, false) end end I tested with 1 column and is working and when I put with 2 column, still work but other collumn don't have anything. There's the image, Image2. Is missing second column.
  9. I did upload the script, and I have ready for give and have the password. http://www.mediafire.com/?46repau82517cff And where is the board for put this post/topic?
  10. I made the script for medic job and you can choose the skin you want (with vehicle spawner), if you do want, you need donate me 10 pounds. After Donate me you need send one pm for you did give 10 pounds Thanks for read.
  11. ahhhh, I'm new scripter, and I think, is now fine.Is type this? addEventHandler("onElementDataChange",getElementRoot(), function () if not (getElementData(localPlayer == "Occupation") = "SWAT Member") then vehicles = getElementsByType("vehicle") for i,v in ipairs(vehicle) destroyElement(v) end end end ) I need help only for choose "getElementData" or "getElementRoot"
  12. So when I use this, is for destroy when I change Occupation.like this? function destroyelementchanged( vehID ) if not (getElementData(localPlayer == Medic) then destroyElement ( vehicles ) end end addEventHadler("onElementDataChange",root,destroyelementchanged)
  13. I have more one question, how I can destroyElement when I change the occupation?
  14. no, I didn't stole your script.This script was made by and I don't know this scripts was existent. Edit:I don't want discussion about "stole".
  15. okay, if you don't want help me and say this script was stole, I will request /lock
  16. I DIDN'T COPY YOUR CLIENT-SIDE.Now have one player with script like you and you will say "this script is my.He stolen". PS:Sorry for caps lock
  17. why I don't see gui job?Someone can repair this script Jefferson: local marker = createMarker( 2035.1999511719, -1406.5, 16.200000762939, "Cylinder", 2, 6, 183, 248, 153) local skins = {"274", "275", "276"} function job () GUIEditor_Window[1] = guiCreateWindow(478,142,303,404,"Job Medic",false) GUIEditor_Button[1] = guiCreateButton(20,348,108,43,"Take Job",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(165,348,108,43,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(18,31,268,188,"To take Medic team job, press Take job.\n\nIf you don't want to, press Cancel.",false,GUIEditor_Window[1]) GUIEditor_Grid[1] = guiCreateGridList(26,229,255,115,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) skins = guiGridListAddColumn(GUIEditor_Grid[1],"Skins",0.85) for index, Skins in ipairs(Skins) do local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText ( GUIEditor_Grid[1], row, skins, tostring(IDSkins), false, false ) end end for i,marker in ipairs(markers) do addEventHandler("onClientMarkerHit", marker, function ( hitElement ) if (hitElement == localPlayer) then Job ( hitElement ) if (MainGui ~= nil) then guiSetVisible(MainGui, true) showCursor(true) guiSetInputEnabled(true) setElementFrozen(hitElement, true) end end end ) end addEventHandler("onClientGUIClick", root, function () if (source == GUIEditor_Button[1]) then local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(GUIEditor_Grid[1], row, 1) if vehicleName == "274" then triggerServerEvent("spawn274",localPlayer,vehicleName) elseif vehicleName == "275" then triggerServerEvent("spawn275",localPlayer,vehicleName) elseif vehicleName == "276" then triggerServerEvent("spawn276",localPlayer,vehicleName) end else outputChatBox("Error: Please, select a Skin of list.",255,0,0) end elseif (source == GUIEditor_Button[2]) then triggerEvent("closeWindow", root ) end end) addEventHandler("onClientGUIDoubleClick", root, function () if ( source == GUIEditor_Grid[1] ) then local row,col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(GUIEditor_Grid[1], row, 1) if vehicleName == "274" then triggerServerEvent("spawn274",localPlayer,vehicleName) elseif vehicleName == "275" then triggerServerEvent("spawn275",localPlayer,vehicleName) elseif vehicleName == "276" then triggerServerEvent("spawn276",localPlayer,vehicleName) end end end end ) for i,marker in ipairs(markers) do addEventHandler("onClientMarkerLeave", marker, function () triggerEvent("closeWindow", root ) end ) end addEventHandler("onClientPlayerWasted", root, function () triggerEvent("closeWindow", root ) end ) addEvent("closeWindow", true) addEventHandler("closeWindow", root, function () guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) setElementFrozen(localPlayer, false) end ) Server: function createMedicTeam () MedicTeam = createTeam ("Emergency", 6, 183, 248) end addEventHandler ("onResourceStart", resourceRoot, createMedicTeam) function joinMedic() setPlayerTeam(source,MedicTeam) setElementData( source, "Occupation", "Medic", true ) outputChatBox("You are now Medic.",source,0,255,0) end addEvent("setMedic", true) addEventHandler("setMedic",root,joinMedic) addEvent("spawn274", true) addEventHandler("spawn274", root, function () setElementData(source, 274) triggerClientEvent("closeWindow", root) end ) addEvent("spawn275", true) addEventHandler("spawn275", root, function () setElementData(source, 275) triggerClientEvent("closeWindow", root) end ) addEvent("spawn276", true) addEventHandler("spawn276", root, function () setElementData(source, 276) triggerClientEvent("closeWindow", root) end )
  18. hmmm okay. Other help.when I spawn one sultan I want add color and the siren. here is the script: addEvent("spawnVehicle", true) addEventHandler("spawnVehicle", root, function (vehID) if ( isElement(vehicles[source]) ) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(vehID, getElementPosition(source)) if sultan then local setsultan = setVehicleColor ( "Sultan" , 6, 183, 248) end warpPedIntoVehicle(source, vehicles[source]) triggerClientEvent("closeWindow", root) end )
  19. tested and worked.request /lock.thanks for help
  20. Is already modified.I'm trying make script(sorry for give one line)
  21. in this script I want spawn one car with occupation(scoreboard), not team.Example: and here is the script: for i,marker in ipairs(markers) do addEventHandler("onClientMarkerHit", marker, function ( hitElement ) if ( getTeamName(getPlayerTeam(hitElement)) == "Emergency" ) then if (hitElement == localPlayer) then createVehGui ( hitElement ) if (MainGui ~= nil) then guiSetVisible(MainGui, true) showCursor(true) guiSetInputEnabled(true) setElementFrozen(hitElement, true) end end end end ) end Edited
  22. didn't worked. Oh Really? you downloaded the client from a server. why you said I stolen the script?If I stole one script say me which is.
  23. script stolen?? the script was made by me
  24. Hello, I can't get the vehicle spawn.The server say "bad argument addEvent". here is script client-side: local vehicles = {"BMX", "Bike", "Mountain Bike"} local bikes = createMarker(1183.2487792969, -1314.9769287109, 12.546875, 'cylinder', 1.5, 255, 255, 255, 255) function createVehGui () MainGui = guiCreateWindow(408,203,240,349,"Get your bike",false) VehGrid = guiCreateGridList(14,32,180,256,false,MainGui) guiGridListSetSelectionMode(VehGrid,2) _bikes = guiGridListAddColumn(VehGrid,"Bikes",0.85) Spawn = guiCreateButton(15,305,96,35,"Spawn",false,MainGui) guiSetFont(Spawn,"clear-normal") Cancel = guiCreateButton(128,305,96,35,"Cancel",false,MainGui) guiSetFont(Cancel,"clear-normal") for index, vehicle in ipairs(vehicles) do local row = guiGridListAddRow (VehGrid) guiGridListSetItemText ( VehGrid, row, _bikes, tostring(vehicle), false, false ) end end addEventHandler("onClientMarkerHit", bikes, function ( hitElement ) if (hitElement == localPlayer) then createVehGui ( hitElement ) if (MainGui ~= nil) then guiSetVisible(MainGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("Error: Please Re-enter in the marker to get your vehicle.", 255, 0, 0) end end end ) addEventHandler("onClientGUIClick", root, function () if (source == Spawn) then local row,col = guiGridListGetSelectedItem(VehGrid) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(VehGrid, row, 1) if vehicleName then triggerServerEvent("spawnBike",localPlayer,vehicleName) end else outputChatBox("Erro: Please select a vehicle from the list.",255,0,0) end elseif (source == Cancel) then guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end end ) addEventHandler("onClientPlayerWasted", root, function () guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) end) and here is Server-Side: function spawnBike (lol) local id = getElementModel(thevehicle) if id == 509 or id == 510 or id == 481 then local x, y, z = getElementPosition ( source ) local xr, yr, zr = getElementRotation ( source ) createVehicle = createVehicle (id, x, y, z + 0.5, xr, yr, zr ) warpPedIntoVehicle(source, createVehicle) end end addEvent( "spawnBike", bikes, spawnBike ) Regards Ryan
×
×
  • Create New...