mars Posted August 24, 2009 Share Posted August 24, 2009 hey all i'm kinda new to scripting and i was making a kind of job. i got this but every1 sees the blip function CreateBlip(player) if (playerSkin == 211) then blip=createBlipAttachedTo(player, 52) setElementData(player,"omgblip",blip) outputChatBox("Blip attached to you",player) end end addCommandHandler ("taxi",CreateBlip) function DestroyBlip(player) if (playerSkin == 211) then destroyElement(getElementData(player,"omgblip") ) outputChatBox("fare is being helped",player) end end addCommandHandler ("canceltaxi",DestroyBlip) can any1 maybe help me to fix this?^^ thx Link to comment
50p Posted August 24, 2009 Share Posted August 24, 2009 Who do you want to see the blips? Link to comment
mars Posted August 24, 2009 Author Share Posted August 24, 2009 the meaning of this thing is, when you are a taxi driver(taxi driver gots skin 211) you can get fare's. when some1 need a taxi he types /taxi there must come a blip on the place where the guy types /taxi so the taxi can see where he have to go. Link to comment
50p Posted August 24, 2009 Share Posted August 24, 2009 I'll give you a start. function CreateBlip(player) -- first make a blip visible for you only local blip=createBlipAttachedTo(player, 52, 2, 255, 0, 0, 255, 0, 10000, player ) setElementData( player,"omgblip",blip ); outputChatBox("Blip attached to you",player) -- then loop through every player and check if his skin is 211 for i, plr in pairs( getElementsByType( "player" ) ) do if ( getPedSkin( plr ) == 211 ) then -- so one of players is 211 lets make blip visible for him: setElementVisibleTo( blip, plr, true ); end end end addCommandHandler ("taxi",CreateBlip) function DestroyBlip(player) local blip = getElementData( player, "omgblip" ); if ( blip ) then destroyElement( blip ) outputChatBox("fare is being helped",player) end end addCommandHandler ("canceltaxi",DestroyBlip) Link to comment
mars Posted August 24, 2009 Author Share Posted August 24, 2009 thx, ill test it when i got some1 to get on my server to test Link to comment
mars Posted August 26, 2009 Author Share Posted August 26, 2009 theDoor = createObject ( 10184, -1631.48, 688.37, 8.711, 0, 0, 270 ) marker = createMarker (-1631.8128662109, 687.58038330078, 6.1624999046326,18, "cylinder", 0 , 0 , 0 , 0) function openCopDoor ( hitPlayer, matchingDimension ) theHitSkin = getPedSkin ( hitPlayer ) if (theHitSkin == 280) or (theHitSkin == 281) or (theHitSkin == 282) or (theHitSkin == 283) or (theHitSkin == 284) or (theHitSkin == 285) then moveObject (theDoor, 7000, -1631.48, 688.37, 13.08 ) end end addEventHandler ("onMarkerHit", getRootElement(), openCopDoor) function closeCopDoor (leftPlayer, matchingDimension ) theLeftSkin = getPedSkin ( leftPlayer ) if (theLeftSkin == 280) or (theLeftSkin == 281) or (theLeftSkin == 282) or (theLeftSkin == 283) or (theLeftSkin == 284) or (theLeftSkin == 285) then moveObject (theDoor, 7000, -1631.48, 688.37, 8.711) end end addEventHandler ("onMarkerLeave", getRootElement(), closeCopDoor) theDDoor = createObject ( 1495, -1618.619140625, 682.3955078125, 6.137619972229, 0, 0, 272.38952636719 ) marker = createMarker (-1618.9979779297, 681.52160644531, 5.1901206970215, 2, "cylinder", 0 , 0 , 0 , 0) function openDDoor ( hitPlayer, matchingDimension ) theHitSkin = getPedSkin ( hitPlayer ) if (theHitSkin == 280) or (theHitSkin == 281) or (theHitSkin == 282) or (theHitSkin == 283) or (theHitSkin == 284) or (theHitSkin == 285) then moveObject (theDDoor, 7000, -1618.619140625, 682.3955078125, 10.137619972229 ) end end addEventHandler ("onMarkerHit", getRootElement(), openDDoor) function closeDDoor (leftPlayer, matchingDimension ) theLeftSkin = getPedSkin ( leftPlayer ) if (theLeftSkin == 280) or (theLeftSkin == 281) or (theLeftSkin == 282) or (theLeftSkin == 283) or (theLeftSkin == 284) or (theLeftSkin == 285) then moveObject (theDDoor, 7000, -1618.619140625, 682.3955078125, 6.137619972229) end end addEventHandler ("onMarkerLeave", getRootElement(), closeDDoor) the doors open with 1 marker? each marker opens the 2 doors 0.0, i'm new in scripting and trhowing all the bad words to my screen bec it aint working ¬¬'' Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now