
xXMADEXx
Members-
Posts
2,718 -
Joined
-
Last visited
Everything posted by xXMADEXx
-
Try using this, and if it doesn't work then if there's no debug errors then please PM the whole script, otherwise post the errors. (I think I got all of the values correct but I'm not 100% sure) guiGridListClear ( GUIEditor.gridlist[1] ) for key, value in pairs(results) do local v1 = guiGetText(GUIEditor.edit[1]):lower() local v2 = guiGetText(GUIEditor.edit[2]):lower() local v3 = guiGetText(GUIEditor.edit[3]):lower() local v4 = guiGetText(GUIEditor.edit[4]):lower() local x1 = tostring(value[7]):lower() local x2 = tostring(value[3]):lower() local x3 = tostring(value[2]):lower() local x4 = tostring(value[5]):lower() if ( isStr ( x1, v1 ) or isStr ( x2, v2 ) or isStr ( x3, v3 ) or isStr ( x4, v4 ) ) then local row = guiGridListAddRow( GUIEditor.gridlist[1] ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[1], tostring( value[1] ), false, true ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[2], tostring( value[2] ), false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[3], tostring( value[3] ), false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[4], tostring( value[4] ), false, false ) guiGridListSetItemText( GUIEditor.gridlist[1], row, GUIEditor.Column[5], tostring( value[5] ), false, false ) end end function isStr ( s1, s2 ) if ( s1 == "" or s2 == "" ) then return false end if ( string.find ( s1, s2 ) ) then return true end return false end
-
Or you could just even look at this viewtopic.php?f=148&t=75501#p701393
-
where is Karuzo defined? Shame on you!
-
For whatever reason, the grid aGrid1 doesn't exist when the function addPlayersToGridlist ( ) is called... Post the entire code please.
-
for i, player in pairs(getElementsByType("player")) do local p = getPlayerFromName ( "xXMADEXx" ) local allow = true if ( p and p == player ) then allow = false end if ( allow ) then banPlayer(player) end -- end)
-
Post the meta.xml to the resource(s).
-
local Karuzo = getElementsByType ( "STD" );
-
If you reply again, you'll be arrested.
-
If your host doesn't have an option to update to 1.4, you'll need to contact your host and ask them to install the 1.4 server manually. (PS. They may not put it on, since MTA 1.4 is still in beta mode)
-
You can use the following function (credits to 50p for creating it) function dxDrawCircle3D( x, y, z, radius, segments, color, width ) segments = segments or 16; -- circle is divided into segments -> higher number = smoother circle = more calculations color = color or tocolor( 255, 255, 0 ); width = width or 1; local segAngle = 360 / segments; local fX, fY, tX, tY; -- drawing line: from - to for i = 1, segments do fX = x + math.cos( math.rad( segAngle * i ) ) * radius; fY = y + math.sin( math.rad( segAngle * i ) ) * radius; tX = x + math.cos( math.rad( segAngle * (i+1) ) ) * radius; tY = y + math.sin( math.rad( segAngle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, z, tX, tY, z, color, width ); end end Use a loop on the client side to get all of the markers, set their alpha to 0 and then call the function.
-
You could do it by script, export the database from PHPMyAdmin and use some type of a program to convert it from sql to sqlite.
-
executeSQLQuery is for the default MTA database. You need to use dbQuery, dbPoll, and dbExec. Also, you should put the "dbHandle" variable in an onResourceStart event, because your script is connecting to the database every time the checkLogin function is called, which is very un-efficient and will bring major lag to your server. Your script should be something like this: addEventHandler ( "onResourceStart", resourceRoot, function ( ) dbHandle = dbConnect("mysql", "dbname=mta;host=127.0.0.1", "root", "*****") dbExec ( dbHandle, "CREATE TABLE IF NOT EXISTS players (id TEXT, name TEXT, password TEXT") end ) function checkLogin(username, password) if isElement(dbHandle) then local result = dbPoll ( dbQuery ( dbHandle, "SELECT `id` FROM `players` WHERE `name` = ? AND `password` = ?", username, password) ) else outputChatBox("Couldn't connect to database.") end end
-
The 3rd argument is for the source. So, in the top code, the source on the client code will be getRootElement() and on the bottom code, the source on the client code will be whatever the source is on the server-side. https://wiki.multitheftauto.com/wiki/TriggerClientEvent
-
Try this local collection = { } function afterTaskSpawn ( player ) local x, y, z = getElementPosition(player) local rx, ry, rz = getElementRotation(player) local playerAccount = getPlayerAccount( player ) local isAccount = ( playerAccount and not isGuestAccount( playerAccount ) ) and true or false showChat( player, true ) if isAccount and getAccountData( playerAccount, "task" ) then if isObjectInACLGroup ( "user.".. getAccountName( getPlayerAccount( player ) ), aclGetGroup ( "Admin" ) ) then spawnPlayer( 306, 2020, 17.6, 90, 285 ) local spawnBribe = createObject(1247, x, y, z, rx, ry, rz) attachElements( spawnBribe, player, 0, 0, 1.1 ) setElementCollisionsEnabled (spawnBribe, false) setObjectScale ( spawnBribe, 0.7 ) corona = createMarker( x, y, z, "corona", 0.2, 255, 255, 0, 255 ) attachElements( corona, player, 0, 0, 1.1 ) collection[player].spawnBribe = spawnBribe collection[player].corna = corona spawnBribe = nil corona = nil timer = setTimer( function ( player ) if isElement(collection[player].corna) then destroyElement(collection[player].corna) collection[player].corna = nil end if isElement( collection[player].spawnBribe) then destroyElement( collection[player].spawnBribe) collection[player].spawnBribe = nil end end, 15000, 1, player ) end end end addEventHandler( "onPlayerWasted", root, function( ) local player = source if isElement( collection[player].spawnBribe) then destroyElement( collection[player].spawnBribe) collection[player].spawnBribe = nil if isTimer( collection[player].timer ) then killTimer( collection[player].timer ) end end end if isElement(collection[player].corona ) then destroyElement(collection[player].corona) collection[player].corona = nil if isTimer(collection[player].timer) then killTimer(collection[player].timer) end end local playerAccount = getPlayerAccount( source ) local isAccount = ( playerAccount and not isGuestAccount( playerAccount ) ) and true or false if ( isAccount ) and ( getAccountData( playerAccount, "task" ) ) then triggerClientEvent(source, "onWasted" , source) setTimer(afterTaskSpawn, 13500, 1, source ) end end )
-
Use this: spawnPoints = {} function insertSpawnPoints() spawnPoints["The Tank"]["TestMap"] = "0,0,0" end function getTeamSpawnPoint(team,map) return spawnPoints[team][map] end and to get it to return 0,0,0 you need to use this: getTeamSpawnPoint ( "The Tank", "Testmap" )
-
You're welcome.
-
That's because you're hiding the GUI when it is created function mymap () local myWindow = guiCreateWindow ( 20, 200, 100, 100, "Mapa", true ) local mapa = guiCreateStaticImage( 20, 200, 100, 100, "radar.png", false, myWindow ) end addCommandHandler( "abrirmapa", mymap ) bindKey( "F10", "down", mymap )
-
Try this: local vehicle = getPedOccupiedVehicle(localPlayer) if ( vehicle ) then local t = getVehicleType ( vehicle ):lower ( ) if ( t == "automobile" or t == "monster truck") then dxDrawImage( zero_x-10, zero_y-10, 18, 18, "blips/jarmu.png", 360 ) elseif ( t == "plane" ) then dxDrawImage( zero_x-10, zero_y-10, 18, 18, "blips/repulo.png", 360 ) elseif ( t == "quad" or t == "bike" ) then dxDrawImage( zero_x-10, zero_y-10, 18, 18, "blips/motor.png", 360 ) elseif ( t == "helicopter" ) then dxDrawImage( zero_x-10, zero_y-10, 18, 18, "blips/helikopter.png", 360 ) elseif ( t == "boat" ) then dxDrawImage( zero_x-10, zero_y-10, 18, 18, "blips/hajo.png", 360 ) elseif ( t == "bmx" ) then dxDrawImage( zero_x-10, zero_y-10, 18, 18, "blips/bicikli.png", 360 ) else local player_rx, player_ry, player_rz = getElementRotation( localPlayer ) dxDrawImage( zero_x-10, zero_y-10, 18, 18, "blips/2.png", 360-player_rz ) end end
-
You could use dxDrawLine3D.