Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Can you give the actual line number? because line 7 on my code is this line: if isPedInVehicle ( hitElement ) then which can't cause that error.
  2. Tendrias que crear una base de datos aparte, donde guardas cada cuanto con su serial, y al intentar registrar otra cuenta, verificas si ese serial ya fue usado o no. Te recomiendo usar SQLite.
  3. Well, maybe you should ask to whoever sold it to you?
  4. Well, you can use both. And add this to hide it when resource starts: addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do showPlayerHudComponent ( player, "crosshair", false ) end end )
  5. You want to change the interface of it?
  6. Try hiding it on spawn: addEventHandler ( "onPlayerSpawn", root, function ( ) showPlayerHudComponent ( source, "crosshair", false ) end )
  7. That won't work, because you are trying to get the occupied vehicle of a vehicle. local timeleft = 60 -- Seconds till robber escapes. local rmodel = 495 -- Robber vehicle ID. local pmodel = 599 -- Police vehicle ID. addEvent ( "onMapStarting", true ) addEventHandler ( "onMapStarting", root, function ( ) -- BLIP REMOVAL LOOP for i,v in ipairs(getElementsByType("player")) do local elements = getAttachedElements(v) for i,v in ipairs(elements) do if (getElementType(v) == "blip") then setElementVisibleTo(v, root, false) -- This temporary makes the blip invisable. end end end -- ASSIGNATION LOOP for i,v in ipairs(getElementsByType("player")) do local theVehicle = getPedOccupiedVehicle (v) if theVehicle then -- If the player is in a vehicle. if getElementModel(theVehicle) == tonumber(rmodel) then -- If it's the robber vehicle. robberblip = createBlipAttachedTo(theVehicle, 23) -- Creates a skull blip attached to the robber. elseif getElementModel(theVehicle) == tonumber(pmodel) then -- If it's the police vehicle. policeblip = createBlipAttachedTo(theVehicle, 30) -- Creates a siren blip attached to all cops. end end end setTimer( function() outputChatBox("Robber wins!", root, 255, 0, 0, true) for i, v in ipairs(getElementsByType("player")) do setElementHealth(v, 0) end end, timeleft*1000, 1 ) end ) addEvent ( "onPlayerRaceWasted", true ) addEventHandler("onPlayerRaceWasted", root, function ( theVehicle ) if isElement ( theVehicle ) then if getElementModel ( theVehicle ) == tonumber(rmodel) then for i, v in ipairs(getElementsByType("player")) do setElementHealth(v, 0) end outputChatBox("Cops win!", root, 255, 0, 0, true) end end end ) addEventHandler("onResourceStop", root, function() for i,v in ipairs(getElementsByType("player")) do local elements = getAttachedElements(v) for i,v in ipairs(elements) do if (getElementType(v) == "blip") then setElementVisibleTo(v, root, true) -- This makes the blip visable again. if isElement ( policeBlip ) then destroyElement(policeBlip) -- This destroys the temporary blip we made. end if isElement ( robberBlip ) then destroyElement(robberBlip) -- This destroys the temporary blip we made. end end end end end )
  8. Did you give the resource ACL permissions to create an ACL group?
  9. local col = createColCuboid ( 95.974617004395, 1751.3895263672, 17.640625, 255, 255, 255 ) local zone = createRadarArea ( 95.974617004395, 1751.3895263672, 255, 255, 255, 0, 0, 170 ) setElementData ( zone, "zombieProof", true ) function enterAdmin ( hitElement, matchingDimension ) if ( getElementType ( hitElement ) == "player" ) then if isPedInVehicle ( hitElement ) then setElementPosition ( getPedOccupiedVehicle ( hitElement ), 0, 0, 120 ) outputChatBox ( 'You can not enter the area with vehicle',hitElement, 255, 0, 0 ) return end local accName = getAccountName ( getPlayerAccount ( hitElement ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then toggleControl ( hitElement, "fire", true ) toggleControl ( hitElement, "aim_weapon", true ) toggleControl ( hitElement, "vehicle_fire", true ) outputChatBox ( "Welcome to Admin area", hitElement, 0, 170, 255 ) else outputChatBox ( "Access denied", hitElement, 255, 0, 0 ) setElementPosition ( hitElement, 0, 0, 120 ) end end end addEventHandler( "onColShapeHit", col, enterAdmin )
  10. SImply, hide the crosshair HUD part: addEventHandler ( "onPlayerJoin", root, function ( ) showPlayerHudComponent ( source, "crosshair", false ) end )
  11. No, ese es el que viene con el MTA y no es lo que el busca, es un simple mensaje en el chat. @ArciHack: Ese script del cual hablas lo crean los scripters del servidor, busca en la comunidad, capaz que alguien subio uno.
  12. Castillo

    login

    We don't give support with leaked scripts. Topic locked.
  13. Make sure the player is in a vehicle, that error is caused because is trying to get the element model from nothing.
  14. Busca la parte que solo remplaza la mira y borra el resto.
  15. Podes crear un colshape, y un spawnpoint de zombies dentro, luego en el meta.xml cambias el metodo de spawneo para que solo use spawnpoints, y al salir del colshape, que los mate.
  16. local timeleft = 60 -- Seconds till robber escapes. local rmodel = 495 -- Robber vehicle ID. local pmodel = 599 -- Police vehicle ID. addEvent ( "onMapStarting", true ) addEventHandler ( "onMapStarting", root, function ( ) -- BLIP REMOVAL LOOP for i,v in ipairs(getElementsByType("player")) do local elements = getAttachedElements(v) for i,v in ipairs(elements) do if (getElementType(v) == "blip") then setElementVisibleTo(v, root, false) -- This temporary makes the blip invisable. end end end -- ASSIGNATION LOOP for i,v in ipairs(getElementsByType("player")) do local theVehicle = getPedOccupiedVehicle (v) if theVehicle then -- If the player is in a vehicle. if getElementModel(theVehicle) == tonumber(rmodel) then -- If it's the robber vehicle. robberblip = createBlipAttachedTo(theVehicle, 23) -- Creates a skull blip attached to the robber. elseif getElementModel(theVehicle) == tonumber(pmodel) then -- If it's the police vehicle. policeblip = createBlipAttachedTo(theVehicle, 30) -- Creates a siren blip attached to all cops. end end end setTimer( function() outputChatBox("Robber wins!", root, 255, 0, 0, true) for i, v in ipairs(getElementsByType("player")) do setElementHealth(v, 0) end end, timeleft*1000, 1 ) end ) addEventHandler("onPlayerWasted", root, function() if getElementModel(getPedOccupiedVehicle(source)) == tonumber(rmodel) then for i, v in ipairs(getElementsByType("player")) do setElementHealth(v, 0) end outputChatBox("Cops win!", root, 255, 0, 0, true) end end ) addEventHandler("onResourceStop", root, function() for i,v in ipairs(getElementsByType("player")) do local elements = getAttachedElements(v) for i,v in ipairs(elements) do if (getElementType(v) == "blip") then setElementVisibleTo(v, root, true) -- This makes the blip visable again. if isElement ( policeBlip ) then destroyElement(policeBlip) -- This destroys the temporary blip we made. end if isElement ( robberBlip ) then destroyElement(robberBlip) -- This destroys the temporary blip we made. end end end end end )
  17. Fix what? I already fixed them, just copy that code.
  18. Si, se puede. createPickup setElementPosition onPickupHit
  19. Well, you can make a skin which will be bigger.
  20. Seriously? you obviously didn't check, because it has several. local timeleft = 60 -- Seconds till robber escapes. local rmodel = 495 -- Robber vehicle ID. local pmodel = 599 -- Police vehicle ID. addEvent ( "onMapStarting", true ) addEventHandler ( "onMapStarting", root, function ( ) -- BLIP REMOVAL LOOP for i,v in ipairs(getElementsByType("player")) do local elements = getAttachedElements(v) for i,v in ipairs(elements) do if (getElementType(v) == "blip") then setElementVisibleTo(v, root, false) -- This temporary makes the blip invisable. end end end -- ASSIGNATION LOOP for i,v in ipairs(getElementsByType("player")) do local theVehicle = getPedOccupiedVehicle (v) if theVehicle then -- If the player is in a vehicle. if getElementModel(theVehicle) == tonumber(rmodel) then -- If it's the robber vehicle. robberblip = createBlipAttachedTo(theVehicle, 23) -- Creates a skull blip attached to the robber. elseif getElementModel(theVehicle) == tonumber(pmodel) then -- If it's the police vehicle. policeblip = createBlipAttachedTo(theVehicle, 30) -- Creates a siren blip attached to all cops. end end end setTimer( function() outputChatBox("Robber wins!", root, 255, 0, 0, true) for i, v in ipairs(getElementsByType("player")) do setElementHealth(v, 0) end end, timeleft*1000, 1 ) end ) addEventHandler("onPlayerWasted", root, function() if getElementModel(getPedOccupiedVehicle(source)) == tonumber(rmodel) then for i, v in ipairs(getElementsByType("player")) do setElementHealth(v, 0) end outputChatBox("Cops win!", root, 255, 0, 0, true) end end ) addEventHandler("onResourceStop", root, function() for i,v in ipairs(getElementsByType("player")) do local elements = getAttachedElements(v) for i,v in ipairs(elements) do if (getElementType(v) == "blip") then setElementVisibleTo(v, root, true) -- This makes the blip visable again. destroyElement(policeBlip) -- This destroys the temporary blip we made. destroyElement(robberBlip) -- This destroys the temporary blip we made. end end end end )
  21. You can't do that, maybe with shaders, not sure.
  22. Is the script set as server side on the meta.xml?
×
×
  • Create New...