eAd Posted March 1, 2014 Share Posted March 1, 2014 repir this code cient GUIEditor = { gridlist = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(191, 82, 474, 427, "[PS] Cars System By Mostafa", false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 0.92) guiSetProperty(wnd, "CaptionColour", "FF788D6B") 1 = guiCreateButton(9, 19, 129, 79, "NGR-500", false, wnd) guiSetFont(1, "default-small") guiSetProperty(1, "NormalTextColour", "FF1A0AF4") 2 = guiCreateButton(9, 130, 129, 73, "Banshee", false, wnd) guiSetFont(2, "default-small") guiSetProperty(2, "NormalTextColour", "FF24F508") 3 = guiCreateButton(9, 258, 129, 70, "BMX", false, wnd) guiSetFont(3, "default-small") guiSetProperty(3, "NormalTextColour", "FFF92603") 5 = guiCreateButton(155, 20, 116, 78, "Alpha", false, wnd) guiSetFont(5, "default-small") guiSetProperty(5, "NormalTextColour", "FFC536C3") 6 = guiCreateButton(154, 139, 136, 64, "GTR-500", false, wnd) guiSetFont(6, "default-small") guiSetProperty(6, "NormalTextColour", "FF1909F1") 7 = guiCreateButton(164, 266, 136, 62, "Bobcat", false, wnd) guiSetFont(7, "default-small") guiSetProperty(7, "NormalTextColour", "FF05DBF4") GUIEditor.memo[1] = guiCreateMemo(12, 334, 298, 83, "New Cars In GridList \n\n,Mostafa [PS]\n\nUpdate : Add Yamaha R1", false, wnd) GUIEditor.gridlist[1] = guiCreateGridList(319, 24, 145, 393, false, wnd) guiGridListAddColumn(GUIEditor.gridlist[1], "New Cars", 0.9) for i = 1, 4 do guiGridListAddRow(GUIEditor.gridlist[1]) end guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "BMW|SOON", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Ferari|SOON", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "PS Car| SOON", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "Yamaha R1 ", false, false) end ) addEventHandler ( 'onClientGUIClick', resourceRoot, function( ) if ( source == 1) then triggerServerEvent ( 'car1', localPlayer ) end end ) addEventHandler ( 'onClientGUIClick', resourceRoot, function( ) if ( source == 2) then triggerServerEvent ( 'car2', localPlayer ) end end ) addEventHandler ( 'onClientGUIClick', resourceRoot, function( ) if ( source == 3) then triggerServerEvent ( 'car3', localPlayer ) end end ) addEventHandler ( 'onClientGUIClick', resourceRoot, function( ) if ( source == 4) then triggerServerEvent ( 'car4', localPlayer ) end end ) addEventHandler ( 'onClientGUIClick', resourceRoot, function( ) if ( source == 5]) then triggerServerEvent ( 'car5', localPlayer ) end end ) addEventHandler ( 'onClientGUIClick', resourceRoot, function( ) if ( source == 6) then triggerServerEvent ( 'car6', localPlayer ) end end ) addEventHandler ( 'onClientGUIClick', resourceRoot, function( ) if ( source == 7) then triggerServerEvent ( 'car7', localPlayer ) end end ) local marker = createMarker(x,y,z ) addEventHandler('onClientMarkerHit',marker,function (plr) if plr == localPlayer then guiSetVisible(GUIEditor.button,true) end end ) Server local vehicle = {} addEvent( 'car', true ) addEventHandler( 'car1', root,function() local x, y, z = getElementPosition ( source ) if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end vehicle[source] = createVehicle ( 431, x, y, z + 10 ) outputChatBox ( "Car Spwan!", source) end ) local vehicle = {} addEvent( 'car2', true ) addEventHandler( 'car', root,function() local x, y, z = getElementPosition ( source ) if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end vehicle[source] = createVehicle ( 432, x, y, z + 10 ) outputChatBox ( "Car Spwan!", source) end ) local vehicle = {} addEvent( 'car3', true ) addEventHandler( 'car', root,function() local x, y, z = getElementPosition ( source ) if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end vehicle[source] = createVehicle ( 434, x, y, z + 10 ) outputChatBox ( "Car Spwan!", source) end ) local vehicle = {} addEvent( 'car4', true ) addEventHandler( 'car', root,function() local x, y, z = getElementPosition ( source ) if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end vehicle[source] = createVehicle ( 421, x, y, z + 10 ) outputChatBox ( "Car Spwan!", source) end ) local vehicle = {} addEvent( 'car5', true ) addEventHandler( 'car', root,function() local x, y, z = getElementPosition ( source ) if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end vehicle[source] = createVehicle ( 132, x, y, z + 10 ) outputChatBox ( "Car Spwan!", source) end ) local vehicle = {} addEvent( 'car6', true ) addEventHandler( 'car', root,function() local x, y, z = getElementPosition ( source ) if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end vehicle[source] = createVehicle ( 232, x, y, z + 10 ) outputChatBox ( "Car Spwan!", source) end ) local vehicle = {} addEvent( 'car7', true ) addEventHandler( 'car', root,function() local x, y, z = getElementPosition ( source ) if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end vehicle[source] = createVehicle ( 442, x, y, z + 10 ) outputChatBox ( "Car Spwan!", source) end ) Link to comment
Karuzo Posted March 1, 2014 Share Posted March 1, 2014 repir this code No. You could say what's the error at least. Link to comment
Karuzo Posted March 1, 2014 Share Posted March 1, 2014 lol. Try to type in the Console debugscript 3 as Administrator. And than tell us what it says please. Link to comment
eAd Posted March 1, 2014 Author Share Posted March 1, 2014 i want help you are look proplem in code ? Link to comment
Moderators Citizen Posted March 1, 2014 Moderators Share Posted March 1, 2014 repir this code Come on slaves ! We can help this nice gentleman ! Haha, you are really funny. You made my day thanks Link to comment
Hell-Mate Posted March 2, 2014 Share Posted March 2, 2014 Can you please post the errors which the console output ? just to know which line we should fix Link to comment
eAd Posted March 2, 2014 Author Share Posted March 2, 2014 I dont know Look to code and repier plz Link to comment
WhoAmI Posted March 2, 2014 Share Posted March 2, 2014 This guy is hilarious! Type /debugscript 3 in chat and show us error. Link to comment
eAd Posted March 2, 2014 Author Share Posted March 2, 2014 deebugscript Spwan Eror Trigger Eror if source button error .. And no marker ! Link to comment
Mr_Moose Posted March 2, 2014 Share Posted March 2, 2014 Look at the code again and you'll find the most obvious issues in it, first one is in the server where you define: local vehicle = {} 7 times, data variables should only be defined once. The next issue is the usage of source on the server which sometimes passes the wrong player from the client, use "client" instead. Issue 3, mixing of the event handlers both on server and client, why not write: addEvent( 'car5', true ) addEventHandler( 'car5', root,function() instead of: addEvent( 'car5', true ) addEventHandler( 'car', root,function() And most hilarious parts, why are you creating the same function 7 times, it only need to be created once with different arguments, applies both for client and server btw. There you go Link to comment
eAd Posted March 2, 2014 Author Share Posted March 2, 2014 deebugscriptSpwan Eror Trigger Eror if source button error .. And no marker ! Link to comment
WhoAmI Posted March 2, 2014 Share Posted March 2, 2014 We want to know what EXACTLY the errors are. Link to comment
Thorxx Posted March 2, 2014 Share Posted March 2, 2014 How can we help you if we don't see the errors? Link to comment
eAd Posted March 2, 2014 Author Share Posted March 2, 2014 deebugscriptSpwan Eror Trigger Eror if source button error .. And no marker ! This Errors Link to comment
Thorxx Posted March 2, 2014 Share Posted March 2, 2014 We want to know what EXACTLY the errors are! Link to comment
eAd Posted March 2, 2014 Author Share Posted March 2, 2014 We want to know what EXACTLY the errors are! This is EXACTLY Link to comment
Thorxx Posted March 2, 2014 Share Posted March 2, 2014 It is not exactly since you didn't write everything about the errors. Link to comment
eAd Posted March 2, 2014 Author Share Posted March 2, 2014 I dont have server now Can you Past code and test code and repirt Plzz Link to comment
Thorxx Posted March 2, 2014 Share Posted March 2, 2014 I dont have server now This is the worst lie that you can ever write! You can start your own server by using the server files provided by MTA:SA. MTA\server\MTA Server.exe Link to comment
eAd Posted March 2, 2014 Author Share Posted March 2, 2014 Bi know but is error in make local server Plzz repier my code Car system Link to comment
Recommended Posts