Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    gangs....

    Well, to start with, MTA doesn't have "gang" or "turf" functions, you gotta make everything yourself.
  2. Castillo

    Help

    I would say that "block" is nil, if you do tostring ( block ) it'll surely write "nil".
  3. Castillo

    solved

    I kinda thought it was wrong, but since I thought it was already tested I didn't try to change it.
  4. Castillo

    Help needed

    I wouldn't exactly recommend using onElementDataChange. If you are storing the data in element data, then you can make it easier with the event I gave you.
  5. We don't give support with leaked scripts. Topic locked.
  6. Castillo

    DELETE

    You mean remove the HEX colors from their nicks? addEventHandler ( "onPlayerJoin", root, function ( ) local oldName = getPlayerName ( source ) local newName = oldName:gsub ( "#%x%x%x%x%x%x", "" ) if string.find ( oldName, "#%x%x%x%x%x%x" ) then setPlayerName ( source, newName ) end end ) Server side script.
  7. local pickup = createPickup ( 2487.1398925781, -1667.7604980469, 13.34375, 3, 1273, 0 ) addEventHandler ( "onPickupHit", pickup, function ( player ) setElementData ( player,"used_pickup", true ) outputChatBox ( "Enter to buy /comprar", player ) end ) addCommandHandler ( "comprar", function ( player ) local detection = isElementWithinColShape ( player, getElementColShape ( pickup ) ) if getElementData ( player, "used_pickup" ) then takePlayerMoney ( player, 50 ) end end )
  8. Castillo

    Help

    Which line corresponds to the 1079 in the piece of code posted?
  9. Post the resource download link then.
  10. markers = { createMarker( -1620, 685, 6, "cylinder", 1.5, 0, 0, 255, 100), createMarker( 2242, 2450, 9.75, "cylinder", 1.5 , 0, 0, 255, 100), createMarker( 1555, -1675.5, 15.2, "cylinder", 1.5, 0, 0, 255, 100) } vehiclemarkers = { createMarker( 1556, -1612, 12.5, "cylinder", 1.5, 0, 0, 255, 100), createMarker( 1566, -1612, 12.5, "cylinder", 1.5, 0, 0, 255, 100) } LSPoliceBlip = createBlip( 1554, -1675, 15, 30, 2) SFPoliceBlip = createBlip( -1620, 685, 8, 30, 2) LVPoliceBlip = createBlip( 2242, 2450, 11, 30, 2) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, marker in ipairs ( markers ) do addEventHandler ( "onClientMarkerHit", marker, PoliceGUI ) end for _, marker in ipairs ( vehiclemarkers ) do addEventHandler ( "onClientMarkerHit", marker, vehiclegui ) end end ) function PoliceGUI (hitPlayer, matchingDimension ) if ( hitPlayer ~= localPlayer ) then return end if isPedInVehicle ( localPlayer ) then outputChatBox ( getPlayerName ( localPlayer ) .. ", you entered the Police-Job Marker", 255, 255, 0 ) else --Message that you enered the Marker outputChatBox ( getPlayerName(hitPlayer) .. ", you entered the Police-Job Marker", 255, 255, 0 ) --Window/GUI policeWindow = guiCreateWindow ( 0.25, 0.25, 0.4, 0.4, "Policejob", true ) --Tap Panel policePanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, policeWindow ) --Tab's policeMap = guiCreateTab( "Job Information", policePanel ) scriptinformation = guiCreateTab( "Script Information", policePanel ) --PoliceTab guiCreateLabel(0.02, 0.04, 0.94, 0.2, "Welcome to the Police Department", true, policeMap) guiCreateLabel(0.02, 0.08, 0.94, 0.92, "Press 'Accept' to accept the Job and get your Equipment", true, policeMap) guiCreateLabel(0.02, 0.12, 0.94, 0.92, "Press 'Exit' to close this gui and exit", true, policeMap) guiCreateLabel(0.065, 0.5, 0.94, 0.92, "Please choose a Skin:", true, policeMap) guiCreateStaticImage( 350, 75, 350, 175, "images/police-tape.png", false, policeMap ) LS = guiCreateRadioButton(50,200,100,16,"LS Skin",false, policeMap) guiRadioButtonSetSelected(LS,true) SF = guiCreateRadioButton(50,220,100,16,"SF Skin",false, policeMap) LV = guiCreateRadioButton(50,240,100,16,"LV Skin", false, policeMap) exitbutton = guiCreateButton( 0.5, 0.85, 0.2, 0.1, "Exit", true, policeMap ) acceptbutton = guiCreateButton( 0.1, 0.85, 0.2, 0.1, "Accept", true, policeMap ) showCursor ( true ) --ScriptInformationTab guiCreateLabel(0.02, 0.04, 0.94, 0.2, "This script is made by Alexander Wolf©", true, scriptinformation) guiCreateLabel(0.02, 0.08, 0.94, 0.2, "Do you like my script? Visit my Website alexwo.com/scripting for more!", true, scriptinformation) end end function wclose (state) if state == "left" then if source == exitbutton then guiSetVisible(policeWindow, false) showCursor(false) end end end addEventHandler("onClientGUIClick", getRootElement(), wclose) function acceptjob (state) if state == "left" then if source == acceptbutton then if(guiRadioButtonGetSelected(LS))then triggerServerEvent("giveEquipmentLS", getLocalPlayer(), thePlayer) guiSetVisible(policeWindow, false) showCursor(false) local acceptsound = playSound("sounds/accept.mp3") elseif(guiRadioButtonGetSelected(SF))then triggerServerEvent("giveEquipmentSF", getLocalPlayer(), thePlayer) guiSetVisible(policeWindow, false) showCursor(false) local acceptsound = playSound("sounds/accept.mp3") guiSetVisible(policeWindow, false) showCursor(false) elseif(guiRadioButtonGetSelected(LV))then triggerServerEvent("giveEquipmentLV", getLocalPlayer(), thePlayer) guiSetVisible(policeWindow, false) showCursor(false) local acceptsound = playSound("sounds/accept.mp3") end end end end addEventHandler("onClientGUIClick", getRootElement(), acceptjob) function vehiclegui (hitPlayer, matchingDimension ) if ( hitPlayer == localPlayer ) then -- This is required to make sure the player that hit the marker is the local player, because remote players also trigger this event. if isPedInVehicle ( localPlayer ) then outputChatBox ( getPlayerName ( localPlayer ) ..", you have to leave your vehicle!", 255, 255, 0 ) return end PoliceVehicleWindow = guiCreateWindow ( 0.25, 0.25, 0.4, 0.4, "Police Vehicles", true ) --Tap Panel PoliceVehiclePanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, PoliceVehicleWindow ) --Tab's PoliceVehicleMap = guiCreateTab( "Vehicle List", PoliceVehiclePanel ) --PoliceTab guiCreateLabel(0.02, 0.04, 0.94, 0.2, "Please choose a vehicle you want to spawn!", true, PoliceVehicleMap) --RadioButtons policecarls = guiCreateRadioButton(20,40,100,16,"Police Car LS",false, PoliceVehicleMap) guiRadioButtonSetSelected(policecarls,true) policecarsf = guiCreateRadioButton(20,60,100,16,"Police Car SF",false, PoliceVehicleMap) policecarlv = guiCreateRadioButton(20,80,100,16,"Police Car LV", false, PoliceVehicleMap) policeranger = guiCreateRadioButton(20,100,100,16,"Police Ranger", false, PoliceVehicleMap) hpv1000 = guiCreateRadioButton(20,120,100,16,"HPV1000", false, PoliceVehicleMap) --Buttons policevehicleexitbutton = guiCreateButton( 0.5, 0.85, 0.2, 0.1, "Exit", true, PoliceVehicleMap ) spawnbutton = guiCreateButton( 0.1, 0.85, 0.2, 0.1, "Spawn", true, PoliceVehicleMap ) --showCursor showCursor ( true ) end end function PoliceVehicleGUIclose (state) if state == "left" then if source == policevehicleexitbutton then guiSetVisible(PoliceVehicleWindow, false) showCursor(false) end end end addEventHandler("onClientGUIClick", getRootElement(), PoliceVehicleGUIclose) function spawnpolicevehicle (state) if state == "left" then if source == spawnbutton then if(guiRadioButtonGetSelected(policecarls))then triggerServerEvent("spawnpolicecarls", getLocalPlayer(), thePlayer) guiSetVisible(PoliceVehicleWindow, false) showCursor(false) local acceptsound = playSound("sounds/accept.mp3") elseif(guiRadioButtonGetSelected(policecarsf))then triggerServerEvent("spawnpolicecarsf", getLocalPlayer(), thePlayer) guiSetVisible(PoliceVehicleWindow, false) showCursor(false) local acceptsound = playSound("sounds/accept.mp3") guiSetVisible(PoliceVehicleWindow, false) showCursor(false) elseif(guiRadioButtonGetSelected(policecarlv))then triggerServerEvent("spawnpolicecarlv", getLocalPlayer(), thePlayer) guiSetVisible(PoliceVehicleWindow, false) showCursor(false) local acceptsound = playSound("sounds/accept.mp3") elseif(guiRadioButtonGetSelected(policeranger))then triggerServerEvent("spawnpoliceranger", getLocalPlayer(), thePlayer) guiSetVisible(PoliceVehicleWindow, false) showCursor(false) local acceptsound = playSound("sounds/accept.mp3") elseif(guiRadioButtonGetSelected(hpv1000))then triggerServerEvent("spawnhpv1000", getLocalPlayer(), thePlayer) guiSetVisible(PoliceVehicleWindow, false) showCursor(false) local acceptsound = playSound("sounds/accept.mp3") end end end end addEventHandler("onClientGUIClick", getRootElement(), spawnpolicevehicle)
  11. Eso es porque onResourceStart no tiene argumento de jugador, tenes que hacer un loop ( como te dije en el otro tema ).
  12. triggerClientEvent( getRootElement(), "unBlq", thePlayer) Ahi esta el problema, ponelo asi: triggerClientEvent ( thePlayer, "unBlq", thePlayer ) Y lo mismo en las otras lineas.
  13. Castillo

    Help needed

    You can use the event onClientElementDataChange to detect when the element data changes and then update the labels.
  14. Castillo

    Help needed

    addEvent ( "myEvent", true ) addEventHandler ( "myEvent", root, function ( win, dead ) guiSetText ( GUIEditor_label [ 2 ], " Wins:".. tostring ( win ) ) guiSetText ( GUIEditor_label [ 3 ], " Deaths:".. tostring ( dead ) ) end )
  15. Seria bueno que nos digas cual era el problema y como lo solucionaste.
  16. It depends on the shader, shaders are created by a script, you can create a function inside it to disable/enable it.
  17. Castillo

    Help needed

    Found the typo, in guiSetText you got "GUIEditor_Label" uppercase "L" in "Label", change it to "GUIEditor_label".
  18. Castillo

    Help needed

    That is the exact code?
  19. Castillo

    Help needed

    You said there was no errors in the debugscript, I guess you were wrong. Show me the GUI creation code.
  20. Castillo

    Help needed

    addEvent("myEvent",true) addEventHandler("myEvent",root, function(win, dead) guiSetText(GUIEditor_Label[2]," Wins:"..win) guiSetText(GUIEditor_Label[3]," Deaths:"..dead) outputChatBox ( "EVENT TRIGGERED!" ) end )
×
×
  • Create New...