..:D&G:.. Posted March 10, 2013 Author Share Posted March 10, 2013 Whats the function for spawning a train? Or to spawn a train and the player in it? Link to comment
PaiN^ Posted March 10, 2013 Share Posted March 10, 2013 You can use setElementPosition .. Link to comment
..:D&G:.. Posted March 20, 2013 Author Share Posted March 20, 2013 Hm... for whatever reason when a player enters the marker, the GUI appear to every player from the server. Link to comment
iPrestege Posted March 20, 2013 Share Posted March 20, 2013 Hm... for whatever reason when a player enters the marker, the GUI appear to every player from the server. Show me the code . Link to comment
..:D&G:.. Posted March 28, 2013 Author Share Posted March 28, 2013 --SERVER local jobMarker = createMarker (1942.57, 2184.79, 9.82, "cylinder", 1, 255, 0, 0, 127) local team = createTeam ( "Conductori de Locomotiva",255,255,0 ); addEventHandler ("onMarkerHit", jobMarker, function (hitPlayer) if (getElementType(hitPlayer) == "player") then triggerClientEvent ("viewGUI",source) outputChatBox ("Bun venit la gara Romana CFR.", hitPlayer, 255, 0, 0) end end ) addEvent("onAskToSetTeamAndSkin",true); addEventHandler("onAskToSetTeamAndSkin",root, function () spawnPlayer(source,-1937.09765625, 161.8310546875, 26.273441314697,0,61,0,0,team); end ); --CLIENT GUIEditor = { memo = {}, button = {}, window = {}, radiobutton = {}, tab = {}, label = {}, tabpanel = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(684, 215, 491, 334, "CFR - Sofer De Tren", false) guiSetVisible ( GUIEditor.window[1], false ) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.75) GUIEditor.button[1] = guiCreateButton(52, 169, 136, 65, "Angajeaza-te", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(299, 169, 136, 65, "Demisioneaza", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.button[3] = guiCreateButton(299, 259, 136, 65, "Închide", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") GUIEditor.memo[1] = guiCreateMemo(206, 180, 76, 85, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(252, 119, 70, 54, "", false, GUIEditor.window[1]) GUIEditor.memo[2] = guiCreateMemo(46, 35, 393, 124, " Bun venit la gara CFR!\nCautamt conductori de locomotiva, tot ce trebuie sa faci este sa conduci trenul si sa iei pasageri. Ia o colomotiva, o poti gasii pe sine, si incepeti slujba.\n\n Mult Succes!", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.tabpanel[1] = guiCreateTabPanel(178, 196, 60, 57, false, GUIEditor.memo[2]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) GUIEditor.radiobutton[1] = guiCreateRadioButton(191, 271, 75, 44, "", false, GUIEditor.window[1]) guiRadioButtonSetSelected(GUIEditor.radiobutton[1], true) end ) addEvent ("viewGUI", true) addEventHandler( "viewGUI" , root, function () guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) end ) addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor.button[3] ) then guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end ) addEventHandler("onClientGUIClick",GUIEditor.button[1], function () triggerServerEvent("onAskToSetTeamAndSkin",localPlayer); end ); Sorry for the late post, but I had a virus and I had to reinstall my windows. PS: I am a bit scared that people will steal the code, what can I do to protect it? Link to comment
golanu21 Posted March 28, 2013 Share Posted March 28, 2013 why you put the addEventHandler ("onMarkerHit", jobMarker, function (hitPlayer) if (getElementType(hitPlayer) == "player") then triggerClientEvent ("viewGUI",source) outputChatBox ("Bun venit la gara Romana CFR.", hitPlayer, 255, 0, 0) end end ) in the serverside,, put it in the clientside , and you wil be discard the triggerClientEvent Link to comment
golanu21 Posted March 28, 2013 Share Posted March 28, 2013 clientside GUIEditor = { memo = {}, button = {}, window = {}, radiobutton = {}, tab = {}, label = {}, tabpanel = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(684, 215, 491, 334, "CFR - Sofer De Tren", false) guiSetVisible ( GUIEditor.window[1], false ) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.75) GUIEditor.button[1] = guiCreateButton(52, 169, 136, 65, "Angajeaza-te", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(299, 169, 136, 65, "Demisioneaza", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.button[3] = guiCreateButton(299, 259, 136, 65, "Închide", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") GUIEditor.memo[1] = guiCreateMemo(206, 180, 76, 85, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(252, 119, 70, 54, "", false, GUIEditor.window[1]) GUIEditor.memo[2] = guiCreateMemo(46, 35, 393, 124, " Bun venit la gara CFR!\nCautamt conductori de locomotiva, tot ce trebuie sa faci este sa conduci trenul si sa iei pasageri. Ia o colomotiva, o poti gasii pe sine, si incepeti slujba.\n\n Mult Succes!", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.tabpanel[1] = guiCreateTabPanel(178, 196, 60, 57, false, GUIEditor.memo[2]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) GUIEditor.radiobutton[1] = guiCreateRadioButton(191, 271, 75, 44, "", false, GUIEditor.window[1]) guiRadioButtonSetSelected(GUIEditor.radiobutton[1], true) end ) local jobMarker = createMarker (1942.57, 2184.79, 9.82, "cylinder", 1, 255, 0, 0, 127) addEventHandler ("onMarkerHit", jobMarker, function (hitPlayer) if (getElementType(hitPlayer) == "player") then outputChatBox ("Bun venit la gara Romana CFR.", hitPlayer, 255, 0, 0) guiSetVisible ( GUIEditor.window[1], true ) howCursor ( true ) end end ) addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor.button[3] ) then guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end ) addEventHandler("onClientGUIClick",GUIEditor.button[1], function () triggerServerEvent("onAskToSetTeamAndSkin",localPlayer); end ); serverside local jobMarker = createMarker (1942.57, 2184.79, 9.82, "cylinder", 1, 255, 0, 0, 127) local team = createTeam ( "Conductori de Locomotiva",255,255,0 ); addEvent("onAskToSetTeamAndSkin",true); addEventHandler("onAskToSetTeamAndSkin",root, function () spawnPlayer(source,-1937.09765625, 161.8310546875, 26.273441314697,0,61,0,0,team); end ); Link to comment
..:D&G:.. Posted March 30, 2013 Author Share Posted March 30, 2013 Ok, now how to I make check points, and when the train driver goes in it, it should disappear and the next one should pop up, and when the driver hits a check point he needs to get an ammout of money. 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