Jump to content

amm2100

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by amm2100

  1. if this ^ didn't work .. try this client side: local myMarker = createMarker( 1543.4465332031, -1724.4774169922, 12.546875 , "cylinder", 2.0, 250, 250, 250, 200, getRootElement() ) function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then outputChatBox ( getPlayerName(hitPlayer) .. " Entered a Died Marker" ) end end function createSpawnWindow(hitPlayer) if (hitPlayer == localPlayer) then windowSpawncar = guiCreateWindow(0.36, 0.70, 0.26, 0.29, "", true) guiWindowSetSizable(windowSpawncar, false) btnSancheZ = guiCreateButton(0.05, 0.12, 0.87, 0.14, "1: Sanchez", true, windowSpawncar) local font0_PetitFormalScript = guiCreateFont(":spawnscar/fonts/PetitFormalScript.ttf", 10) guiSetFont(btnSancheZ, font0_PetitFormalScript) guiSetProperty(btnSancheZ, "NormalTextColour", "FFFFFFFF") btnVoodoo = guiCreateButton(0.05, 0.39, 0.87, 0.14, "2: Voodoo", true, windowSpawncar) guiSetFont(btnVoodoo, font0_PetitFormalScript) guiSetProperty(btnVoodoo, "NormalTextColour", "FFFFFFFF") btnCaddy = guiCreateButton(0.06, 0.67, 0.86, 0.14, "3: Caddy", true, windowSpawncar) guiSetFont(btnCaddy, font0_PetitFormalScript) guiSetProperty(btnCaddy, "NormalTextColour", "FFFFFFFF") guiSetVisible( windowSpawncar, true ) addEventHandler( "onClientGUIClick",resourceRoot, function () if ( source == btnSancheZ ) then triggerServerEvent("createSANCHEZ",localPlayer) end end) end end function markerLeave( localPlayer ) guiSetVisible( windowSpawncar, false) end addEventHandler ( "onClientMarkerHit",myMarker, MarkerHit ) addEventHandler( "onClientMarkerHit",myMarker, createSpawnWindow) addEventHandler ( "onClientMarkerLeave",myMarker,markerLeave) server side: local vechical = {} function spawncar() if isElement(vechical[source]) then destroyElement(vechical[source]) end local x,y,z = getElementPosition(source) vechical[source] = createVehicle(468,x, y,z) warpPedIntoVehicle (source,vechical[source]) end addEvent("createSANCHEZ",true) addEventHandler("createSANCHEZ",root,spawncar) Finial it is working But , What is the different ?? , Only on Server Side ?
  2. Not Working I notice the TriggerServerEvent not working but I don't know why ?
  3. Can You explain More ?
  4. I tried to put an command for Admin only named Duty <right name="command.duty" access="true"></right> and I put it false to all (Default) <right name="command.duty" access="false"></right> but when I try to type the Command and test it no thing happen and I am sure the I am Admin , Notice there is not error on Console , duty command should set My team to Staff team
  5. local myMarker = createMarker( 1543.4465332031, -1724.4774169922, 12.546875 , "cylinder", 2.0, 250, 250, 250, 200, getRootElement() ) function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then outputChatBox ( getPlayerName(hitPlayer) .. " Entered a Died Marker" ) end end function createSpawnWindow(hitPlayer) if (hitPlayer == localPlayer) then windowSpawncar = guiCreateWindow(0.36, 0.70, 0.26, 0.29, "", true) guiWindowSetSizable(windowSpawncar, false) btnSancheZ = guiCreateButton(0.05, 0.12, 0.87, 0.14, "1: Sanchez", true, windowSpawncar) local font0_PetitFormalScript = guiCreateFont(":spawnscar/fonts/PetitFormalScript.ttf", 10) guiSetFont(btnSancheZ, font0_PetitFormalScript) guiSetProperty(btnSancheZ, "NormalTextColour", "FFFFFFFF") btnVoodoo = guiCreateButton(0.05, 0.39, 0.87, 0.14, "2: Voodoo", true, windowSpawncar) guiSetFont(btnVoodoo, font0_PetitFormalScript) guiSetProperty(btnVoodoo, "NormalTextColour", "FFFFFFFF") btnCaddy = guiCreateButton(0.06, 0.67, 0.86, 0.14, "3: Caddy", true, windowSpawncar) guiSetFont(btnCaddy, font0_PetitFormalScript) guiSetProperty(btnCaddy, "NormalTextColour", "FFFFFFFF") guiSetVisible( windowSpawncar, true ) addEventHandler( "onClientGUIClick", btnSancheZ, function ( ) if ( source == btnSancheZ ) then triggerServerEvent("createSANCHEZ", getRootElement()) end end, false ) end end function markerLeave( localPlayer ) guiSetVisible( windowSpawncar, false) end addEventHandler ( "onClientMarkerHit", myMarker, MarkerHit ) addEventHandler( "onClientMarkerHit", myMarker, createSpawnWindow) addEventHandler ( "onClientMarkerLeave", getRootElement(), markerLeave ) I change some of the Client Side But it still Doesn't Work the Button doesn't do anything
  6. Waring spawnscar\client\client.lua:26: Bad usage @ 'addEventHandler' ['onClientGUIClick' with this function is already handled]
  7. Can You Show me How to Put the Event on The Fuction ??
  8. Thank You very Much GTX
  9. I made an Small Script when the Player press btnSanchz , Sanchez will Spawn and He will warp on it Client Side Server Side but when I press BtnSanchez it doesn't work no thing happen and there is no Error on the Console
  10. local vechical = {} function spawncar( thePlayer ) if isElement(vechical[thePlayer]) then destroyElement( vechical[thePlayer] ) end local x,y,z = getElementPosition( thePlayer ) local vechical[thePlayer] = createVehicle( 468, x, y, z ) warpPedIntoVehicle ( thePlayer, vechical[thePlayer] ) end addCommandHandler( "create", spawncar) [01:16:42] SCRIPT ERROR: myserver\script.lua:85: unexpected symbol near '[' [01:16:42] ERROR: Loading script failed: myserver\script.lua:85: unexpected symbol near '['
  11. I make a Team Named Staff Team and I need to put SuperMan to that team only How can I do that ???
  12. I want when the Player Spawn another car , the 1st Car Destroy
  13. How can I toggle between Devmode True and False ?
  14. Can I show the Col Shape in The Map ?? (F11) How can I find my ColRectangle ?
  15. I stick with The Car with your Script
  16. function spawncar( thePlayer ) destroyElement( vechical ) local x,y,z = getElementPosition( thePlayer ) local vechical = createVehicle( 468, x, y, z ) warpPedIntoVehicle ( thePlayer, vechical ) attachElements( vehical, thePlayer ) local PlayerBike = getElementAttachedTo ( thePlayer ) for k,v in pairs(PlayerBike) do destroyElement( source ) end end addCommandHandler( "create", spawncar) I need when the player call the function again the 1st Vehicle Destroy 1st I try to destroy the vehicle 2nd I try to attach the vehicle to the player and then destroy all the Attached Element to PLayer But it doesn't work the vehicle didn't destroy and I got error on Console that the table have boolean
  17. function spawncar( thePlayer ) destroyElement( vechical ) local x,y,z = getElementPosition( thePlayer ) local vechical = createVehicle( 468, x, y, z ) -- Change Here warpPedIntoVehicle ( thePlayer, vechical ) end addCommandHandler( "create", spawncar) that Script will allow players when they type /create , Sanchez will create and they will warp in it if you need another Vehicle Change 468 to your Vehicle ID @ Change Here Comment Vehicle IDs https://wiki.multitheftauto.com/wiki/Vehicle_IDs wait Please I am making the Destroy
  18. Hey Guys 1st : I need to ask how can I make my markers on one group Example :- I have 18 Marker's around the SA Map and I need to put them all with one script in easy way 2nd: is there any way to make Script when I type /makemarker , It make marker cylinder on my position and named it Marker1 , Marker2, Marker3, ...... etc ----------------------------- Sorry for my Bad English and Sorry Because I am noob scriptwriter , I started Lua since 2015/7/7
  19. You should Put FPS Limit More FPS mean More Speed , I put max FPS in my Private Server 60 FPS
  20. Done , Thank You Calculador
  21. how to make it hide ??
×
×
  • Create New...