
Carlossg
Members-
Posts
162 -
Joined
-
Last visited
Everything posted by Carlossg
-
This is my script: addEventHandler('onClientPlayerJoin', root, function() outputChatBox('* ' .. getPlayerName(source) .. ' has joined the game', 255, 100, 100) end ) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) end ) addEventHandler('onClientPlayerQuit', root, function(reason) outputChatBox('* ' .. getPlayerName(source) .. ' has left the game [' .. reason .. ']', 255, 100, 100) end ) I find it on resources/[gameplay]/joinquit.zip
-
OK Now I have a server and when a player join whit hex codes see Pla#00ff00yer has entered the game and I want to remove #00ff00 to Player has entered the game Thx.
-
And center on screen for all resolutions?
-
OK thx And how to do it too bigger and on other colour and center on screen?
-
Now it work but I see lyrics smallest and on the left on the screen and don't dessapear
-
Don't work My file hunteralert: function someoneReachedHunter(number, sort, model) if sort == "vehiclechange" and model == 425 then outputChatBox ( getPlayerName(source).." #00ff00has gotten the hunter! Run!", getRootElement(), 255, 255, 255, true ) local label = guiCreateLabel(10, 100, 150, 20, 'Hunter reached Run!', false) Animation.createAndPlay(label, Animation.presets.guiMove(100, 200, 2000)) Animation.createAndPlay(label, Animation.presets.guiFadeIn(2000)) removeEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) -- NOTE THIS LINE THAT REMOVES THE EVENT HANDLER! end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) And my meta <meta> <info name="Hunter alert" description="hunter alert" author="~KaRLoS~" type="script" version="1.0"/> <script src="hunteralert.lua" type="server"/> <script src="client_anim.lua" type="client"/> </meta>
-
Hello. I'm making a hunter reached script,I want to show on screen an image whit "Hunter Alert!" and I want to do this whit effects right to left. I do not know if I explain, example.You get hunter and show on screen "Hunter Alert!" and text go to left and next disappear
-
Now I have a question, can I save the DB? Or every time when I restart the Server DB is restarted?
-
Whit this when i type /cash I see money? I add this on other script or in same?
-
I know it,but I can save de DB or when I restart server it restart? Other If I want to do a shop whit this money what comands I need to use?
-
right script no bugged but no money when win a DD
-
OK. Right only 1 error ERROR: cashddDMKHD\cashdddm.lua:28: attempt to perform arithmetic on a nil value
-
still fail ERROR: cashddDMKHD\cashdddm.lua:15: Database query failed: no such column: serial ERROR: cashddDMKHD\cashdddm.lua:17: Database query failed: no such column: serial ERROR: cashddDMKHD\cashdddm.lua:20: Database query failed: table Money has 1 columns but 5 values were supplied ERROR: cashddDMKHD\cashdddm.lua:23: Database query failed: table DDDM has 2 columns but 3 values were supplied ERROR: cashddDMKHD\cashdddm.lua:26: Database query failed: table DDAttempts has 2 columns but 3 values were supplied ERROR: cashddDMKHD\cashdddm.lua:38: attempt to perform arithmetic on a nil value The code is same as you post
-
Sorry addEvent("onMapStarting") function creatingTables() executeSQLCreateTable("Money", "Cash INT") executeSQLCreateTable("DDDM", "serial STRING,DDAttempts INT") executeSQLCreateTable("DDAttempts", "serial STRING,DDAttempts INT") outputChatBox("Cash System by KHD started.") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), creatingTables) function ClientReady(source) local serial = getPlayerSerial(source) local playername = getPlayerName(source) CheckPlayer = executeSQLSelect ( "Money", "serial", "serial = '" .. serial .. "'" ) CheckPlayer2= executeSQLSelect ( "DDDM", "serial", "serial = '" .. serial .. "'" ) CheckPlayer3= executeSQLSelect ( "DDAttemps", "serial", "serial = '" .. serial .. "'" ) if ( type( CheckPlayer ) == "table" and #CheckPlayer == 0 ) or not CheckPlayer then executeSQLInsert ( "Money", "'"..serial.."','0','0','0','0'" ) end if ( type( CheckPlayer2 ) == "table" and #CheckPlayer2 == 0 ) or not CheckPlayer2 then executeSQLInsert ( "DDDM", "'"..serial.."','0','0'" ) end if ( type( CheckPlayer3 ) == "table" and #CheckPlayer3 == 1 ) or not CheckPlayer3 then executeSQLInsert ( "DDAttempts", "'"..serial.."','1','1'" ) end end addEvent("onClientReady",true) addEventHandler("onClientReady",getRootElement(),ClientReady) function DestructionMoney(mapInfo,mapOptions,gameOptions) info = mapInfo.modename if mapInfo.modename == "Destruction derby" then local players = getElementsByType("player") for k,v in ipairs(players) do local serial = getPlayerSerial(v) local DDAttempts = executeSQLSelect ( "DDDM", "DDAttempts","serial = '" .. serial .. "'") DDAttempts = ( tonumber(DDAttempts["DDAttempts"]) + 1 ) or 0 executeSQLUpdate ( "DDDM", "DDAttempts = '"..DDAttempts.."'","serial = '" .. serial .. "'") setElementData(v,"data.DDAttempts",DDAttempts,true) end end end function DestructionMoney2(thePlayer) local playername = getPlayerName(thePlayer) local serial = getPlayerSerial(thePlayer) local Cash = executeSQLSelect ( "Money", "Cash","serial = '" .. serial .. "'") outputChatBox("*Wins: "..playername.." took $"..get('MoneyForDD').." for winning the map!",getRootElement(),255,255,0) Cash = tonumber(Cash[1]["Cash"]) + get('MoneyForDD') setElementData(thePlayer ,"Cash", Cash) setElementData(thePlayer ,"data.money",Cash,true) setElementData(thePlayer ,"data.playername",playername,true) executeSQLUpdate ( "Money", "Cash = '"..Cash.."'","serial = '" .. serial .. "'") end function hunterBonus(pickupID, pickupType, vehicleModel) if info == "Destruction derby" then if pickupType == "vehiclechange" then if vehicleModel == 425 then local serial = getPlayerSerial(source) local Cash = executeSQLSelect ( "Money", "Cash","serial = '" .. serial .. "'") Cash = tonumber(Cash[1]["Cash"]) + 1000 outputChatBox("*Hunter: "..getPlayerName(source).." gets a $1000 hunter bonus!",source,25,125,225) setElementData(source ,"Cash", Cash) setElementData(source ,"data.money",Cash,true) executeSQLUpdate ( "Money", "Cash = '"..Cash.."'","serial = '" .. serial .. "'") end end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),hunterBonus) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports.scoreboard:addScoreboardColumn("Cash") end) addEventHandler("onMapStarting", getRootElement() , DestructionMoney)
-
I've read and reread but I don't find that fails here: WARNING: cashddDMKHD\cashdddm.lua:11: Bad argument @ 'getPlayerSerial' WARNING: cashddDMKHD\cashdddm.lua:12: Bad argument @ 'getPlayerName' [Expected element at argument 1, got nil] ERROR: cashddDMKHD\cashdddm.lua:13: attempt to concatenate local 'serial' (a boolean value) I'm not new on Lua I'm new on Lua whit MTA commands PD:Whats mean boolean value.Empty value?
-
Today I just put this on my goal and I will not stop until I get
-
Sorry but I don't know how to fix it I have not enough knowledge
-
Now other error WARNING: cashddDMKHD\cashdddm.lua:11: Bad argument @ 'getPlayerSerial' WARNING: cashddDMKHD\cashdddm.lua:12: Bad argument @ 'getPlayerName' [Expected element at argument 1, got nil] ERROR: cashddDMKHD\cashdddm.lua:13: attempt to concatenate local 'serial' (a boolean value) And: ERROR: cashddDMKHD\cashdddm.lua:38: attempt to perform arithmetic on a nil value
-
Hi I'm new on this forum. I found this script on Web and I try to edit to unbug but don't work It's for cash to DD/DM addEvent("onMapStarting") function creatingTables() executeSQLCreateTable("Money", "Cash INT") executeSQLCreateTable("DDDM", "serial STRING,DDAttempts INT") executeSQLCreateTable("DDAttempts", "serial STRING,DDAttempts INT") outputChatBox("Cash System by KHD started.") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), creatingTables) function ClientReady(g_player) local serial = getPlayerSerial(g_player) local playername = getPlayerName(g_player) CheckPlayer = executeSQLSelect ( "Money", "serial", "serial = '" .. serial .. "'" ) CheckPlayer2= executeSQLSelect ( "DDDM", "serial", "serial = '" .. serial .. "'" ) CheckPlayer3= executeSQLSelect ( "DDAttemps", "serial", "serial = '" .. serial .. "'" ) if ( type( CheckPlayer ) == "table" and #CheckPlayer == 0 ) or not CheckPlayer then executeSQLInsert ( "Money", "'"..serial.."','0','0','0','0'" ) end if ( type( CheckPlayer2 ) == "table" and #CheckPlayer2 == 0 ) or not CheckPlayer2 then executeSQLInsert ( "DDDM", "'"..serial.."','0','0'" ) end if ( type( CheckPlayer3 ) == "table" and #CheckPlayer3 == 1 ) or not CheckPlayer3 then executeSQLInsert ( "DDAttempts", "'"..serial.."','1','1'" ) end end addEvent("onClientReady",true) addEventHandler("onClientReady",getRootElement(),ClientReady) function DestructionMoney(mapInfo,mapOptions,gameOptions) info = mapInfo.modename if mapInfo.modename == "Destruction derby" then local players = getElementsByType("player") for k,v in ipairs(players) do local serial = getPlayerSerial(v) local DDAttempts = executeSQLSelect ( "DDDM", "DDAttempts","serial = '" .. serial .. "'") DDAttempts = tonumber(DDAttempts["DDAttempts"]) + 1 executeSQLUpdate ( "DDDM", "DDAttempts = '"..DDAttempts.."'","serial = '" .. serial .. "'") setElementData(v,"data.DDAttempts",DDAttempts,true) end end end function DestructionMoney2(thePlayer) local playername = getPlayerName(thePlayer) local serial = getPlayerSerial(thePlayer) local Cash = executeSQLSelect ( "Money", "Cash","serial = '" .. serial .. "'") outputChatBox("*Wins: "..playername.." took $"..get('MoneyForDD').." for winning the map!",getRootElement(),255,255,0) Cash = tonumber(Cash[1]["Cash"]) + get('MoneyForDD') setElementData(thePlayer ,"Cash", Cash) setElementData(thePlayer ,"data.money",Cash,true) setElementData(thePlayer ,"data.playername",playername,true) executeSQLUpdate ( "Money", "Cash = '"..Cash.."'","serial = '" .. serial .. "'") end function hunterBonus(pickupID, pickupType, vehicleModel) if info == "Destruction derby" then if pickupType == "vehiclechange" then if vehicleModel == 425 then local serial = getPlayerSerial(source) local Cash = executeSQLSelect ( "Money", "Cash","serial = '" .. serial .. "'") Cash = tonumber(Cash[1]["Cash"]) + 1000 outputChatBox("*Hunter: "..getPlayerName(source).." gets a $1000 hunter bonus!",source,25,125,225) setElementData(source ,"Cash", Cash) setElementData(source ,"data.money",Cash,true) executeSQLUpdate ( "Money", "Cash = '"..Cash.."'","serial = '" .. serial .. "'") end end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),hunterBonus) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports.scoreboard:addScoreboardColumn("Cash") end) addEventHandler("onMapStarting", getRootElement() , DestructionMoney) ERROR: cashddDMKHD\cashdddm.lua:38: attempt to index field '?' (a nil value) Why is this so?