denny199 Posted July 6, 2013 Share Posted July 6, 2013 (edited) 6ArHxiMr'3a[Z]eF, your code is wrong, and please stop typing in that stupid bold text, it's annoying. I added some explanation in the script, you still need to edit some stuff. local chekName = "staff" -- a variable( this variable is for the team chekker) local marker = createMarker ( x, y, z, "cylinder", size, 255, 0, 0, 255 ) --Creating a marker here, still need to fill in the x,y,z and the size, after that, you need to change the alpha if the size is good and position (changing [size, 255, 0, 0, 255] to [size, 255, 0, 0, 0] --Adding a event handler on the marker to a function. addEventHandler( "onMarkerHit", marker, function ( player ) -- the argument from "onMarkerHit" (the hit element) if getElementType(player) == "player" then local pTeam = getPlayerTeam ( player ) -- this will get the players team if pTeam then -- chek if the player is in a team local pTeamName = getTeamName ( pTeam ) -- get's the name of the playersTeam if pTeamName == chekName then -- chek if the players team name matches with the variable outputChatBox ( "*Welcome, "..getPlayerName ( player ).."!", player, 255, 0, 0) -- if its in the team then output: "Welcome, yourname !" else -- if the team isn't matching setElementPosition ( player, x,y,z ) -- change this to the warp point if the player isn't in the team. end end end end ) Edited July 7, 2013 by Guest Link to comment
iMr.3a[Z]eF Posted July 6, 2013 Share Posted July 6, 2013 6ArHxiMr'3a[Z]eF, your code is wrong, and please stop typing in that stupid bold text, it's annoying.I added some explanation in the script, you still need to edit some stuff. local chekName = "staff" -- a variable( this variable is for the team chekker) local marker = createMarker ( x, y, z, "cylinder", size, 255, 0, 0, 255 ) --Creating a marker here, still need to fill in the x,y,z and the size, after that, you need to change the alpha if the size is good and position (changing [size, 255, 0, 0, 255] to [size, 255, 0, 0, 0] --Adding a event handler on the marker to a function. addEventHandler( "onMarkerHit", marker, function ( player ) -- the argument from "onMarkerHit" (the hit element) local pTeam = getPlayerTeam ( player ) -- this will get the players team if pTeam then -- chek if the player is in a team local pTeamName = getTeamName ( pTeam ) -- get's the name of the playersTeam if pTeamName == chekName then -- chek if the players team name matches with the variable outputChatBox ( "*Welcome, "..getPlayerName ( player ).."!", player, 255, 0, 0) -- if its in the team then output: "Welcome, yourname !" else -- if the team isn't matching setElementPosition ( player, x,y,z ) -- change this to the warp point if the player isn't in the team. end end end ) what's wrong with mine? Link to comment
فاّرس Posted July 6, 2013 Share Posted July 6, 2013 Ok explain everything for me please juste xplain all for it to work i need it to work at the doherty sf garage this explain everything local marker = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler( "onMarkerHit", function ( player ) local PlayerTeam = getPlayerTeam ( player ) local Team = getTeamFromName ( "staff" ) if playerTeam == Team then outputChatBox ( "* welcome Staff ", player, 255, 0, 0) else killPed(player) end end ) # Replace 1- x, y ,x == the position for the area Suppose that a bird touching the circle! What will happen in your opinion? use getElementType to define it. Link to comment
iMr.3a[Z]eF Posted July 6, 2013 Share Posted July 6, 2013 only this? local marker = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler( "onMarkerHit", function ( player ) if getElementType(player) == "player" then local PlayerTeam = getPlayerTeam ( player ) local Team = getTeamFromName ( "staff" ) if playerTeam == Team then outputChatBox ( "* welcome Staff ", player, 255, 0, 0) else killPed(player) end end end ) Link to comment
denny199 Posted July 7, 2013 Share Posted July 7, 2013 only this? local marker = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler( "onMarkerHit", function ( player ) if getElementType(player) == "player" then local PlayerTeam = getPlayerTeam ( player ) local Team = getTeamFromName ( "staff" ) if playerTeam == Team then outputChatBox ( "* welcome Staff ", player, 255, 0, 0) else killPed(player) end end end ) You still don't see the bug? " addEventHandler( "onMarkerHit", " isn't attached on something, also see my edited code, that one will work Link to comment
iMr.3a[Z]eF Posted July 7, 2013 Share Posted July 7, 2013 hahaha i forget it why you didnt told me the bug local marker = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 170 ) addEventHandler( "onMarkerHit", marker, function ( player ) if getElementType(player) == "player" then local PlayerTeam = getPlayerTeam ( player ) local Team = getTeamFromName ( "staff" ) if playerTeam == Team then outputChatBox ( "* welcome Staff ", player, 255, 0, 0) else killPed(player) end end end ) 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