Xwad Posted October 1, 2015 Share Posted October 1, 2015 Hi i just want to ask that how can i make an outputchatbox in server side local? I mean if forexample a player hit a marker then the script will output a chatbox. And i want to make that only the player will see that chatbox who hit the marker. Becaouse i made a script like that and when the player hit the marker than everyone saw the chatbox. This is a pőart of my script function markerHit6(hitElement, matchingDimension, player, thePlayer) if getElementType(hitElement) =="player" and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "America" and isElement (GA6) then outputChatBox("Please,Stay 10 Secs in the area to capture it !",thePlayer,255,109 ,109 ) timer6 = setTimer ( captureAreaA6, 4000, 1 ) else cancelEvent() if getElementType(hitElement) =="player" and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "German" and isElement (UA6) then outputChatBox("Please,Stay 10 Secs in the area to capture it !",thePlayer,255,109 ,109 ) timer6 = setTimer ( captureAreaG6, 4000, 1 ) end end end addEventHandler("onMarkerHit", marker6, markerHit6) Link to comment
Enargy, Posted October 1, 2015 Share Posted October 1, 2015 You must use hitElement instead of thePlayer. Link to comment
KariiiM Posted October 1, 2015 Share Posted October 1, 2015 Who's thePlayer? onMarkerHit / onClientMarkerHit events are with two arguments the player who hit the marker and dimension function markerHit6(hitElement, matchingDimension) if getElementType(hitElement) =="player" and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "America" and isElement (GA6) then outputChatBox("Please,Stay 10 Secs in the area to capture it !",hitElement,255,109 ,109 ) timer6 = setTimer ( captureAreaA6, 4000, 1 ) else cancelEvent() if getElementType(hitElement) =="player" and getPlayerTeam(hitElement) and getTeamName (getPlayerTeam(hitElement)) == "German" and isElement (UA6) then outputChatBox("Please,Stay 10 Secs in the area to capture it !",hitElement,255,109 ,109 ) timer6 = setTimer ( captureAreaG6, 4000, 1 ) end end end addEventHandler("onMarkerHit", marker6, markerHit6) Link to comment
Johnny Killstone Posted October 1, 2015 Share Posted October 1, 2015 Actually, the hitElement could be any element hitting the marker like a car, a tree or a lamppost flying into the marker, just make sure to use getElementType and check so that hitElement is a player element and nothing else. Link to comment
KariiiM Posted October 1, 2015 Share Posted October 1, 2015 Actually, the hitElement could be any element hitting the marker like a car, a tree or a lamppost flying into the marker, just make sure to use getElementType and check so that hitElement is a player element and nothing else. He already did that getElementType(hitElement) =="player" you can also use isPedInVehicle and isPedDead to check if the player who hit the marker is in the vehicle or not isPedDead used to check if the player is dead or no in this case you can do something by lua like that if not isPedDead ( hitElement) ) then Link to comment
Johnny Killstone Posted October 1, 2015 Share Posted October 1, 2015 Or get the vehicle occupant(s) if there's a vehicle hitting the marker, there are many possibilities for all of us with some creativity skills, just wanted to point that out even it was already in the code Link to comment
KariiiM Posted October 1, 2015 Share Posted October 1, 2015 Or get the vehicle occupant(s) if there's a vehicle hitting the marker, there are many possibilities for all of us with some creativity skills, just wanted to point that out even it was already in the code Yes i understand, he also must know what he do because as i see he is scripting but he don't know the meaning of some functions Link to comment
Xwad Posted October 2, 2015 Author Share Posted October 2, 2015 Enargy¸: Thanks its working:D 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