ahmed1010 Posted November 7, 2013 Posted November 7, 2013 correct this code and i want it to open without button Team = "ahmed1010" local Object = createObject ( ID, x, y, z, rx, ry, rz ) local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 ) function OpenObject ( player ) if isElementWithinMarker ( player, Marker ) then if ( getTeamName( getPlayerTeam( player ) ) == Team ) then if not Open then moveObject ( Object, 1500, moveX, moveY, moveZ ) else moveObject ( Object, 1500, x, y, z ) end Open = not Open else outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) end end end addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, v in ipairs ( getElementsByType ( "player" ) ) do bindKey ( v, "tab", "down", OpenObject ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "tab", "down", OpenObject ) end )
Price. Posted November 7, 2013 Posted November 7, 2013 seems its not your code but here Team = "ahmed1010" local Object = createObject ( ID, x, y, z, rx, ry, rz ) local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 ) function OpenObject ( player ) if isElementWithinMarker ( player, Marker ) then if ( getTeamName( getPlayerTeam( player ) ) == Team ) then if not Open then moveObject ( Object, 1500, moveX, moveY, moveZ ) else moveObject ( Object, 1500, x, y, z ) end Open = not Open else outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) end end end addEventHandler ( "onResourceStart", getRootElement(), OpenObject ) What do you mean by "correct" this code? you have to say what you want to be edited or whats your errors?
ahmed1010 Posted November 7, 2013 Author Posted November 7, 2013 seems its not your code but here Team = "ahmed1010" local Object = createObject ( ID, x, y, z, rx, ry, rz ) local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 ) function OpenObject ( player ) if isElementWithinMarker ( player, Marker ) then if ( getTeamName( getPlayerTeam( player ) ) == Team ) then if not Open then moveObject ( Object, 1500, moveX, moveY, moveZ ) else moveObject ( Object, 1500, x, y, z ) end Open = not Open else outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) end end end addEventHandler ( "onResourceStart", getRootElement(), OpenObject ) What do you mean by "correct" this code? you have to say what you want to be edited or whats your errors? error do not open
Castillo Posted November 7, 2013 Posted November 7, 2013 That makes no sense, you must use the onMarkerHit event.
Anony# Posted November 8, 2013 Posted November 8, 2013 Give me the correct code. your code this messy start the right way good luck. local Object = createObject ( 3344, -11.482395172119, 2071.0393066406, 17.4921875, -11.482395172119, 2071.0393066406, 17.4921875) local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 ) Team = "..." OpenObjectEnter = function(player) x, y, z = getElementPosition ( player ) --position x y z moveObject ( Object, 3000, x, y, z ) end addEventHandler ( "onMarkerHit", getRootElement(), OpenObjectEnter) OpenObjectExit = function(player) x, y, z = getElementPosition ( player ) --positions x y z moveObject ( Object, -3000, x, y, z ) end addEventHandler ( "onMarkerHit", getRootElement(), OpenObjectExit)
Atton Posted November 8, 2013 Posted November 8, 2013 moveObject ( Object, 1500, moveX, moveY, moveZ ) local Object = createObject ( ID, x, y, z, rx, ry, rz ) moveObject ( Object, 1500, x, y, z ) What the f.uck are you even trying to make this code is massively deformed. Team = "ahmed1010" local Object = createObject ( ID, x, y, z, rx, ry, rz )--What the f.uck is this and where does x y z rx ry rz come from local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 ) function OpenObject ( player ) if isElementWithinMarker ( player, Marker ) then --This could be done via addEventHandler if ( getTeamName( getPlayerTeam( player ) ) == Team ) then if not Open then -- What the f.uck is open it is not defined moveObject ( Object, 1500, moveX, moveY, moveZ ) --What the f.uck is moveX moveY and moveZ there is nothing to define them. else moveObject ( Object, 1500, x, y, z ) -- Again what the f.uck end Open = not Open -- Do I need to keep saying this else outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) end end end addEventHandler ( "onResourceStart", getRootElement(), OpenObject ) --Why the f.uck do you want this to go when the resource starts that makes no sense. Try doing this again because it really sucks I can't even understand what this code does. GATECcol = createColCircle(153.87090,-1772.38123,8) Cgate = createObject (987,148.69999694824,-1772.4000244141,2.7000000476837,0,0,0) function GC1 (thePlayer) moveObject (Cgate,1200,148.69999694824,-1772.4000244141,-4) end addEventHandler("onColShapeHit", GATECcol , GC1) function GC2 (thePlayer) moveObject (Cgate,1200,148.69999694824,-1772.4000244141,2.7000000476837) end addEventHandler ("onColShapeLeave", GATECcol ,GC2) Above is something that works redo your code.
ahmed1010 Posted November 8, 2013 Author Posted November 8, 2013 The last request: code: cars marker to Special group please i want it
Price. Posted November 8, 2013 Posted November 8, 2013 you will need to make a group that will be special in ACL and use: if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("GROUPNAME")) then
h-a-m-z-a Posted November 8, 2013 Posted November 8, 2013 need code car for my Group "Good" help pleaz
h-a-m-z-a Posted November 8, 2013 Posted November 8, 2013 i need code marker car for group ... my group is "Good'
h-a-m-z-a Posted November 8, 2013 Posted November 8, 2013 (edited) TAPL i want code marker car for Group systeme like in gang Ware Edited November 8, 2013 by Guest
Price. Posted November 8, 2013 Posted November 8, 2013 try this Marker = createMarker (x, y, z, "cylinder", 2,0, 0, 255,255) addEventHandler("onMarkerHit",Marker, function(thePlayer) if (getElementType(thePlayer) == 'player' ) then local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Good" ) ) ) then createVehicle ( ID, x+10, y, z ) end end end ) Edited the code. Now if you are in gorup "good" you will be able to create a car beside you, if you want to get him into car use warpPedIntoVehicle
TAPL Posted November 9, 2013 Posted November 9, 2013 ID, x, y and z is not defined. createVehicle ( ID, x+10, y, z ) You need getElementPosition.
h-a-m-z-a Posted November 9, 2013 Posted November 9, 2013 i need hol code and open window like gta-ar
TAPL Posted November 9, 2013 Posted November 9, 2013 what is hol? Make it yourself, we don't accept request.
Price. Posted November 9, 2013 Posted November 9, 2013 here this is the full code, about that window make it yourself as TAPL said Marker = createMarker (1811.0029296875, 1076.5595703125, 6.734375, "cylinder", 2.0, 0, 255,255) addEventHandler("onMarkerHit",Marker, function(thePlayer) if (getElementType(thePlayer) == 'player' ) then local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "L5" ) ) ) then local x,y,z = getElementPosition(thePlayer) x = x+10 createVehicle (411, 1811.0029296875, 1076.5595703125, 6.734375) end end end )
Saml1er Posted November 10, 2013 Posted November 10, 2013 You mean this? -- CLIENT SIDE Object1 = createObject ( 153.87090,-1772.38123,8 ) Marker = createMarker (1811.0029296875, 1076.5595703125, 6.734375, "cylinder", 2.0, 0, 255,255) function MyMarker(hitPlayer) if hitPlayer~=localPlayer then return end local vehicle = getPedOccupiedVehicle(hitPlayer) if vehicle and source==Marker then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitPlayer)),aclGetGroup("Admin")) then moveObject (Object1,1200,148.69999694824,-1772.4000244141,-4) else moveObject (Object1,1200,148.69999694824,-1772.4000244141,2.7000000476837) end end end end addEventHandler ("onClientMarkerHit", resourceRoot, MyMarker) change the coordinates and the group name with whatever you want. Not tested but should work.
tosfera Posted November 10, 2013 Posted November 10, 2013 You know, back in the days people requested help. Some weird errors they couldn't understand. Now, they don't even put effort in learning english in a way that other people can understand them, and they are just requesting scripts? Oh, ya well good luck playing on one of these servers which are owned by people without any lua knowledge. Found a bug? Ya, sorry. It takes 2 weeks before the community fixes it for me! Might sound rude but... we should follow the rest of the community and stop giving them away their requested scripts. Let them learn their selfs... Jees.
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