Jump to content

Ryan123

Members
  • Posts

    24
  • Joined

  • Last visited

Ryan123's Achievements

Civilian

Civilian (7/54)

0

Reputation

  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
×
×
  • Create New...