roy_ppp Posted November 29, 2010 Share Posted November 29, 2010 Hi all i'm want ask all function Sk ( source ) local Drive = getElementType ( source ) if Drive == "vehicle" then outputChatBox(Drive) triggerClientEvent( "onGreeting", source) else outputChatBox("Your not drive car !", source, 255,0,0) outputChatBox(Drive) end end addEventHandler("onMarkerHit", mydrop, Sk) Drive == Vehicle but next code function Sk ( source ) f ( getElementType ( source )) == "vehicle" then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local jobanow = getAccountData ( playeraccount, "job.Human") if jobanow == "Dropcar" then outputChatBox(jobanow) local Drive = getElementType ( source ) if Drive == "vehicle" then outputChatBox(Drive) triggerClientEvent( "onGreeting", source) else outputChatBox("Your not drive car !", source, 255,0,0) outputChatBox(Drive) end else outputChatBox("Your not dropcar man", source) end end end addEventHandler("onMarkerHit", mydrop, Sk) Drive is not "vehicle" but it "player" Why (i'm drive car and hit marker) Link to comment
CowTurbo Posted November 29, 2010 Share Posted November 29, 2010 local Drive = getElementType ( source ) in both function, ur getting element type of marker ( source ) [addEventHandler ( "onMarkerHit".. ) make's marker as source ) use ( hitElement ) or so, and in function add too hitElement, not source function Sk ( hitElement) if ( getElementType ( hitElement)) == "vehicle" then local playeraccount = getPlayerAccount ( hitElement) if ( playeraccount ) then local jobanow = getAccountData ( playeraccount, "job.Human") if jobanow == "Dropcar" then outputChatBox(jobanow) local Drive = getElementType ( hitElement) if Drive == "vehicle" then outputChatBox(Drive) triggerClientEvent( "onGreeting", hitElement) else outputChatBox("Your not drive car !", hitElement, 255,0,0) outputChatBox(Drive) end else outputChatBox("Your not dropcar man", hitElement) end end end addEventHandler("onMarkerHit", mydrop, Sk) Link to comment
roy_ppp Posted November 29, 2010 Author Share Posted November 29, 2010 Thank Markes but it not work lol Have wrong ? Link to comment
Aibo Posted November 29, 2010 Share Posted November 29, 2010 (edited) this is pure randomness: if getElementType ( hitElement) == "vehicle" then local playeraccount = getPlayerAccount ( hitElement) vehicle account? :В and you lost "end" that closes first "if". Edited November 29, 2010 by Guest Link to comment
roy_ppp Posted November 29, 2010 Author Share Posted November 29, 2010 lol end first if i'm fix now haha but it vehicle account? << Okay i know now how to do next (i'm bad eng sorry @_@) Link to comment
Aibo Posted November 29, 2010 Share Posted November 29, 2010 i honestly do not understand what are you trying to do with "Your not dropcar man" stuff. so the only thing i can help with is to fix basic/syntax erorrs. Link to comment
CowTurbo Posted November 29, 2010 Share Posted November 29, 2010 add to function hitPlayer and check account data from hitPlayer. 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