Tete omar Posted June 2, 2012 Share Posted June 2, 2012 Client side local Marker = createMarker ( -28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255 ) addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) if (hitPlayer == localPlayer) then guiSetVisible(GUIEditor_Window[2], true) showCursor(true) end end) function createFarm() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Grid = {} GUIEditor_Window[2] = guiCreateWindow(18,307,367,431,"",false) guiSetAlpha(GUIEditor_Window[2],1) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[3] = guiCreateButton(22,377,88,42,"Work",false,GUIEditor_Window[2]) GUIEditor_Button[4] = guiCreateButton(246,383,86,39,"Exit",false,GUIEditor_Window[2]) GUIEditor_Memo[2] = guiCreateMemo(16,32,339,216,"=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====",false,GUIEditor_Window[2]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) guiSetVisible(GUIEditor_Window[2], false) end addEventHandler("onClientResourceStart", root, createFarm) function exiting() if ( source == GUIEditor_Button[4] ) then guiSetVisible(GUIEditor_Window[2],false) guiSetInputEnabled(false) showCursor(false) elseif ( source == GUIEditor_Button[8] ) then guiSetVisible(GUIEditor_Window[2],false) guiSetInputEnabled(false) showCursor(false) addEventHandler('onClientGUIClick', root, exiting) function yabbooy() local skins = -- Create a table with our skin names and their ID's. { { "Farmer", 158 }, { "Farmer Redneck", 159 }, { "Farmer Girl", 157 } , } GUIEditor_Grid[1] = guiCreateGridList(12,260,346,79, false, GUIEditor_Window[2]) guiGridListAddColumn(GUIEditor_Grid[1],"Select your skin",0.2) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, skin [ 1 ], false, false ) guiGridListSetItemData ( GUIEditor_Grid[1], row, 1, skin [ 2 ] ) end end end end function vehicleas() Marker = createMarker ( -29.7998046875, 5.8994140625, 2.0999999046326, "cylinder", 3, 234, 70, 0, 19 ) addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) if (hitPlayer == localPlayer) then triggerServerEvent ( "onVehicleRide", localPlayer ) vehicle = createVehicle ( 532, -29.7998046875 , 5.8994140625, 5.8994140625 ) end end) end server side addEvent("onVehicleRide", true) addEventHandler("onVehicleRide", root, function () warpPedIntoVehicle ( localPlayer, vehicle ) end ) There's no error on debugscript 3 but i think it makes no sense i mean when i hit the marker nothing happens Link to comment
DNL291 Posted June 2, 2012 Share Posted June 2, 2012 localPlayer (getLocalPlayer) is only the client side. Link to comment
Tete omar Posted June 2, 2012 Author Share Posted June 2, 2012 localPlayer (getLocalPlayer) is only the client side. Give me an avail so what ? Link to comment
DNL291 Posted June 2, 2012 Share Posted June 2, 2012 (edited) local Marker = createMarker ( -28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255 ) addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) if (hitPlayer == localPlayer) then guiSetVisible(GUIEditor_Window[2], true) showCursor(true) end end) function createFarm() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Grid = {} GUIEditor_Window[2] = guiCreateWindow(18,307,367,431,"",false) guiSetAlpha(GUIEditor_Window[2],1) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[3] = guiCreateButton(22,377,88,42,"Work",false,GUIEditor_Window[2]) GUIEditor_Button[4] = guiCreateButton(246,383,86,39,"Exit",false,GUIEditor_Window[2]) GUIEditor_Memo[2] = guiCreateMemo(16,32,339,216,"=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====",false,GUIEditor_Window[2]) guiMemoSetReadOnly(GUIEditor_Memo[2],true) guiSetVisible(GUIEditor_Window[2], false) end addEventHandler("onClientResourceStart", root, createFarm) function exiting() if ( source == GUIEditor_Button[4] ) then guiSetVisible(GUIEditor_Window[2],false) guiSetInputEnabled(false) showCursor(false) elseif ( source == GUIEditor_Button[8] ) then guiSetVisible(GUIEditor_Window[2],false) guiSetInputEnabled(false) showCursor(false) addEventHandler('onClientGUIClick', root, exiting) function yabbooy() local skins = -- Create a table with our skin names and their ID's. { { "Farmer", 158 }, { "Farmer Redneck", 159 }, { "Farmer Girl", 157 } , } GUIEditor_Grid[1] = guiCreateGridList(12,260,346,79, false, GUIEditor_Window[2]) guiGridListAddColumn(GUIEditor_Grid[1],"Select your skin",0.2) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, skin [ 1 ], false, false ) guiGridListSetItemData ( GUIEditor_Grid[1], row, 1, skin [ 2 ] ) end end end end function vehicleas() Marker = createMarker ( -29.7998046875, 5.8994140625, 2.0999999046326, "cylinder", 3, 234, 70, 0, 19 ) addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) if (hitPlayer == localPlayer) then triggerServerEvent ( "onVehicleRide", localPlayer, 532 ) end end) end addEvent("onVehicleRide", true) addEventHandler("onVehicleRide", root, function (vehicleID) vehicle = createVehicle( tonumber(vehicleID), -29.7998046875 , 5.8994140625, 5.8994140625 ) warpPedIntoVehicle ( source, vehicle ) end ) Edited June 2, 2012 by Guest Link to comment
myonlake Posted June 2, 2012 Share Posted June 2, 2012 Client-side local marker = createMarker(-28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255) addEventHandler("onClientMarkerHit", marker, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" then guiSetVisible(GUIEditor_Window[2], true) showCursor(true) end end ) addEventHandler("onClientResourceStart", root, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Grid = {} GUIEditor_Window[2] = guiCreateWindow(18, 307, 367, 431, "", false) guiSetAlpha(GUIEditor_Window[2], 1) guiWindowSetSizable(GUIEditor_Window[2], false) GUIEditor_Button[3] = guiCreateButton(22, 377, 88, 42, "Work", false, GUIEditor_Window[2]) GUIEditor_Button[4] = guiCreateButton(246, 383, 86, 39, "Exit", false, GUIEditor_Window[2]) GUIEditor_Memo[2] = guiCreateMemo(16, 32, 339, 216, "=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====", false, GUIEditor_Window[2]) guiMemoSetReadOnly(GUIEditor_Memo[2], true) guiSetVisible(GUIEditor_Window[2], false) local skins = { { "Farmer", 158 }, { "Farmer Redneck", 159 }, { "Farmer Girl", 157 } } GUIEditor_Grid[1] = guiCreateGridList(12, 260, 346, 79, false, GUIEditor_Window[2]) guiGridListAddColumn(GUIEditor_Grid[1], "Select your skin", 0.2) for index,skin in ipairs(skins) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, 1, skin[1], false, false) guiGridListSetItemData(GUIEditor_Grid[1], row, 1, skin[2]) end end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[4] then guiSetVisible(GUIEditor_Window[2], false) guiSetInputEnabled(false) showCursor(false) elseif source == GUIEditor_Button[8] then guiSetVisible(GUIEditor_Window[2], false) guiSetInputEnabled(false) showCursor(false) end end, false ) addEventHandler("onClientMarkerHit", marker, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" then local vehicle = createVehicle(532, -29.7998046875 , 5.8994140625, 5.8994140625) triggerServerEvent("onVehicleRide", hitElement, vehicle) end end ) Server-side addEvent("onVehicleRide", true) addEventHandler("onVehicleRide", root, function(vehicle) warpPedIntoVehicle(source, vehicle) end ) Link to comment
Tete omar Posted June 2, 2012 Author Share Posted June 2, 2012 Client-side local marker = createMarker(-28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255) addEventHandler("onClientMarkerHit", marker, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" then guiSetVisible(GUIEditor_Window[2], true) showCursor(true) end end ) addEventHandler("onClientResourceStart", root, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Grid = {} GUIEditor_Window[2] = guiCreateWindow(18, 307, 367, 431, "", false) guiSetAlpha(GUIEditor_Window[2], 1) guiWindowSetSizable(GUIEditor_Window[2], false) GUIEditor_Button[3] = guiCreateButton(22, 377, 88, 42, "Work", false, GUIEditor_Window[2]) GUIEditor_Button[4] = guiCreateButton(246, 383, 86, 39, "Exit", false, GUIEditor_Window[2]) GUIEditor_Memo[2] = guiCreateMemo(16, 32, 339, 216, "=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====", false, GUIEditor_Window[2]) guiMemoSetReadOnly(GUIEditor_Memo[2], true) guiSetVisible(GUIEditor_Window[2], false) local skins = { { "Farmer", 158 }, { "Farmer Redneck", 159 }, { "Farmer Girl", 157 } } GUIEditor_Grid[1] = guiCreateGridList(12, 260, 346, 79, false, GUIEditor_Window[2]) guiGridListAddColumn(GUIEditor_Grid[1], "Select your skin", 0.2) for index,skin in ipairs(skins) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, 1, skin[1], false, false) guiGridListSetItemData(GUIEditor_Grid[1], row, 1, skin[2]) end end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[4] then guiSetVisible(GUIEditor_Window[2], false) guiSetInputEnabled(false) showCursor(false) elseif source == GUIEditor_Button[8] then guiSetVisible(GUIEditor_Window[2], false) guiSetInputEnabled(false) showCursor(false) end end, false ) addEventHandler("onClientMarkerHit", marker, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" then local vehicle = createVehicle(532, -29.7998046875 , 5.8994140625, 5.8994140625) triggerServerEvent("onVehicleRide", hitElement, vehicle) end end ) Server-side addEvent("onVehicleRide", true) addEventHandler("onVehicleRide", root, function(vehicle) warpPedIntoVehicle(source, vehicle) end ) it still don't work no error but nothing happened .. Link to comment
Kenix Posted June 3, 2012 Share Posted June 3, 2012 Debug by hand via functions outputChatBox outputDebugString 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