Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Need Help

    You'll have to make a table with all locations of the parking lot.
  2. Castillo

    Unas dudas

    @Alexs: Ese script es server-side, los jugadores no descargan estos scripts.
  3. Castillo

    Es Posible?

    El ejemplo de la wiki es muy facil, si no podes entender eso, pues te recomiendo que vuelvas a lo basico.
  4. Castillo

    Unas dudas

    Hay una funcion para obtener un jugador aleatorio. addEventHandler ( "onPlayerJoin", root, function ( ) local randomPlayer = getRandomPlayer ( ) local x, y, z, lx, ly, lz, wex, wey = getCameraMatrix( randomPlayer ) setCameraMatrix ( source, x, y, z, lx, ly, lz, wex, wey ) end )
  5. Castillo

    Unas dudas

    Pues eso es porque cuando el jugador entre, la camara se podran en si mismo.
  6. Castillo

    Es Posible?

    Eso no tiene el menor sentido, enserio, ni estas pensando en lo que haces o que?
  7. Try this: gateList = {} gateListMoveToX = {} gateListMoveToY = {} gateListMoveToZ = {} gateListMoveTorX = {} gateListMoveTorY = {} gateListMoveTorZ = {} shapes = {} team = {} temp = {} status = {} -- 0 = not moving. 1 = moving to open. 2 = moving to close function checkClass(hitElement, matchingDimension) if ( getElementType(hitElement) == "vehicle" ) then hitElement = getVehicleController(hitElement) end for i=0,#gateList do local name = getPlayerTeam ( hitElement ) and getTeamName ( getPlayerTeam ( hitElement ) ) or "None" if(name == false) then name = "false" end if ( name == team[i] or name == "true") then detection = isElementWithinColShape ( hitElement, shapes[i] ) if detection == true then move(i, false) end end end end function loadup(startedResource) gates = xmlLoadFile ( "gates.xml" ) count = xmlNodeGetChildren(gates) for i=1,#count do local gate = xmlFindChild ( gates, "gate", i-1 ) local attributes = xmlNodeGetAttributes ( gate ) for name,value in pairs ( attributes ) do temp["" .. name .. ""] = value end gateList[i] = createObject(temp["objectID"], temp["x"], temp["y"], temp["z"], temp["rx"], temp["ry"], temp["rz"]) gateListMoveToX[i] = temp["x2"] gateListMoveToY[i] = temp["y2"] gateListMoveToZ[i] = temp["z2"] gateListMoveTorX[i] = temp["rx2"] gateListMoveTorY[i] = temp["ry2"] gateListMoveTorZ[i] = temp["rz2"] outputDebugString("" .. temp["objectID"] .. "") shapes[i] = createColRectangle(temp["collisionx"], temp["collisionY"], temp["collisionZ"], temp["collisionSize"],temp["collisionSize"]) team[i] = temp["team"] setElementInterior(gateList[i], temp["interiorID"]) status[i] = 0 addEventHandler ( "onColShapeHit", shapes[i], checkClass ) end xmlUnloadFile ( gates ) end function move(gateIndex, rotate) -- 0 = not moving. 1 = moving to open. 2 = moving to close outputDebugString("moving..") x,y,z = getElementPosition(gateList[gateIndex]) rx,ry,rz = getObjectRotation(gateList[gateIndex]) if status[gateIndex] == 0 then moveObject ( gateList[gateIndex], 2000, gateListMoveToX[gateIndex], gateListMoveToY[gateIndex],gateListMoveToZ[gateIndex]) status[gateIndex] = 1 setTimer ( moveBack, 3000, 1,gateIndex, x,y,z,rx,ry,rz, raising ) end end function moveBack(index, x,y,z, raising) if status[index] == 1 then status[index] = 2 moveObject ( gateList[index], 2000, x,y,z, gateListMoveTorX[gateIndex],gateListMoveTorY[gateIndex],gateListMoveTorZ[gateIndex],rx,ry,rz ) setTimer ( resetTimer, 2000, 1, index ) end end function resetTimer(index) status[index] = 0 end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), loadup )
  8. Castillo

    Es Posible?

    triggerServerEvent envia datos desde el client side al server side.
  9. Castillo

    Es Posible?

    onClientGUIClick es un evento client side, y isObjectInACLGroup, aclGetGroup, spawnPlayer son funciones server side, tenes que usar triggerServerEvent.
  10. Vos me estas tomando el pelo? querias estudiar lo basico de MySQL y te di las funciones para hacerlo.
  11. dbConnect dbExec dbQuery dbPoll dbFree Clickea en cada funcion, tienen ejemplos.
  12. Works perfect, when I click on the ped, the ammunation window is appears.
  13. Apenas entendes los argumentos de las funciones, no te aconsejo intentar estudiar MySQL aun.
  14. You must save if it's his/her first time on a database system, could be account data, then check it when he/she logs in.
  15. @Kenix: I only fixed his script, I was going to use "pairs" instead of "ipairs", but I didn't.
  16. @Alexs_Steel: Eso no es una tabla, es una variable. Ademas tu script nunca funcionaria. Una tabla es esto: local table = { 411, 410, 308 } -- Una tabla con diferentes modelos de vehiculos. function Vehiculocrear ( ) createVehicle ( table[ math.random ( #table ) ], 0, 0, 5 ) -- Crea un vehiculo un modelo aleatorio de la tabla. end addEventHandler ( "onResourceStart",resourceRoot, Vehiculocrear )
  17. I've clicked the ped and I got a warning saying "Ammu_Window" doesn't exist, which is right. Post your whole code.
  18. You can use a lua table to save player weapons on wasted.
  19. http://lua-users.org/wiki/TablesTutorial
  20. local WeaponPed = createPed ( 29, 296.447265625, -40.435546875, 1001.515625 ) setElementInterior ( WeaponPed, 1 ) function hans_click ( button, state, absX, absY, wx, wy, wz, element ) if ( element and element == WeaponPed ) then guiSetVisible ( Ammu_Window, true ) end end addEventHandler ( "onClientClick", getRootElement(), hans_click )
  21. local guns = { [ 46 ] = 1, [ 25 ] = 2500, [ 22 ] = 2000 } -- Spawn Player on Plane function spawn ( prevA, curA, autoLogin ) spawnPlayer ( source, -302.70001220703, 1437.9000244141, 835.70001220703, math.random (0,288), 0, 0 ) fadeCamera ( source, true ) setCameraTarget ( source, source ) end addEventHandler( "onPlayerLogin", getRootElement(), spawn ) -- Respawn Player at Base addEventHandler( "onPlayerWasted", getRootElement( ), function ( ) setTimer ( spawnPlayer, 5000, 1, source, -343.27581787109, 1537.6356201172, 75.5626, 180 ) end ) addEventHandler ( "onPlayerSpawn", root, function ( ) for weapon, ammo in pairs ( guns ) do giveWeapon ( source, weapon, ammo ) end end )
  22. Castillo

    Unas dudas

    Eso es porque ni siquiera lees los argumentos de las funciones. local marker = createMarker ( 1056.31653, -2740.65942, 8.48407, "cylinder", 3, 255, 0, 0, 100 ) function markerHit ( hitPlayer ) if ( hitPlayer == localPlayer ) then fadeCamera ( true, 5 ) -- No require argumento de jugador. setCameraMatrix ( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316 ) -- No require argumento de jugador. end end addEventHandler ( "onClientMarkerHit", marker, markerHit )
×
×
  • Create New...