Jump to content

MAB

Members
  • Posts

    313
  • Joined

  • Last visited

Everything posted by MAB

  1. MAB

    Unsolved

    I need an example about how to: create a vehicle and OnVehicleEnter a marker from a group of markers will be created and OnMarkerHit a function will happen and that marker will be destroyed and other marker from the group of markers will be created randomly..RANDOMLY MTA will choose a random one of that group to create and on the hit the current one disappear and other one gets created ... an example here please
  2. MAB

    help

    i don't understand that...but it is ok now.. i am done with that function i used a commandHandler
  3. MAB

    help

    That is very nice but the problem is that thePlayer isn't in the boat....he left the boat then the boat was destroyed
  4. MAB

    help

    the mta system can't know who is the player... all the function worked but the setElementData didn't so i added if thePlayer then .. now all the function isn't working function resetjob (thePlayer) if thePlayer then setElementData ( thePlayer, "fisher", false ) destroyElement ( boat ) destroyElement ( blip ) outputChatBox ( "It seems that your fishing boat exploded! Don't Worry you can start the job again!", hitElement, 255, 255, 0) outputChatBox ( "If your boat was destroyed by other player then take a screen shot [F12] and tell a mod or use /report!", hitElement, 255, 255, 0) end end addEventHandler ( "onVehicleExplode", boat, resetjob )
  5. MAB

    2 questions

    According to this LUA....can i prevent other players from stealing the boat (line 19) by using this function? function stop (thePlayer) if source == boat and not isElementVisibleTo(blip,thePlayer) then cancelEvent() end end addEventHandler ("OnVehicleEnter,root,stop) this is just the idea ^^^ question two....how to do a function when the fisher gets on the boat? local fishmark = createMarker ( -2185.32202, 2416.38135, 4.5, "cylinder", 1.5, 255, 255, 0, 255 ) createBlipAttachedTo ( fishmark, 9 ) function outPut ( hitElement, matchingDimension ) if not isPedInVehicle ( hitElement ) and not (getElementData ( hitElement, "fisher" ) == true) then outputChatBox ( "Press E to start the job", hitElement, 255, 255, 0, true ) end if not isPedInVehicle ( hitElement ) and (getElementData ( hitElement, "fisher" ) == true) then outputChatBox ( "You have already started the job before", hitElement, 255, 255, 0, true ) end end addEventHandler( "onMarkerHit", fishmark, outPut ) function start ( hitElement, key, keyState ) local name = getPlayerName (hitElement) if not isPedInVehicle ( hitElement ) and not (getElementData ( hitElement, "fisher" ) == true) then if hitElement then setElementData ( hitElement, "fisher", true ) local boat = createVehicle ( 473, -2218.21387, 2419.93970, 1 ) local blip = createBlipAttachedTo ( boat, 56 ) setElementVisibleTo ( blip, root, false ) setElementData ( boat, "myboat", name ) setElementVisibleTo ( blip, hitElement, true ) outputChatBox ( "Your boat is in the water, find it and start your job", hitElement, 255, 255, 0, true ) unbindKey ( hitElement, "E", "down", start ) end end end function bind (hitElement, matchingDimension) bindKey ( hitElement, "E", "down", start ) end addEventHandler( "onMarkerHit", fishmark, bind ) function unbind ( hitElement, matchingDimension ) unbindKey ( hitElement, "E", "down", start ) end addEventHandler( "onMarkerLeave", fishmark, unbind )
  6. MAB

    Help me fast

    i am making a fisher job! what is the problem with that? i can't see the blip or the outPutChatBox that says your boat is in the water but the boat is done how to put the code for you? local fishmark = createMarker ( -2185.32202, 2416.38135, 4.5, "cylinder", 1.5, 255, 255, 0, 255 ) createBlipAttachedTo ( fishmark, 9 ) function outPut ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement ) and not (getElementData ( hitElement, "fisher" ) == true) then outputChatBox ( "Press E to start the job", hitElement, 255, 255, 0, true ) end if getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement ) and (getElementData ( hitElement, "fisher" ) == true) then outputChatBox ( "You have arleady started the job before", hitElement, 255, 255, 0, true ) end end addEventHandler( "onMarkerHit", fishmark, outPut ) function start ( hitElement, key, keyState ) if getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement ) and not getElementData ( hitElement, "fisher" ) then setElementData ( hitElement, "fisher", true ) local boat = createVehicle ( 473, -2218.21387, 2419.93970, 1 ) end if boat then setElementData ( boat, "myboat", getPlayerName ( hitElement ) ) blip = createBlipAttachedTo ( boat, 56 ) setElementVisibleTo ( blip, root, false ) setElementVisibleTo ( blip, hitElement, true ) outputChatBox ( "Your boat is in the water, find it and start your job", hitElement, 255, 255, 0, true ) unbindKey ( player, "E", "down", start ) end end function bind (hitElement, matchingDimension) bindKey ( hitElement, "E", "down", start ) end addEventHandler( "onMarkerHit", fishmark, bind ) function unbind ( hitElement, matchingDimension ) unbindKey ( hitElement, "E", "down", start ) end addEventHandler( "onMarkerLeave", fishmark, unbind )
  7. all what you need is here wiki. setElementData getElementData walid.... if i understood what is written in the wiki why would i have come here?!
  8. Hi i am making a fisher job and i will use setElementData and getElementData but idk how to use these two functions. what i want to use them for is the set the Data of the player as a fisher when he start the job then i will make some functions using getElementData ... checking if he is a fisher or not to make these functions... i just want to know how to use setElementData so can someone please tell me how the arguments works? and what are the arguments for? *NOTE: if you speak Arabic then put me the reply in Arabic....if you aren't then no problem
  9. MAB

    Help!

    yes yes what to int and dimen to set???
  10. MAB

    Help!

    What about the dimen and the int ?
  11. MAB

    Help!

    I am new at scripting mm... i need a little help here.... i made some simple resources but i have never made a script that contains more than 1 player and i want to make a marker and on that markerHit i want to transfer the player to a Last man standing area because of course i am making a last man standing mini game so i will transfer players to the match area then i want to getPlayersCount (the match area) and idk how to transfer them with a correct dimen and int and also i don't know how to deal with more than 1 player so... a little help here please!
  12. MAB

    Help!

    Thanks so much!
  13. MAB

    Help!

    Hello i need your help.... i want the game to choose a random model from these three models : 515 , 403 and 514 so what should i type in the model argument? createVehicle ( , x, y, z )
×
×
  • Create New...