-
Posts
62 -
Joined
-
Last visited
Everything posted by ~Air
-
No, but I think that doesn't matter because it's just a text. e: FIXXED IT, close it.
-
Sorry for bump, hope it's allowed.
-
winner = dxText:create("" ..getPlayerNametagText(player).." #FFFFFFis the final survivor!", x/2, y/2 -150 + 1, false, "default-bold", 1.65, "center") Hmm, don't know It worked some weeks ago, I didn't change anything.
-
winner:visible(false)
-
Not really. But I found this one: Attempt to index global 'winner' (a nil value)
-
Hey guys, I got a problem, when somebody wins the text doesn't get removed.. (it's only at last survivor, the wintext works perfectly) Here's the code: addEvent("onWins", true) function drawNexMapString(player,wintext) local x, y = guiGetScreenSize() if wintext == "none" then else winnertext = dxText:create(wintext, x/2, y/2 -180 + 1, false, "default-bold", 1.65, "center") winnertext:type('shadow', 1.3,1) winnertext:font("default-bold") setTimer( function() winnertext:visible(false) end, 5000, 1) end winner = dxText:create("" ..getPlayerNametagText(player).." #FFFFFFis the final survivor!", x/2, y/2 -150 + 1, false, "default-bold", 1.65, "center") winner:type('shadow', 1.3,1) winner:font("default-bold") end setTimer( function() winner:visible(false) end, 5000, 1) addEventHandler("onWins", getRootElement(), drawNexMapString)
-
Thanks! But now I get this error: Expected element at argument 1 Line: if ( getAccountData ( account, "chatc" ) and getElementData ( source, "Vip" ) == true ) then
-
I changed 'source' to 'player' but it still doesn't work.
-
Thanks it worked! And I got one Language-chatbug I hope you can help me. ( I used account but I don't know why it doesn't work.) Errors: Bad argument @getPlayerAccount [expected account at argument 1, got boolean] Bad argument @isGuestAccount [expected account at argument 1, got boolean] Bad argument @getAccountData [expected account at argument 1, got boolean] Code: function LanguageChat(thePlayer, cmd, ...) local msg = table.concat({...}, " ") for _,players in ipairs(getElementsByType("player")) do local r, g, b = getPlayerNametagColor (thePlayer) local name = getPlayerName(thePlayer) local mycountry = exports.admin:getPlayerCountry(thePlayer) local playerscountry = exports.admin:getPlayerCountry(players) if (playerscountry == mycountry) then if (msg and msg ~= "") then local account = getPlayerAccount ( source ) if ( not isGuestAccount ( account ) ) then if ( getAccountData ( account, "chatc" ) and getElementData ( source, "Vip" ) == true ) then local color = getAccountData ( account, "chatc" ) for i,team in ipairs(getPlayersInTeam(getPlayerTeam(source))) do local r,g,b = getTeamColor(getPlayerTeam(source)) if ( r ) and ( g ) and ( b ) then outputChatBox("("..mycountry.."): "..RGBToHex(r,g,b)..""..name.."#ffffff: ".. color .. ""..msg.."",players,255, 255, 255,true) end end end end end end end end addCommandHandler("Language",LanguageChat) addEventHandler("onPlayerJoin",root, function () bindKey(source,"L","down","chatbox","Language") end ) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"L","down","chatbox","Language") end end ) Hope you can help me at this one too, I am very new to scripting sorry for those annoying questions.
-
No it isn't because of the messagetype. Normal chat = 0 thats right. But the problem is when I am in no team and write something in the normal chat I get those errors.
-
Oh no.. you didn't understand it. Don't close it. This is the normal chat and it should be. But the problem is: Players without team can't write in the normal chat because of that errors!
-
Oh damn, haha didn't notice it because I copied it from my other script :D Thank you ! //closerequest
-
Yes because it is the normal chat. User should be able to write in the normal chat too. I already did one for the team.
-
Hey guys, when I am in no team and I press 'T' it doesn't show a message in the chatbox it gives an error out in the debugscript. Errors: 1. Bad argument @ 'getPlayersInTeam' [Expected 'team' at argument 1, got boolean] 2. bad argument #1 to 'ipairs' (table expected, got boolean) Code: local function playerChat(message, messageType) if messageType == 0 then cancelEvent() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then if getAccountData(acc,"chatc") and getElementData(source, "Vip") == true then local color = getAccountData(acc,"chatc") for i,team in ipairs(getPlayersInTeam(getPlayerTeam(source))) do local r,g,b = getTeamColor(getPlayerTeam(source)) if ( r ) and ( g ) and ( b ) then outputChatBox("(ALL): "..RGBToHex(r,g,b)..""..getPlayerName(source)..": "..color..""..message, root, 255, 255, 255, true ) else outputChatBox("(ALL): "..RGBToHex(r,g,b)..""..getPlayerName(source)..": #FFFFFF"..message, root, 255, 255, 255, true ) end end else outputChatBox("(ALL): "..RGBToHex(r,g,b)..""..getPlayerName(source)..": #FFFFFF"..message, root, 255, 255, 255, true ) end outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end end addEventHandler("onPlayerChat", root, playerChat)
-
I have got one more problem but at one other script: I had lots of tries to fix it but it still doesn't work. (end expected near else) Here is the script: function setDiscoLights () local bougheadlights = getAccountData(account,"boughtHeadlights2") if not bougheadlights then if cash >= 10000 or (getElementData(source, "Vip") and cash >= 5000) then setTimer(outputChatBox,50,1,"* #FFFFFF"..getPlayerName(source).."#FFFFFF bought Disco-Headlights!",getRootElement(),0,255,0,true) if getElementData(source, "Vip") == true then addStat(account, "cash", -5000) else addStat(account, "cash", -10000) end setAccountData(account, "DiscoLights",true) setAccountData(account, "boughtHeadlights2",true) end else outputChatBox ("* #FFFFFFYou don't have got enough money!",source,unpack(scriptcol[5])) cancelEvent() else outputChatBox ("* #FFFFFFYou already have bought Disco-Headlights!",source,unpack(scriptcol[5])) cancelEvent() end addEvent("setDiscoLights",true) addEventHandler("setDiscoLights",getRootElement(),setDiscoLights)
-
Yes it works perfectly
-
Thanks to Anubhav, it worked!
-
Still same error
-
Hey guys, I am back with an another problem and I already tried it 100 of times to fix it. Maybe I am to retarded for it. I hope you can help me... Code: --NEW CODE-- Scroll down
-
I haven't tried it yet, but I think this will stay for ever how can I cancel that, that the CameraMatrix will get removed after downloading?
-
And how does that work?
-
Hey guys, how is it able to show a place while the player is downloading? I got this already: setCameraMatrix( -1360, 1618, 100, -1450, 1200, 100) setSkyGradient( 60, 100, 196, 60, 100, 196 ) setTime(21,00) setWeather(3) showChat(false)
-
That's my code (race-pickup), no error but still not working: function racevehicleenter ( player, seat, jacked ) local acc = getPlayerAccount(player) if not isGuestAccount ( acc) then if getAccountData(acc,"r1") then local r1 = tonumber(getAccountData(acc,"r1")) local r2 = tonumber(getAccountData(acc,"r2")) local g1 = tonumber(getAccountData(acc,"g1")) local g2 = tonumber(getAccountData(acc,"g2")) local b1 = tonumber(getAccountData(acc,"b1")) local b2 = tonumber(getAccountData(acc,"b2")) setVehicleColor(source,r1,g1,b1,r2,g2,b2) end if getAccountData(acc,"wheels") then addVehicleUpgrade(source,tonumber(getAccountData(acc,"wheels"))) end if getAccountData(acc,"lr" ) then local r = tonumber(getAccountData(acc,"lr")) local g = tonumber(getAccountData(acc,"lg")) local b = tonumber(getAccountData(acc,"lb")) setVehicleHeadLightColor(source,r,g,b) end end end addEventHandler ( "onVehicleEnter", getRootElement(), racevehicleenter ) addEvent('onPlayerPickUpRacePickup') addEventHandler('onPlayerPickUpRacePickup', getRootElement(), function(number, sort, model) if sort == "vehiclechange" then local acc = getPlayerAccount(source) if not isGuestAccount ( acc) then if getAccountData(acc,"r1") then local r1 = tonumber(getAccountData(acc,"r1")) local r2 = tonumber(getAccountData(acc,"r2")) local g1 = tonumber(getAccountData(acc,"g1")) local g2 = tonumber(getAccountData(acc,"g2")) local b1 = tonumber(getAccountData(acc,"b1")) local b2 = tonumber(getAccountData(acc,"b2")) setVehicleColor(getPedOccupiedVehicle(source),r1,g1,b1,r2,g2,b2) if getAccountData(acc,"wheels") then addVehicleUpgrade(source,tonumber(getAccountData(acc,"wheels"))) end end end end end )
