K4stic Posted March 31, 2013 Posted March 31, 2013 It Create the markers from table 'vehicles' but then i hit the market not show the gui for index,table in pairs(vehicles) do local marker = createMarker(table.x, table.y, table.z, "cylinder", 2, table.r, table.g, table.b, 100) setElementData(marker, "vehiclemarker-role", table.Roles) setElementData(marker, "vehiclemarker-vehicles", table.vehicles) setElementData(marker, "vehiclemarker-rotation", table.rotation) vehicle[marker] = table.Roles local position = table.x..", "..table.y..", "..table.z..", "..table.rotation..", " local color1 = table.vehR1..", "..table.vehG1..", "..table.vehB1..", " local color2 = table.vehR2..", "..table.vehG2..", "..table.vehB2..", " setElementData(marker, "vehiclemarker-position", position) setElementData(marker, "vehiclemarker-color1", color1) setElementData(marker, "vehiclemarker-color2", color2) addEventHandler("onMarkerHit", marker, onPlayerVehicleMarkerHit) end function onPlayerVehicleMarkerHit(player) local role = getElementData(source, "vehiclemarker-role") local vehicles = getElementData(source, "vehiclemarker-vehicles") local rotation = getElementData(source, "vehiclemarker-rotation") if (not isElement(player)) then return end if (getElementType(player) ~= "player") then return end if (getElementData(player, dataToFindPlayersJob) == role or role == "ALL") then if (isPedInVehicle(player)) then return end local position = getElementData(source, "vehiclemarker-position") local color1 = getElementData(source, "vehiclemarker-color1") local color2 = getElementData(source, "vehiclemarker-color2") local posX, posY, posZ, rotation = unpack(split(position, ",")) local r, g, b = unpack(split(color1, ",")) local r2, g2, b2 = unpack(split(color2, ",")) triggerClientEvent(player, "jobvehicles.showVehicleGUI", root, vehicles, rotation, posX, posY, posZ, rotation, r, g, b, r2, g2, b2) else outputChatBox("This marker is reserved for '"..role.."'", player, 250, 0, 0) end end Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted March 31, 2013 Posted March 31, 2013 for index,table in pairs(vehicles) do local marker = createMarker(table.x, table.y, table.z, "cylinder", 2, table.r, table.g, table.b, 100) setElementData(marker, "vehiclemarker-role", table.Roles) setElementData(marker, "vehiclemarker-vehicles", table.vehicles) setElementData(marker, "vehiclemarker-rotation", table.rotation) vehicle[marker] = table.Roles local position = table.x..", "..table.y..", "..table.z..", "..table.rotation..", " local color1 = table.vehR1..", "..table.vehG1..", "..table.vehB1..", " local color2 = table.vehR2..", "..table.vehG2..", "..table.vehB2..", " setElementData(marker, "vehiclemarker-position", position) setElementData(marker, "vehiclemarker-color1", color1) setElementData(marker, "vehiclemarker-color2", color2) addEventHandler("onMarkerHit", marker, onPlayerVehicleMarkerHit) end Put that inside a function executed by a "onResourceStart" event. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted March 31, 2013 Author Posted March 31, 2013 but if i do that then again adter more 5 spawns or 5 restart resource it bug me all markers in server so i need other way Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted March 31, 2013 Posted March 31, 2013 What do you mean? post how you tried to do it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted March 31, 2013 Author Posted March 31, 2013 i post and you say to add event "onResourceStart" Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted March 31, 2013 Posted March 31, 2013 I mean, post the code which you say it bugs. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted March 31, 2013 Author Posted March 31, 2013 it bugs all markers in server then i stop resource is all unbugged the markers and i have 5-6 scripts who used markers Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted March 31, 2013 Posted March 31, 2013 addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index,table in pairs(vehicles) do local marker = createMarker(table.x, table.y, table.z, "cylinder", 2, table.r, table.g, table.b, 100) setElementData(marker, "vehiclemarker-role", table.Roles) setElementData(marker, "vehiclemarker-vehicles", table.vehicles) setElementData(marker, "vehiclemarker-rotation", table.rotation) vehicle[marker] = table.Roles local position = table.x..", "..table.y..", "..table.z..", "..table.rotation..", " local color1 = table.vehR1..", "..table.vehG1..", "..table.vehB1..", " local color2 = table.vehR2..", "..table.vehG2..", "..table.vehB2..", " setElementData(marker, "vehiclemarker-position", position) setElementData(marker, "vehiclemarker-color1", color1) setElementData(marker, "vehiclemarker-color2", color2) addEventHandler("onMarkerHit", marker, onPlayerVehicleMarkerHit) end end ) function onPlayerVehicleMarkerHit(player) local role = getElementData(source, "vehiclemarker-role") local vehicles = getElementData(source, "vehiclemarker-vehicles") local rotation = getElementData(source, "vehiclemarker-rotation") if (not isElement(player)) then return end if (getElementType(player) ~= "player") then return end if (getElementData(player, dataToFindPlayersJob) == role or role == "ALL") then if (isPedInVehicle(player)) then return end local position = getElementData(source, "vehiclemarker-position") local color1 = getElementData(source, "vehiclemarker-color1") local color2 = getElementData(source, "vehiclemarker-color2") local posX, posY, posZ, rotation = unpack(split(position, ",")) local r, g, b = unpack(split(color1, ",")) local r2, g2, b2 = unpack(split(color2, ",")) triggerClientEvent(player, "jobvehicles.showVehicleGUI", root, vehicles, rotation, posX, posY, posZ, rotation, r, g, b, r2, g2, b2) else outputChatBox("This marker is reserved for '"..role.."'", player, 250, 0, 0) end end Try it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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