Jump to content

[1.0] job [1.0]


mars

Recommended Posts

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...