illestiraqi Posted February 28, 2013 Posted February 28, 2013 In this script the vehicles dont spawn, all it does is show names of vehicles and just shows there in a gui please help I'm not sure if this is Client or Server side I tried client. markers = { createMarker ( 308, 1813, 17, 'cylinder', 1.5, 255, 0, 0, 255 ), createMarker ( 318, 1813, 17, 'cylinder', 1.5, 255, 0, 0, 255 ) } local vehicles = { "Patriot", "Sanchez", "Barracks", "Hydraa", "Hunter" } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, marker in ipairs ( markers ) do addEventHandler ( "onClientMarkerHit", marker, onMarkerHit ) addEventHandler ( "onClientMarkerLeave", marker, onMarkerLeave ) end end ) function createVehGui ( ) MainGui = guiCreateWindow(408,203,240,349,"Spawn bike",false) guiWindowSetSizable ( MainGui, false ) VehGrid = guiCreateGridList(14,32,180,256,false,MainGui) guiGridListSetSelectionMode(VehGrid,2) _bikes = guiGridListAddColumn(VehGrid,"Bikes",0.85) Spawn = guiCreateButton(15,305,96,35,"Spawn",false,MainGui) guiSetFont(Spawn,"clear-normal") Cancel = guiCreateButton(128,305,96,35,"Cancel",false,MainGui) guiSetFont(Cancel,"clear-normal") for index, vehicle in ipairs(vehicles) do local row = guiGridListAddRow (VehGrid) guiGridListSetItemText ( VehGrid, row, _bikes, tostring(vehicle), false, false ) end end function onMarkerHit ( hitElement ) if ( hitElement == localPlayer ) then createVehGui ( hitElement ) if ( MainGui ~= nil ) then guiSetVisible ( MainGui, true ) showCursor ( true ) guiSetInputEnabled ( true ) setElementFrozen ( hitElement, true ) end end end addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == Spawn ) then local row,col = guiGridListGetSelectedItem ( VehGrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local vehicleName = guiGridListGetItemText(VehGrid, row, 1) if vehicleName == "Patriot" then triggerServerEvent("spawnPatriot",localPlayer,vehicleName) elseif vehicleName == "Sanchez" then triggerServerEvent("spawnSanchez",localPlayer,vehicleName) elseif vehicleName == "Barracks" then triggerServerEvent("spawnBarracks",localPlayer, vehicleName) elseif vehicleName == "Hydraa" then triggerServerEvent("spawnHydraa",localPlayer, vehicleName) elseif vehicleName == "Hunter" then triggerServerEvent("spawnHunter",localPlayer, vehicleName) end else outputChatBox("Error: Please, select a vehicle of list.",255,0,0) end elseif (source == Cancel) then triggerEvent("closeWindow", localPlayer ) end end ) addEventHandler("onClientGUIDoubleClick", root, function () if ( source == VehGrid ) then local row,col = guiGridListGetSelectedItem(VehGrid) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(VehGrid, row, vehicleName) if vehicleName == "Patriot" then triggerServerEvent("spawnPatriot",localPlayer,vehicleName) elseif vehicleName == "Sanchez" then triggerServerEvent("spawnSanchez",localPlayer, vehicleName) elseif vehicleName == "Barracks" then triggerServerEvent("spawnBarracks",localPlayer, vehicleName) elseif vehicleName == "Hydraa" then triggerServerEvent("spawnHydraa",localPlayer, vehicleName) elseif vehicleName == "Hunter" then triggerServerEvent("spawnHunter",localPlayer, vehicleName) end end end end ) function onMarkerLeave ( leaveElement ) if ( leaveElement == localPlayer ) then triggerEvent("closeWindow", localPlayer ) end end addEvent ( "closeWindow", true ) addEventHandler ( "closeWindow", root, function ( ) guiSetVisible ( MainGui, false ) showCursor ( false ) guiSetInputEnabled ( false ) setElementFrozen ( localPlayer, false ) end )
Castillo Posted February 28, 2013 Posted February 28, 2013 Do you get any error? That script is client side, but also requires a server side, you have one, right? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
illestiraqi Posted March 1, 2013 Author Posted March 1, 2013 Do you get any error?That script is client side, but also requires a server side, you have one, right? No. Lol
Castillo Posted March 1, 2013 Posted March 1, 2013 You don't get any error or you don't have a server side? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Fury Posted March 1, 2013 Posted March 1, 2013 You don't get any error or you don't have a server side? im sure he steal it from some server. he doesnt have any server-side.. I'm not sure if this is Client or Server side I tried client. Destruction Derby
illestiraqi Posted March 2, 2013 Author Posted March 2, 2013 So can anyone help me with Server side code?
DNL291 Posted March 2, 2013 Posted March 2, 2013 So show the server side code. Please do not PM me with scripting related question nor support, use the forums instead.
X-SHADOW Posted March 5, 2013 Posted March 5, 2013 addEventHandler('onClientResourceStart', root , function( uPlayer ) if(getPlayerName(uPlayer ) == 'illestiraqi ' ) then outputChatBox('Warning : Thief Has Been Detected !',255, 255, 0 ) end end ) My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
TAPL Posted March 5, 2013 Posted March 5, 2013 addEventHandler('onClientResourceStart', root , function( uPlayer ) if(getPlayerName(uPlayer ) == 'illestiraqi ' ) then outputChatBox('Warning : Thief Has Been Detected !',255, 255, 0 ) end end ) https://wiki.multitheftauto.com/wiki/On ... ourceStart Parameters resource startedResource startedResource: the resource that was started.
illestiraqi Posted March 5, 2013 Author Posted March 5, 2013 addEventHandler('onClientResourceStart', root , function( uPlayer ) if(getPlayerName(uPlayer ) == 'illestiraqi ' ) then outputChatBox('Warning : Thief Has Been Detected !',255, 255, 0 ) end end ) Uhm excuse me if your going to be trolling than get out of this section because atm your acting like a noob. Im just a beginner and people are always rude, like geez i can never have nice people to help me out.
X-SHADOW Posted March 5, 2013 Posted March 5, 2013 excuse me your the one have clinet side and cant make a server side ? are You Kiding Me? i can make you the server side if you got the rights form the owner . My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
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