Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    A question.

    You don't have to use anything else but setPedAnimation to make it repeat, just set the repeat argument.
  2. To put them in a table, you can do: tier1 = { createMarker(2564.4,yP,23.3, "corona",s,0,0,255,255), createMarker(2571.4,yP,23.3, "corona",s,0,0,255,255), createMarker(2578.4,yP,23.3, "corona",s,0,0,255,255), createMarker(2585,yP,23.3, "corona",s,0,0,255,255), createMarker(2592.4,yP,23.3,"corona",s,0,0,255,255), createMarker(2599,yP,23.3, "corona",s,0,0,255,255) } tier2 = { m_2 = createMarker(2566.4,yP,23.3, "corona",s,255,0,0,255), m_5 = createMarker(2573.4,yP,23.3, "corona",s,255,0,0,255), m_8 = createMarker(2580.4,yP,23.3, "corona",s,255,0,0,255), m_11 = createMarker(2587,yP,23.3, "corona",s,255,0,0,255), m_14 = createMarker(2594.4,yP,23.3,"corona",s,255,0,0,255), m_17 = createMarker(2601,yP,23.3, "corona",s,255,0,0,255) } tier3 = { createMarker(2568.4,yP,23.3, "corona",s,0,255,0,255), createMarker(2575.4,yP,23.3, "corona",s,0,255,0,255), createMarker(2582.4,yP,23.3, "corona",s,0,255,0,255), createMarker(2589,yP,23.3, "corona",s,0,255,0,255), createMarker(2596.4,yP,23.3,"corona",s,0,255,0,255), createMarker(2603,yP,23.3, "corona",s,0,255,0,255) }
  3. Use loops. http://lua.lickert.net/loop/index_en.html
  4. Well, I'm talking about an actual working-bugfree multigamemode, which takes months. But if it's what you say, then is an scam.
  5. An offer would be half of the real price, not 1% of it.
  6. Yeah, sure, and you'll sell a script which took months of scripting time just for 25 USD, do you really expect someone will believe this?
  7. Why would you sell such hard script for just 25 USD? it just makes no sense. Here's what I think: 1) The script doesn't work, maybe just the interface. 2) The script is stolen from some server.
  8. local elements = { } local function loadText( id, text, x, y, z, interior, dimension ) local element = createElement( "3dtext" ) setElementPosition( element, x, y, z ) setElementInterior( element, interior ) setElementDimension( element, dimension ) setElementData( element, "text", tostring( text ) ) elements[ id ] = element end addEventHandler( "onResourceStart", resourceRoot, function( ) -- check for our table to exist if not exports.sql:create_table( '3dtext', { { name = 'textID', type = 'int(10) unsigned', auto_increment = true, primary_key = true }, { name = 'text', type = 'text' }, { name = 'x', type = 'float' }, { name = 'y', type = 'float' }, { name = 'z', type = 'float' }, { name = 'interior', type = 'tinyint(3) unsigned' }, { name = 'dimension', type = 'int(10) unsigned' }, } ) then cancelEvent( ) return end -- local result = exports.sql:query_assoc( "SELECT * FROM 3dtext ORDER BY textID ASC" ) if result then for key, data in ipairs( result ) do loadText( data.textID, data.text, data.x, data.y, data.z, data.interior, data.dimension ) end end end ) addCommandHandler( "createtext", function( player, commandName, ... ) if (exports.global:isPlayerLeadAdmin(player)) then local text = table.concat( { ... }, " " ) local x, y, z = getElementPosition( player ) local insertid,e = exports.sql:query_insertid( "INSERT INTO 3dtext (`text`, x, y, z, interior, dimension) VALUES (" .. table.concat( { "'%s'", x, y, z, getElementInterior( player ), getElementDimension( player ) }, ", " ) .. ")", text ) if insertid then loadText( insertid, text, x, y, z, getElementInterior( player ), getElementDimension( player ) ) outputChatBox( "Text created. (ID " .. insertid .. ")", player, 0, 255, 0 ) else outputDebugString( e ) outputChatBox( "MySQL-Query failed.", player, 255, 0, 0 ) end else outputChatBox( "Syntax: /" .. commandName .. " [text]", player, 255, 255, 255 ) end end, true ) addCommandHandler( "deletetext", function( player, commandName, textID ) if (exports.global:isPlayerLeadAdmin(player)) then textID = tonumber( textID ) if textID then local element = elements[ textID ] if element then if exports.sql:query_free( "DELETE FROM 3dtext WHERE textID = " .. textID ) then outputChatBox( "You deleted text " .. textID .. ".", player, 0, 255, 153 ) destroyElement( element ) -- remove the reference elements[ textID ] = nil else outputChatBox( "MySQL-Query failed.", player, 255, 0, 0 ) end else outputChatBox( "Text not found.", player, 255, 0, 0 ) end else outputChatBox( "Syntax: /" .. commandName .. " [id]", player, 255, 255, 255 ) end end end ) addCommandHandler( "nearbytexts", function( player, commandName ) if (exports.global:isPlayerLeadAdmin(player)) then local x, y, z = getElementPosition( player ) local dimension = getElementDimension( player ) local interior = getElementInterior( player ) outputChatBox( "Nearby Texts:", player, 255, 255, 0 ) for key, element in pairs( elements ) do if getElementDimension( element ) == dimension and getElementInterior( element ) == interior then local distance = getDistanceBetweenPoints3D( x, y, z, getElementPosition( element ) ) if distance < 20 then outputChatBox( " Text " .. key .. ": " .. tostring( getElementData( element, "text" ) ), player, 255, 255, 0 ) end end end end end ) You had a missing 'end'.
  9. Castillo

    Timer Problem

    Use getTickCount, it'll be a lot more efficient.
  10. To make that, you must create an own wanted system, could use element data.
  11. Then, there's no reason to output that error.
  12. You can set the nametag color, blip color when you set the team.
  13. You set the script as client side, right?
  14. addEvent ( "updateBankauszug", true ) addEventHandler ( "updateBankauszug", root, function ( player, wert, state, grund ) if ( state == "+" ) then art = "Einnahme" else art = "Ausgabe" end for bankindex = 1, 12 do setElementData ( player, "Art".. bankindex + 1, getElementData ( player, "Art".. bankindex ) ) setElementData ( player, "Wert".. bankindex + 1, getElementData ( player, "Wert".. bankindex ) ) setElementData ( player, "Grund".. bankindex + 1, getElementData ( player, "Grund".. bankindex ) ) end setElementData ( player, "Wert1", setDotsInNumber ( wert ) .."$" ) setElementData ( player, "Grund1", grund ) setElementData ( player, "Art1", art ) end ) Try that.
  15. You've copied this part from the forum: "Line number On/Off | Expand near/Contract | Select all", just remove it. To make it global, you must trigger a server event with triggerServerEvent then trigger back to client for everyone.
  16. Castillo

    Fix Code

    Well, it was on his code, so, I just left it as he made it.
  17. 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 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 ) local hitElement = ( isPedInVehicle ( hitElement ) and getPedOccupiedVehicle ( hitElement ) or hitElement ) setElementPosition ( hitElement, 0, 0, 120 ) end end end addEventHandler ( "onColShapeHit", col, enterAdmin )
  18. Isn't that what you wanted? nobody can enter with vehicles.
  19. Castillo

    Fix Code

    There's no need to use two timers, you can use just one. addEventHandler ( "onResourceStart", resourceRoot, function ( ) setTimer ( blips, 1000, 0 ) Team = createTeam ( "Alone", 255, 0, 0 ) setTeamFriendlyFire ( Team, false ) policeTeam = createTeam ( "Police", 0, 0, 255 ) setTeamFriendlyFire ( policeTeam, false ) end ) function blips ( ) local players = getPlayersInTeam ( getTeamFromName ( "Alone" ) ) if ( #players > 0 ) then for _, player in ipairs ( players ) do createBlipAttachedTo ( player, 0, 2 , 255 , 0 , 0 , 255 ) end end local players = getPlayersInTeam ( getTeamFromName ( "Police" ) ) if ( #players > 0 ) then for _, player in ipairs ( players ) do createBlipAttachedTo ( player , 0 , 2 , 0 , 0 , 255 , 255 ) end end end addEvent ( "spawnPed", true ) addEventHandler ( "spawnPed", root, function ( thePed ) if ( thePed == 2 ) then spawnPlayer ( source, 1485.0311279297, -2234.9086914063, 13.546875, 0, 2, 0, 0, Team ) setCameraTarget ( source, source ) elseif ( thePed == 280 ) then spawnPlayer ( source, 1568.5963134766, -1691.4530029297, 5.890625, 0, 280, 0, 0, policeTeam ) setCameraTarget ( source, source ) end end ) ------------------------------- kill ------------------------------------ function commitSuicide ( sourcePlayer ) killPed ( sourcePlayer, sourcePlayer ) end addCommandHandler ( "kill", commitSuicide )
  20. You aren't explaining anything.
  21. Well, the problem is that you are checking a non-existent variable. function bindHoron ( key, keyState ) local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( not theVehicle ) then return end if ( getElementModel ( theVehicle ) == 537 ) then if ( keyState == 'down' ) then sound = playSound3D ( 'hupe/ZUGHUPE.mp3', getElementPosition ( localPlayer ) ) setSoundVolume ( desusound, 5.0 ) setSoundMaxDistance ( desusound, 190 ) attachElements ( sound, theVehicle ) elseif ( keyState == 'up' ) then if isElement ( sound ) then stopSound ( sound ) end end end end bindKey ( 'h', 'down', bindHoron ) bindKey ( 'h', 'up', bindHoron ) With this script, only the player who presses the key will hear the horn, since is client side.
×
×
  • Create New...