Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That's because you set your scripts as server side, but GUI is client side only. There, type="server" must be type="client" ( only for the GUI scripts of course ).
  2. have you checked if he created the script? he may have had the same idea Of course I'd, it's the same as the abseil resource. Edit: Vehicle mod: https://community.multitheftauto.com/ind ... ls&id=4870
  3. Topic moved to "Resources" section.
  4. Castillo

    my Ban test

    Because the second argument is the responsible element that kicked the player. function banThatPlayer ( thePlayer, command, tPlayer, ... ) local reason = table.concat ( { ... }, " " ) local tPlayer = getPlayerFromName ( tPlayer ) setAccountData ( getPlayerAccount( tPlayer ), "BannedReason", reason ) setAccountData ( getPlayerAccount( tPlayer ), "Occupation", "Banned" ) kickPlayer ( tPlayer, thePlayer, "banned" ) end addCommandHandler ( "blazyban", banThatPlayer ) Why does it say "Banned" if it's just a kick?
  5. Where is "point" defined at?
  6. Stolen: https://community.multitheftauto.com/ind ... ls&id=4862 Original: https://community.multitheftauto.com/ind ... ls&id=1873
  7. Tenes que usar el event: onClientGUIChanged, verificas si el tipo de texto es un numero, si no, borras todo el texto y le envias un mensaje.
  8. door = createObject ( 8948, -597.79998779297, -476.89999389648, 26.299999237061, 0, 0, 0 ) colShape = createColTube ( -598.87946, -476.85843, 24.51785, 5, 3.5 ) skins = { [ 124 ] = true, [ 125 ] = true, [ 126 ] = true, [ 163 ] = true, [ 164 ] = true, [ 292 ] = true, [ 293 ] = true, [ 294 ] = true } addEventHandler ( "onColShapeHit", colShape, function ( hitElement ) if ( getElementType ( hitElement ) == "player" ) or ( getElementType ( hitElement ) == "vehicle" ) then if ( skins [ getElementModel ( hitElement ) ] ) then moveObject ( door, 2000, -597.79998779297, -476.89999389648, 22.700000762939, 0, 0, 0 ) outputChatBox ( "Welcome ".. getPlayerName ( hitElement ), hitElement ) end end end ) addEventHandler ( "onColShapeLeave", colShape, function ( leaveElement ) if ( getElementType ( leaveElement ) == "player" ) or ( getElementType ( leaveElement ) == "vehicle" ) then if ( skins [ getElementModel ( leaveElement ) ] ) then moveObject ( door, 2000, -597.79998779297, -476.89999389648, 26.299999237061, 0, 0, 0 ) outputChatBox ( "Cya ".. getPlayerName ( leaveElement ), leaveElement ) end end end ) Problems: 1: Your colshape was wrong, you should have used a col tube instead. 2: You forgot to define the moveTime argument @ moveObject.
  9. Usa triggerClientEvent en el lado del server side y en el client side creas el evento.
  10. Agree with Alpha, players keep's changing their names, to add Tags and so on. This would be useless and annoying for most people.
  11. Tu variable se llama "levelexp" pero vos estas usando "level".
  12. Castillo

    Funcionaria?

    No se puede cancelar ese evento, tenes que cancelar el onClientPlayerDamage. function casigod ( attacker, weapon, bodypart, loss ) if ( attacker ) and ( getElementType ( attacker ) == "player" ) or ( getElementType ( attacker ) == "vehicle" ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerDamage", localPlayer, casigod )
  13. No existen funciones basicas de un game mode en mi opinion, porque cada uno lo hace como quiere o sabe.
  14. addEvent ( "spawnVehicle", true ) addEventHandler ( "spawnVehicle", root, function ( vehID ) if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( vehID, getElementPosition ( source ) ) if ( vehicles [ source ] ) then -- What is "sultan"?? your vehicle element is: vehicles [ source ] setVehicleColor ( vehicles [ source ], 6, 183, 248 ) -- Here goes the vehicle element, not a string. end setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) triggerClientEvent ( source, "closeWindow", root ) end )
  15. You're welcome. P.S: There's no need to lock the topic, someone else may have the same problem.
  16. You have to use getElementData. for i,marker in ipairs ( markers ) do addEventHandler ( "onClientMarkerHit", marker, function ( hitElement ) if ( hitElement == localPlayer ) then if ( getElementData ( hitElement, "Occupation" ) == "Medic" ) then createVehGui ( hitElement ) if ( MainGui ~= nil ) then guiSetVisible ( MainGui, true ) showCursor ( true ) guiSetInputEnabled ( true ) setElementFrozen ( hitElement, true ) end end end end ) end
  17. What you copied: local skins { { "Farmer", 158 }, { "Farmer Redneck", 159 }, { "Farmer Girl", 157 } } What I wrote: local skins = -- Create a table with our skin names and their ID's. { { "Farmer", 158 }, { "Farmer Redneck", 159 }, { "Farmer Girl", 157 } } Read both and find out what is missing.
  18. 1: You give us a image which the size doesn't let us read. 2: You give us ONE line of code. 3: Nothing makes sense. Do you really expect us to get something out of this?
  19. local x, y, z = 0, 0, 10 -- Camera position local rotation = 0 -- Camera rotation local height = math.rad ( 1 ) -- height local distance = 19 -- default distance from the player function renderCameraRotation ( ) rotation = ( rotation + 0.5 ) if ( rotation >= 360 ) then rotation = 0 end local angle = math.rad ( rotation ) local camX = ( x + 3 * distance * math.cos ( angle ) * math.cos ( height ) ) local camY = ( y + 3 * distance * math.sin ( angle ) * math.cos ( height ) ) local camZ = ( z + 0.4 * distance + 2 * distance * math.sin ( height ) ) local hit, hitX, hitY, hitZ = processLineOfSight ( x, y, z, camX, camY, camZ, false, false, false ) if ( hit ) then camX, camY, camZ = ( x + 0.9 * ( hitX - x ) ), ( y + 0.9 * ( hitY - y ) ), ( z + 0.9 * ( hitZ - z ) ) end setCameraMatrix ( camX, camY, camZ, x, y, z ) end addEventHandler ( "onClientPreRender", root, renderCameraRotation )
  20. local skins = -- Create a table with our skin names and their ID's. { { "Farmer", 158 }, { "Farmer Redneck", 159 }, { "Farmer Girl", 157 } } GUIEditor_Grid[1] = guiCreateGridList(12,260,346,79,false,GUIEditor_Window[1]) guiGridListAddColumn(GUIEditor_Grid[1],"Select your skin",0.2) for index, skin in ipairs ( skins ) do -- Loop through our "skins" table. local row = guiGridListAddRow ( GUIEditor_Grid[1] ) -- Add a row for every item in the table. guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, skin [ 1 ], false, false ) -- Set the item text to the first value of our table. guiGridListSetItemData ( GUIEditor_Grid[1], row, 1, skin [ 2 ] ) -- Set the item data to the second value of our table. end -- End for loop. Read comments. To get the skin ID selected use guiGridListGetItemData.
  21. https://wiki.multitheftauto.com/wiki/Ser ... our_server Read that manual.
×
×
  • Create New...