Jump to content

BialyDran

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by BialyDran

  1. Any idea's how to make this piece of code more efficient and / or robust? function ChooseAnswers() if ( guiGetText ( Option[i] ) == npcAnswers[1][2] ) then wayOne() elseif ( guiGetText ( Option[i] ) == npcAnswers[1][3]) then wayTwo() elseif( guiGetText ( Option[i] ) == npcAnswers[1][4]) then wayThree() elseif( guiGetText ( Option[i] ) == npcAnswers[1][5]) then wayFour() elseif( guiGetText ( Option[i] ) == npcAnswers[2][2]) then way1Option1() elseif( guiGetText ( Option[i] ) == npcAnswers[3][2]) then way2Option1() elseif( guiGetText ( Option[i] ) == npcAnswers[3][3][2]) then way2Option1Answer1() elseif( guiGetText ( Option[i] ) == npcAnswers[3][4]) then way2Option2() elseif( guiGetText ( Option[i] ) == npcAnswers[3][5][2]) then way2Option1Answer2() elseif( guiGetText ( Option[i] ) == npcAnswers[4][2]) then way3Option1() elseif( guiGetText ( Option[i] ) == npcAnswers[5][2]) then way4Option1() elseif( guiGetText ( Option[i] ) == npcAnswers[5][3][2]) then way4Option1Answer1() elseif( guiGetText ( Option[i] ) == npcAnswers[5][4]) then way4Option2() elseif( guiGetText ( Option[i] ) == npcAnswers[5][5][2]) then way4Option2Answer1() else outputChatBox("Unknown error. Please report it to admin ASAP.") end end function wayOne() -- end function way1Option1() -- end function wayTwo() -- end function way2Option1() -- end function way2Option2() -- end function way2Option1Answer1() -- end function way2Option1Answer2() -- end function wayThree() - end function way3Option1() -- end function wayFour() -- end function way4Option1() -- end function way4Option1Answer1() -- end function way4Option2() -- end function way4Option2Answer1() -- end Maybe by using CASE? Idk help plz
  2. BialyDran

    Pubg

    https://wiki.multitheftauto.com/wiki/CreateColCuboid Maybe try this? Use a timer to make this smaller each few minutes and use https://wiki.multitheftauto.com/wiki/OnColShapeLeave and then use https://wiki.multitheftauto.com/wiki/SetElementHealth Good Luck
  3. Thanks mate, I'll try this
  4. Eghh, to be honest it doesnt help at all. I have full script ready with client & server scripts which works fully when you're making this on your own. Problem begins when there are 2 people working on this job at the same time. If 2 players have a box, then if 1 player enters a marker it destroys a box for all players in the server who has this box. Im looking for a way to destroy only element for a player that entered this marker.
  5. Well, I was thinking about making this client side, but I want all players to be able to see that someone is actually caring a box and then that this box dissapears when they walk into a marker.
  6. Hey, im having a problem with destroyElement. Script is meant to: 1) Give player a box IF pressed E in the appropriate marker ( works. ) 2) Using a random function choose a marker where he needs to give it back ( works.) 3) Destroy only element that this player who enters a marker is "holding" What is wrong? Its server-side. So it destroy each box element that exists in the server and I want to destroy it only for the person that enters the marker. Any ideas how to do this? I was thinking about either using setElementData or tables, but have no idea how to start with this. Here's the code for server- side: addEvent("GiveThing", true) addEventHandler("GiveThing", getRootElement(), function(localPlayer) object = createObject(1518, 0, 0, 0) attachElements(object, source, 0, 0.5, 0.4) setObjectScale(object, 0.9) end) addEvent("RemoveThing", true) addEventHandler("RemoveThing", getRootElement(), function(localPlayer) destroyElement(object) end)
×
×
  • Create New...