• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team
    • jhxp

      Multi Theft Auto: San Andreas 1.5.4 is out!   21/04/17

      Click the link in the announcement for more details.  

*BeaT*

Members
  • Content count

    78
  • Joined

  • Last visited

Community Reputation

7 Neutral

About *BeaT*

  • Rank
    Transformer
  • Birthday 28/11/00

Details

  • Gang
    Ciucago Boyz
  • Location
    Romania
  • Occupation
    Mapper, Modder, Scripter

Recent Profile Visitors

433 profile views
  1. Try, for example, id 128
  2. I think this can be achieved using setPedWalkingStyle function ( example : gangster walking style, gangster shooting type )
  3. This is just another idea( not tested ) , feel free to use and edit it as you wish --SERVER addEventHandler( "onPlayerSpawn", getRootElement(), function () triggerClientEvent( source, "player_onSpawn", source ) end ) --CLIENT addEvent( "player_onSpawn", true ) local SHOW_DIST = 50 local TAG_RADIUS = createColSphere( 0, 0, 0, SHOW_DIST ) function initialiseNametags() attachElements( TAG_RADIUS, localPlayer, 0, 0, 0 ) addEventHandler( "onClientRender", getRootElement(), renderNametags ) end addEventHandler( "player_onSpawn", getRootElement(), initialiseNametags ) local TAG_WIDTH, TAG_HEIGHT = 300, 50 function renderNametags() local CAM_X, CAM_Y, CAM_Z = getCameraMatrix() local PLAYERS_IN_RADIUS = getElementsWithinColShape( TAG_RADIUS, "player" ) for _, PLAYER in pairs ( PLAYERS_IN_RADIUS ) do local PLAYER_X, PLAYER_Y, PLAYER_Z = getElementPosition( PLAYER ) if isLineOfSightClear( PLAYER_X, PLAYER_Y, PLAYER_Z, CAM_X, CAM_Y, CAM_Z, true, false, false, true, false, false, localPlayer ) then local BONE_X, BONE_Y, BONE_Z = getPedBonePosition( PLAYER, 5 ) local TAG_X, TAG_Y = getScreenFromWorldPosition( BONE_X, BONE_Y, BONE_Z + 0.3 ) if ( TAG_X and TAG_Y ) then dxDrawText( getPlayerName( PLAYER ), TAG_X - TAG_WITH / 2, TAG_Y - TAG_HEIGHT / 2, TAG_X - TAG_WITH / 2 + TAG_WITH, TAG_Y - TAG_HEIGHT / 2 + TAG_HEIGHT, tocolor( 150, 50, 0 ), 1, "bankgothic" ) end end end end One mistake i saw was at dxDrawText.For example, if you want to draw a text at coords 10, 10 with the height of 50 and width of 100 you need to write something like dxDrawText( "text", 10, 10, 110, 60 ... ) ( the right and bottom must be coords, not the width and height )
  4. As i heard before( not sure tho ), a weapon doesn't represent a physical object like a ped or an object and a shader can't be applied to it. The solution here( if possible ) is to create a custom weapon system which uses actual objects as weapons ( engineApplyShaderToWorldTexture's optional arguments )
  5. Why don't you just uprgade your mta to the lastest version ( MTA:SA 1.5.4 ) ? It offers the possibility to play the race gamemode and alot of other cool gamemodes and it's map editor is veri stable
  6. That security thing is the part of the bottom land.Use 'Select world model' tool and check it by yourself
  7. Just use these functions createColCuboid() -- or any col shape "onColShapeHit" --event --example( not tested ) colShape = createColCuboid( --[[ fill here with the parameters ]] ) addEventHandler( "onColShapeHit", colShape, function( hitElement, dimension ) if not ( dimension ) then return false end if( isElement( hitElement) and getElementType( hitElement ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( hitElement ) ) if not( isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) ) then --teleport out of the colshape end end end )
  8. Event parameters addEventHandler ( "onPlayerVehicleExit", getRootElement(), function ( vehicle, seat, jacked ) if getVehicleType(theVehicle) == "Train" then detachTrailerFromVehicle(theVehicle) end end, )
  9. Use attachTrailerToVehicle function
  10. Fixed, fully functional code( thanks @ZoRRoM for the idea ) here function db_executeCommand( COMMAND, ... ) local VARS_TABLE = { ... } local DB_EXEC if ( VARS_TABLE and #VARS_TABLE > 0 ) then DB_EXEC = dbExec( DATABASE_CONNECTION, COMMAND, unpack( VARS_TABLE ) ) else DB_EXEC = dbQuery( DATABASE_CONNECTION, COMMAND ) end if not ( DB_EXEC ) then return false end return true end
  11. I tried to change some little things in this function and, by using assert, i found out that there are errors CODE: DATABASE_CONNECTION = dbConnect( "sqlite", "uhr.db" ) function db_executeCommand( COMMAND, ... ) local VARS_TABLE = { ... } local VARS_STRING = "" local VARS local DB_EXEC for INDEX, VAR in pairs( VARS_TABLE ) do VARS_STRING = VARS_STRING..",".."VARS_TABLE["..tostring( INDEX ).."]" end outputDebugString( "VARS_STRING : "..VARS_STRING:gsub( ",", "", 1 ) ) if ( VARS_STRING and VARS_STRING ~= "" ) then VARS = VARS_STRING:gsub( ",", "", 1 ) DB_EXEC = dbExec( DATABASE_CONNECTION, COMMAND, assert( loadstring( VARS ) )() ) else DB_EXEC = dbQuery( DATABASE_CONNECTION, COMMAND ) end if not ( DB_EXEC ) then return false end return true end Function test db_executeCommand( "INSERT INTO accounts( user, pass ) VALUES ( ?, ? )", "test", "test" ) --Output in debug panel : [string "VARS_TABLE[1],VARS_TABLE[2]"]:1:expected '=' near '<eof>'
  12. why don't you just verify if the amount is positive and bigger than 0 if ( amount > 0 and math.ceil( amount ) == amount --[[ verify if the amount is bigger than 0 and is an integer( doesn't contain decimals )]] ) then --code else outputChatBox( "The amount must be an integer bigger than 0" ) end
  13. I want this function to work with all dbExec commands ( INSERT, UPDATE etc... ) so i tried something like this DATABASE_CONNECTION = dbConnect( "sqlite", "uhr.db" ) function db_executeCommand( COMMAND, ... ) local VARS_TABLE = { ... } local VARS_STRING = "" local VARS local DB_EXEC for _, VAR in pairs( VARS_TABLE ) do if ( type( VAR ) == "string" ) then VARS_STRING = VARS_STRING..", ".."\""..VAR.."\"" else VARS_STRING = VARS_STRING..","..tostring( VAR ) end end if ( VARS_STRING and VARS_STRING ~= "" ) then VARS = VARS_STRING:gsub( ",", "", 1 ) DB_EXEC = dbExec( DATABASE_CONNECTION, COMMAND, loadstring( VARS ) ) else DB_EXEC = dbQuery( DATABASE_CONNECTION, COMMAND ) end if not ( DB_EXEC ) then return false end return true end but when i use, for example db_executeCommand( "INSERT INTO accounts( user,pass ) VALUES ( ?, ? )", theUser, thePass ) the value in the first column is nill and, in the second column are all the values stored
  14. I tried to make a function which executes a dbExec like this DATABASE_CONNECTION = dbConnect( "sqlite", "uhr.db" ) function db_executeCommand( COMMAND, ... ) local VARS = table.concat({...}, ",") local DB_EXEC if ( VARS ) then DB_EXEC = dbExec( DATABASE_CONNECTION, COMMAND, VARS ) else DB_EXEC = dbExec( DATABASE_CONNECTION, COMMAND ) end if not ( DB_EXEC ) then return false end return true end The problem is that only the first column is filled with all the variables For example : db_executeCommand( "INSERT INTO accounts( user, pass, word, staff, don, creatorSerial, saved, onSerial ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?)", user, pass, word, "Member", "false", serial, "false", "" ) --user column : all variables --pass column empty --word column empty -- etc...
  15. function showPanel(thePlayer) triggerClientEvent(thePlayer, "opencho", getRootElement()) end function onResStart() for i, player in pairs( getElementsByType( "player" ) ) do local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("CHOQUE")) then bindKey(player, "F4", "down", showPanel) end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStart) function player_onLogin( _, accountname ) if isObjectInACLGroup("user." .. accountname, aclGetGroup("CHOQUE")) then bindKey(source, "F4", "down", showPanel) end end addEventHandler("onPlayerLogin", getRootElement(), player_onLogin ) function cleanAll(player) for index, player in pairs(getElementsByType("player")) do unbindKey(player, "F4", "down", showPanel) end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAll) Any errors in debug?