-
Posts
21 -
Joined
-
Last visited
Everything posted by Vinspire
-
Hello folks, I'd like to use getElementData & set to enable/disable spectatorkill with this function but I have no clue how to do it tbh. Could any of you edit the lua below to show me how you do it? addEvent("onRaceStateChanging") addEventHandler("onRaceStateChanging", root, function (newState) if newState == "Running" then local theSpectatorTeam = getTeamFromName("Spectators") if ( theSpectatorTeam ) then local players = getPlayersInTeam ( theSpectatorTeam ) for key, player in ipairs ( players ) do local theVehicle = getPedOccupiedVehicle ( player ) if ( theVehicle ) then blowVehicle(theVehicle,false) setElementPosition(getPedOccupiedVehicle(thePlayer), 0, 0, 0) setElementHealth(thePlayer, 0) end end end end end) Thanks
-
Something like this? .. (sorry I didn't really get what you mean (shit scripter <-) function cTime(theCommand, timeID) local timeID= tonumber(timeID) local sTime = setTime(timeID) if (sTime ~= false) then end end addCommandHandler("cst", cTime) addCommandHandler("csettime", cTime)
-
Thanks guys, . If you could help me setting the time too that would be best doesn't work too, doesn't say much on this on the wiki so =/ What I want with this code is that players can set their own time on their screen for better graphic or other reasons. addEventHandler( 'onClientRender', getRootElement( ), function (csettime) local hour, minutes = getTime() setTime( 1, 0 ) end ) addCommandHandler('cst', csettime) Thanks!
-
That doesn't work ;s
-
Hello guys, the code below is an attempt of trying to set your own weather on your screen with the command csw. What I thought of here is that if you do => E.g: "/csw 0" then you get the normal weather, /csw 1 = sun, /csw 2 = foggy, and so on to 250 or so, (idk the max weather list) Could you help me a bit with this? doesn't work perfectly now. It's because it sets randomly weathers when you do /csw. I don't want it to set randomly, I want the thing above. Do you think you could help? if so Thanks alot. addCommandHandler('csw', function ( ) setWeather(math.random (0, 9 ) ) local Weather = getWeather () outputChatBox("The weather is currently: "..Weather, source) end )
-
Thanks mate Will do.
-
The weather works partly, could you make it not random weathers? if I do e.g: /csw 1 " then it's sun on my screen? The /cst is already stock in the game when you're doing /time, but my point was making it e.g: /cst 11 43 then it get's the night color on the screen, if I do /cst 06 00 then it gets the light color because it's morning ingame. Could you try to make it like that? Thanks!
-
Tried to fix how to set time with a command too, (goes under the same category) Doesn't work. addEventHandler( 'onClientRender', getRootElement( ), function (csettime) local hour, minutes = getTime() setTime( 1, 0 ) end ) addCommandHandler('cst', csettime)
-
That worked, the only problem is that (9) is only foggy weather, so I tried to do something like this to get all possible weathers ~~ addCommandHandler('csw', function ( ) setWeather(0) setWeather(1) setWeather(2) setWeather(3) setWeather(4) setWeather(5) setWeather(6) setWeather(7) setWeather(8) setWeather(9) local Weather = getWeather () end ) ^ didn't work.
-
Hello guys, I'm wondering if you have any great ideas how to set the weather different with the setWeather code? does it work? (with a command) E.g: --shitcode123 function csw() local time = setWeather setWeather () outPutChatbox ('New weather set to '..weather.., source) addCommandHandler("csw", csw) Something like this? random shit example Thanks!
-
Greetings, I'm the leader of MGK and we just got a Destruction Derby server. I'm posting this topic because if you're looking for a new DD server, we would be more than happy for your visit! Currently the population is low, but you can make it higher! We have good scripts and a good host. (Old SMT 1.0 scripts and host) We will probably have a DM, FDD, and a RACE server soon. I'll mention a little piece of the scripts below. * Stats panel - Kills, wins, K/D ratio, score, points +++++ * Settings panel -Nitro, graphic, scoreboard, hud * Road textures * Shaders - NOS shader, car shader, water shader ++ * Top - Sort of a panel showing who has the most win on the map that's started, and if you do !top wins it says who has them most total wins on the server, !top kills, !top points and so on too. * You can buy maps that's displayed on a panel, for money ingame. * PM Script * (if) You can easily join the FDD, DM DD or RACE Server by typing simple commands !fdd, !dm, !dd, !race and you're getting directly joined to the command you're typing. * That's just a LITTLE piece of the scripts thats in the server(s), it doesn't feel right to say this, because it's just a little piece of the server as said. If you want to us then you can either write in the comment box below or text me on skype chrismta1. If you're interested in having rights in the server (admin levels) then you should contact us! Visit us! mtasa://178.248.250.97:22016 Kind regards, MGK Team. Laying a picture of me on the server below
-
That doesn't work too man This is what I mean about how it's supposed to be: http://i62.tinypic.com/2q1v5w8.png http://i58.tinypic.com/2cz7kg2.jpg Thanks!
-
It's supposed to be 1 rectangle with the visitName and homeName inside of it, and when I do /tsn 1-2 awdawdawdwdaawddawd then the rectangle should be the same length as the text length
-
function drawText() local width = dxGetTextWidth(hexColorHome..homeName.."("..homeAlivePlayers.."):".."#ffffff "..displayHome, 1, 'default-bold') local width = dxGetTextWidth(hexColorVisit..visitName.."("..visitAlivePlayers.."):".."#ffffff "..displayVisit, 1, 'default-bold') dxDrawRectangle(sW-90,(sH/2)-50,width,40, tocolor(0,0,0,110)) dxDrawText ( hexColorHome..homeName.."("..homeAlivePlayers.."):".."#ffffff "..displayHome, sW-80, (sH/2.26), sW, sH, tocolor(255, 102, 1, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) dxDrawText ( hexColorVisit..visitName.."("..visitAlivePlayers.."):".."#ffffff "..displayVisit, sW-80, (sH/2.17), sW, sH, tocolor(255, 0, 0, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) end addEventHandler("onClientRender", root, drawText) Like this yes? That doesn't work =/ When I do /tsn 1 awdawdawdawd then it doesn't change width of the rectangle (or /tsn 2)
-
local width = dxGetTextWidth(drawText) dxDrawRectangle(0, 0, width, 20) function drawText() dxDrawRectangle(sW-90,(sH/2)-50,70,40, tocolor(0,0,0,110)) dxDrawText ( hexColorHome..homeName.."("..homeAlivePlayers.."):".."#ffffff "..displayHome, sW-80, (sH/2.26), sW, sH, tocolor(255, 102, 1, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) dxDrawText ( hexColorVisit..visitName.."("..visitAlivePlayers.."):".."#ffffff "..displayVisit, sW-80, (sH/2.17), sW, sH, tocolor(255, 0, 0, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) end addEventHandler("onClientRender", root, drawText) Would this do?
-
local sW, sH = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function() dxDrawImage(sW-35, (sH/2.26), 12, 12, ":ccw/skull.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(sW-35, (sH/2.16), 12, 12, ":ccw/comments.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end ) displayHome=0 displayVisit=0 ALPHA = 0 RED, GREEN,BLUE = 255, 255, 255 homeName="l" visitName="i" homeAlivePlayers=0 visitAlivePlayers=0 hexColorHome = "#0080FF" hexColorVisit = "#0080FF" hexColorRounds = "#FFFF00" addEvent("sync:shiet", true) addEventHandler("sync:shiet", root, function(R, G, B, A) RED, GREEN, BLUE, ALPHA = R, G, B, A end) function displayPoints(home, visit) displayHome=home displayVisit=visit end addEvent("sync:points", true) addEventHandler("sync:points",root,displayPoints) function displayAlive(home, visit) homeAlivePlayers=home visitAlivePlayers=visit end addEvent("sync:alive", true) addEventHandler("sync:alive",root,displayAlive) function setNames(home, visit) homeName=home visitName=visit end addEvent("sync:names", true) addEventHandler("sync:names",root,setNames) function setColors(home,visit,rounds) hexColorHome = home hexColorVisit = visit hexColorRounds = rounds end addEvent("sync:colors", true) addEventHandler("sync:colors",root,setColors) function drawText() dxDrawRectangle(sW-90,(sH/2)-50,70,40, tocolor(0,0,0,110)) dxDrawText ( hexColorHome..homeName.."("..homeAlivePlayers.."):".."#ffffff "..displayHome, sW-80, (sH/2.26), sW, sH, tocolor(255, 102, 1, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) dxDrawText ( hexColorVisit..visitName.."("..visitAlivePlayers.."):".."#ffffff "..displayVisit, sW-80, (sH/2.17), sW, sH, tocolor(255, 0, 0, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) end addEventHandler("onClientRender", root, drawText)
-
Hello, I've been struggling with this for weeks now and I'd really love to get it to work (which I dont) The problem are the following: /tsn 1 = team set name homeName /tsn 2 = team set name visitName The lua code below is what I have, and when I do /tsn 1or2 awdawdawddawwdawd the rectangle width should follow the homeName or visitName, depends on if you do /tsn 1 or 2.. If any of you could help me with this, I'd be so thankful, I guess I have to use dxGetTextWidth but I have no idea how. function drawText() dxDrawRectangle(sW-90,(sH/2)-50,70,40, tocolor(0,0,0,110)) dxDrawText ( hexColorHome..homeName.."("..homeAlivePlayers.."):".."#ffffff "..displayHome, sW-80, (sH/2.26), sW, sH, tocolor(255, 102, 1, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) dxDrawText ( hexColorVisit..visitName.."("..visitAlivePlayers.."):".."#ffffff "..displayVisit, sW-80, (sH/2.17), sW, sH, tocolor(255, 0, 0, 255), 1, "default-bold", 'right', 'center', false, false, false, true, true, 0, 0, 0) end addEventHandler("onClientRender", root, drawText) Thanks alot!
-
That works, but that's not the point, 1 problem solved. The real thing is to make the drawed rectangle in the drawtext function FOLLOW the homeName and visitName as you can see. so when the homeName = awd) then the rectangle should fit the homeName. when homeName = wadesrthfytgrfedwsaesfrgth) then the rectangle should fit the homeName. dxGetTextWidth, the rectangle's lenght should be dxGetTextWidth thing, (I THINK THAT'S THE SOLUTION, BUT I DON'T KNOW HOW TO MAKE IT LIKE THAT) ^, that's my problem. Thanks Regards, chris
-
Hello, I'm stuck at some place I really don't know what to do at this point. It's a clanwar script for race. I drawed a rectangle that the points&name for the enemyteam and hometeam should be placed in, and I need to use dxGetTextWidth incase the names are too long to fit to the rectangle. /tsn 1 = team set new name for the hometeam. When I do /tsn 1 awdawdawdawdawd for example, then the name goes outside the rectangle. So the rectangle length should be = dxGetTextWidth, I hope you get it. local maiFont = "default-bold" local myText = "" local scale = sW/800 local width, height = dxGetTextWidth(myText, scale, maiFont)+10, dxGetFontHeight(scale, maiFont)+4 function drawText() dxDrawRectangle(sW-90,(sH/2)-50,70,40, tocolor(0,0,0,110)) dxDrawText ( hexColorHome..homeName.."("..homeAlivePlayers.."):".."#ffffff "..displayHome, sW-80, (sH/2.26), screenWidth, screenHeight, tocolor ( 255, 102, 1, 255 ), 1, "default-bold", nil, nil, nil, nil, nil, true) dxDrawText ( hexColorVisit..visitName.."("..visitAlivePlayers.."):".."#ffffff "..displayVisit, sW-80, (sH/2.17), screenWidth, screenHeight, tocolor ( 255, 0, 0, 255 ), 1, "default-bold", nil, nil, nil, nil, nil, true ) end addEventHandler("onClientRender",root,drawText) I have no idea what should stand in the myText, obviously 'drawText' if it could.. Thanks!