-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
function check() local acc = getPlayerAccount(source) local accName = getAccountName(acc) if isObjectInACLGroup("user."..acc, aclGetGroup("admin")) then atype = "admin" pname = getPlayerName(source) triggerClientEvent(source, "infosend", source, accName, atype, pname) end end
-
I think is because these commands are already used by "admin" resource. I renamed "blow" to "blow2" and it worked.
-
Of course there is, never heard of MTA wiki? https://wiki.multitheftauto.com/wiki/Cli ... _Functions https://wiki.multitheftauto.com/wiki/Cli ... ing_Events https://wiki.multitheftauto.com/wiki/Ser ... _Functions https://wiki.multitheftauto.com/wiki/Ser ... ing_Events
-
Woah, that's an awesome idea, keep up the good work!
-
--MechanicFix function fixCar (player,command) local skin = getElementModel (player) if ( skin == 50 ) then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then fixVehicle(vehicle) takePlayerMoney(player,100) end end end addCommandHandler("repair" , fixCar) addCommandHandler("rp" , fixCar) --terroristdestroy function blow(player,command) local skin = getElementModel (player) if ( skin == 96 ) then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then blowVehicle(vehicle) takePlayerMoney(player,100) end end end addCommandHandler("destroy" , blow) addCommandHandler("blow" , blow)
-
You're welcome .
-
setElementData(getControl(wndMain, "kill"), "tooltip-text", "انتحآر", false) It may work, not sure.
-
Exactly, is a tooltip for GUI elements. Have you tried my way?
-
Try this: setElementData(getControl("kill"), "tooltip-text", "انتحآر", false)
-
SVN is used to store data, you can use a SVN client to download it.
-
I don't know such event "Fixcar", maybe you mean the function: fixVehicle? if so, then to blow up a vehicle use: blowVehicle
-
Please try not to start a flame war, I don't want to have to trash the topic.
-
function hit ( pla ) if (getElementType ( pla ) ~= "player") then return end if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then outputChatBox ( "Welcome, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) givePedJetPack( pla ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) if ( doesPedHaveJetPack ( pla ) ) then removePedJetPack ( pla ) end outputChatBox ( "***Admin Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." has entered the Admin Area!", g_root, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." please leave the Admin Area!", pla, 255, 0, 0 ) end end addEventHandler ( "onColShapeHit", g_base_col, hit )
-
Maybe race text library doesn't support custom font's.
-
http://lua-users.org/wiki/LearningLua
-
@GanJaRuleZ: Your script is a total mess, would help if you stop replying, it'll confuse the topic creator. @Zokan: You want to give a jetpack if he player is admin? and if not, remove it?
-
Maybe because you never call "showMusic" function? local musics = { [ 'David Guetta - Where Dem Girls At' ] = 'gfx/music/dg-wdga.mp3', [ 'Coldplay - Paradise' ] = 'gfx/music/cp-pd.mp3', [ 'Coldplay - Viva la Vida' ] = 'gfx/music/cp-vlv.mp3', [ 'Ana Malhoa - Danza Kuduro' ] = 'gfx/music/am-dk.mp3', [ 'No Name - Jamming' ] = 'gfx/music/jm.mp3', [ 'Klaas - Make you Feel' ] = 'gfx/music/ks-myf.mp3', [ 'No Name - Vitality' ] = 'gfx/music/vy.mp3', [ 'Basshunter - All I ever wanted' ] = 'gfx/music/bh-aiew.mp3', [ 'Whiz Khalifa - Black and Yellow ( Ft. Snoop Dogg, Juicy J & T-Pain )' ] = 'gfx/music/wk-bay.mp3', [ 'Skrillex - My name is Skrillex ( Remix )' ] = 'gfx/music/sx-mnis.mp3', [ 'Italobrothers - Stamp on the Ground' ] = 'gfx/music/ib-sotg.mp3', [ 'Madcon - Freaky like Me' ] = 'gfx/music/mc-flm.mp3', [ 'Cut the Music - Greatest Deejay' ] = 'gfx/music/ctm-gd.mp3', [ 'No Name - Time`s Vortex' ] = 'gfx/music/tv.mp3', [ 'Manian - Welcome to the Club' ] = 'gfx/music/wttc.mp3', [ 'Bon Jovi - It`s my Life' ] = 'gfx/music/iml.mp3', [ 'Example - Changed the Way you Kissed Me' ] = 'gfx/music/ctwykm.mp3', [ 'Example - Kickstart ( Bar 9 Remix )' ] = 'gfx/music/e-ksb9rx.mp3' } --gui music = guiCreateWindow(0.2988,0.2317,0.4238,0.5617,"ppS Music Player",true) music_play = guiCreateLabel(0.3864,0.1098,0.236,0.0445,"Now playing:",true,music) guiSetAlpha(music_play,1) guiLabelSetColor(music_play,255,20,147,255) guiLabelSetHorizontalAlign(music_play,"center",false) guiSetFont(music_play,"default-bold-small") music_name = guiCreateLabel(0.1268,0.1869,0.7611,0.0623,"",true,music) guiLabelSetHorizontalAlign(music_name,"center",false) music_grid = guiCreateGridList(0.0649,0.2997,0.8732,0.6261,true,music) guiGridListSetSelectionMode(music_grid,0) music_grid_column = guiGridListAddColumn(music_grid,"Playlist",0.2) if (music_grid_column) then for name, url in pairs(musics) do local row = guiGridListAddRow ( music_grid ) guiGridListSetItemText( music_grid, row, music_grid_column, tostring(name), false, false ) end end guiSetVisible ( music, false ) function showWindow() if (guiGetVisible (music)) then guiSetVisible (music, false) showCursor (false) else guiSetVisible(music, true) showCursor (true) end end bindKey ( "F3", "down", showWindow )
-
@csmit195: That has nothing to do with his question. @kieren1: Which spawn menu are you using? we can't help you if you don't tell us.
-
-- server side: addEventHandler ( "onVehicleEnter", root, function () if ( isVehicleOnGround ( source ) ) then -- if the vehicle is on the ground, announce it outputChatBox ( getVehicleName ( source ) .. " is on the ground and made GOD-like" ) setVehicleDamageProof ( source, true ) else -- if the vehicle isn't on the ground, announce that it is in the air outputChatBox ( getVehicleName ( source ) .. " is in the air and made GOD-like" ) setVehicleDamageProof ( source, true ) end end) That'll be triggered when you enter a vehicle, which is when the race starts, because you get warped to a vehicle.
-
No, I mean when you get killed, it must have a respawn system.
-
That's wrong, his script was designed with Ryden's MySQL module, so is not sqlite. local sqlHostname = "127.0.0.1" -- Hostname local sqlUsername = "pao13_dtr" -- Username local sqlPassword = "dtr4ever" -- Password local sqlDefaultDatabase = "pao13_dtr" -- Database local sqlDefaultTable = "userdata" -- Table -- Connect to the database function connect() mySQLConnect = dbConnect( "mysql", "dbname="..tostring(sqlDefaultDatabase)..";host="..tostring(sqlHostname).."", tostring(sqlUsername), tostring(sqlPassword), "share=0" ) for index, player in ipairs(getElementsByType("player")) do checkSQLData(player) end end addEventHandler("onResourceStart", resourceRoot, connect) -- Make a new entry to the MySQL database function checkSQLData(player) local player = source local serial = getPlayerSerial(player) local entryCheck = dbQuery(mySQLConnect, "SELECT serial FROM " .. sqlDefaultTable .. " WHERE serial='" ..serial.. "'") if (entryCheck) then local result = dbPoll(entryCheck, 1, 1) if (result == "") or (result == nil) then outputDebugString("New entry added to the mySQL database!") dbQuery(mySQLConnect, "INSERT INTO " .. sqlDefaultTable.." (serial) VALUES ('"..serial.."')") dbExec(mySQLConnect, "UPDATE " .. sqlDefaultTable .. " SET playerName='".. string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "") .. "' WHERE serial='" .. serial .. "'") end else outputDebugString("New entry added to the mySQL database!") dbQuery(mySQLConnect,"INSERT INTO "..sqlDefaultTable.." (serial) VALUES ('"..serial.."')") dbExec(mySQLConnect,"UPDATE " .. sqlDefaultTable .. " SET playerName='" .. string.gsub(getPlayerName(player),"#%x%x%x%x%x%x", "") .. "' WHERE serial='" .. serial .. "'") end end addEventHandler("onPlayerJoin", getRootElement(), checkSQLData) -- Load data from the database function loadPlayerData(player, datatype) if (player) and (datatype) then local serial = getPlayerSerial(player) local findQuery = dbQuery(mySQLConnect, "SELECT " .. datatype .. " FROM " .. sqlDefaultTable .. " WHERE serial='" .. serial .. "'") if (findQuery) then local result = dbPoll(findQuery, 1, 1) if not (result == nil) then if not (result == "") then dbFree(findQuery) return result else dbFree(findQuery) return 0 end else return 0 end else --outputDebugString("Failed to get "..datatype.." for player "..getPlayerName(player).." @ findQuery") --outputDebugString("mysql_query failed: (" .. mysql_errno(sqlConnection) .. ") " .. mysql_error(sqlConnection)) end end end -- Save data to the database function savePlayerData (player, datatype, newvalue) if (player) and (datatype) and (newvalue) then local serial = getPlayerSerial(player) local saveData = dbExec(mySQLConnect, "UPDATE " .. sqlDefaultTable .. " SET " .. datatype .. "='" .. newvalue .. "' WHERE serial='" .. serial .. "'") if (saveData == nil) then --outputDebugString("Error executing the save query: (" .. mysql_errno(sqlConnection) .. ") " .. mysql_error(sqlConnection)) end end end
-
function hit ( pla ) if (getElementType ( pla ) == "player") then if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then outputChatBox ( "Welcome, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) if ( doesPedHaveJetPack ( pla ) ) then removePedJetPack ( pla ) end outputChatBox ( "***Admin Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." has entered the Admin Area!", g_root, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." please leave the Admin Area!", pla, 255, 0, 0 ) end end end addEventHandler ( "onColShapeHit", g_base_col, hit )
-
local musics = { [ 'David Guetta - Where Dem Girls At' ] = 'gfx/music/dg-wdga.mp3', [ 'Coldplay - Paradise' ] = 'gfx/music/cp-pd.mp3', [ 'Coldplay - Viva la Vida' ] = 'gfx/music/cp-vlv.mp3', [ 'Ana Malhoa - Danza Kuduro' ] = 'gfx/music/am-dk.mp3', [ 'No Name - Jamming' ] = 'gfx/music/jm.mp3', [ 'Klaas - Make you Feel' ] = 'gfx/music/ks-myf.mp3', [ 'No Name - Vitality' ] = 'gfx/music/vy.mp3', [ 'Basshunter - All I ever wanted' ] = 'gfx/music/bh-aiew.mp3', [ 'Whiz Khalifa - Black and Yellow ( Ft. Snoop Dogg, Juicy J & T-Pain )' ] = 'gfx/music/wk-bay.mp3', [ 'Skrillex - My name is Skrillex ( Remix )' ] = 'gfx/music/sx-mnis.mp3', [ 'Italobrothers - Stamp on the Ground' ] = 'gfx/music/ib-sotg.mp3', [ 'Madcon - Freaky like Me' ] = 'gfx/music/mc-flm.mp3', [ 'Cut the Music - Greatest Deejay' ] = 'gfx/music/ctm-gd.mp3', [ 'No Name - Time`s Vortex' ] = 'gfx/music/tv.mp3', [ 'Manian - Welcome to the Club' ] = 'gfx/music/wttc.mp3', [ 'Bon Jovi - It`s my Life' ] = 'gfx/music/iml.mp3', [ 'Example - Changed the Way you Kissed Me' ] = 'gfx/music/ctwykm.mp3', [ 'Example - Kickstart ( Bar 9 Remix )' ] = 'gfx/music/e-ksb9rx.mp3' } function showMusic () if (music_grid_column) then for name, url in pairs(musics) do local row1 = guiGridListAddRow ( music_grid ) guiGridListSetItemText( music_grid, row1, music_grid_column, tostring(name), false, false ) end end end
-
Este es el foro del MTA, no el de CIT. Si es un error, es un error de sus scripts, tenes que esperar a ver cuando lo arreglan ellos.
