Jump to content

Jockie

Members
  • Posts

    68
  • Joined

  • Last visited

Everything posted by Jockie

  1. Hey guys, The dxSetBlendMode is usefull for drawing things, but does not really draw something like I want. Currently I try to draw a loading icon on a white background, the texture size is 256x256. All the 4 blend modes gives almost the same result, but still, they're not close enough of what I want. Does someone know how to solve this? ^^ EDIT: Forgot to tell how it's drawn: The loading icon is drawn on a texture with 'modulate_add', which get drawn with 'modulate_add' on another texture, which get drawn with 'add' onto the screen. The background is directly drawn on the screen with 'blend'. Grtz, Jockie
  2. Hey guys, Currently I'm trying to find out how to remove players from the Race gamemode. What I would like to achieve is making it possible to remove players from the race resource when it asks for removal, plus some delay of joining at start(log-in menu shows up at start) _joiner.lua 'says' that onPlayerJoin sends the player to the joining group, so I changed that event name to the event I use in an other script for importing the player into race. I've also tried patching the four functions. Paste: http://pastebin.com/X6hmZRUz (exports.uag_RacePlayers:getRacePlayers returns a table of the players that 'should' be in the race gamemode.) Furthermore, I also edited onlyJoined(), changing g_Root => g_RootPlayers But when running all these edited lines, it just runs like a normal race gamemode. If someone knows how to make this possible, please tell me. ^^
  3. Lmao.. Should've read that tiny note at the Wiki Page before posting. Thanks. =P
  4. Currently I'm working on a radio player with a dropdown combo box for the choosing between genres. I've inserted every genre in a table and run for them seperatly guiComboBoxAddItem. But somehow this doesn't work at all. Even when I try to use this syntax: comboBox = guiCreateComboBox(200, 200, 288, 24, "Fruit", false) guiComboBoxAddItem(comboBox,"Apple") guiComboBoxAddItem(comboBox,"Banana") After clicking on the combo box it just shows a tiny white bar of 1 pixel high. It's just like this function doesn't work (for me)? Greetings, Jockie
  5. *bump* But does someone know a working glow/bloom shader? This seems valid also, but the only error I get is: ID3DXEffectCompiler::CompileEffect: There was an error compiling expression ID3DXEffectCompiler: Compilation failed @ The last PixelShader technique
  6. Jockie

    HLSL help

    @ Line 20 try: newColor.a = 0.0f;
  7. Jockie

    HLSL help

    I have also sometimes a strange unknown error: ID3DXEffectCompiler::CompileEffect: There was an error compiling expression ID3DXEffectCompiler: Compilation failed When I just try to compile with Pixel Shader 1.1 EDIT: Have you tried to add VertexShader = null; above to the PixelShader line?
  8. Jockie

    HLSL help

    I see a small typo @ line 17, you've forgot the ; at the end.
  9. You forgot an "end" and you use tables instead of player elements. local players = getElementsByType ( "player" ) for i, player in ipairs( getElementsByType ( players ) ) if (getPlayerTeam(player) == "Criminals") then outputChatBox ( "I wanna say something only to this team", 255, 0, 0,player) end end EDIT: pairs(getPlayersInTeam(getTeamFromName("Criminals")) works as well, like SolidSnake just posted before me. Grtz. Jockie
  10. @ Line 5: You call the same function in the function, so it gets over-flowed ofcourse. Tip: You're missing some ''end''s. function setElementSpeed(element, unit, speed) if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = setElementSpeed(element, unit) -- Change this if (acSpeed~=false) then local diff = speed/acSpeed local x,y,z = setElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end end return false end -- Missed ''end'' over here end -- And one here addCommandHandler("sspeed", function (player, cmd, arg1) local veh = getPedOccupiedVehicle(player) if (veh) then setElementSpeed(veh, "kph", tonumber(arg1)) else outputChatBox("You have to sit in vehicle", player) end end )
  11. After searching a long time for a valid/good HLSL bloom/glow effect I finally found one @ GameStudio Wiki Other bloom scripts uses a bloom'd image which overwrite the original, so I need this one. The problem is.. it turns the texture into an invisible texture instead of adding the bloom effect. (I know, I'm lazy, but I just started with these HLSL effects 2 days ago) This what I want to reach with it: (And maybe with a sin(Time)) The .fx code is on that Wiki under the C-Script section. This is the LUA script of it: addEventHandler("onClientResourceStart", g_ResourceRoot, function(res) if res == g_Resource then glowTextField = dxCreateRenderTarget(g_ScreenX,g_ScreenY,true) glowShader = dxCreateShader("glowtext.fx") dxSetShaderValue(glowShader , "entSkin1", glowTextField) end end ) addEventHandler("onClientRender", g_ResourceRoot, function() dxSetRenderTarget(glowTextField, true) dxDrawText("Glowing Text", g_ScreenX/2, g_ScreenY/2) dxSetRenderTarget() dxDrawImage(0,0,g_ScreenX,g_ScreenY, glowShader) end ) I've tried to remove all the f's behind the float numbers (?.. newbish solution) and I've also tried to replace the line: float4 vecSkill1; with: float4 vecSkill1 = float4{2.0f, 0.4f, 0.0f, 0.0f}; But that doesn't help neither. Hopefully does someone know how to solve this.. Grtz. Jockie EDIT: I guess I need to use the floatv() function in LUA which isn't available? Or it just changes 1 to 1.0 or 1.0f..
  12. Jockie

    onClientKey

    It would be great if someones want to add to MTA 1.1 (or 1.0.4) Here's the request of it @ Mantis: http://bugs.mtasa.com/view.php?id=3482 This request is there already for like 3 years but it's still not added. I need this so bad for dxDrawText things. Grtz. Jockie
  13. I think he mean this: string.gsub(getPlayerName(thePlayer), "#%x%x%x%x%x%x", "")
  14. Jockie

    MTA_SDK error

    I have a stupid problem that I can't fix... I just want to retrieve the player count, but it won't work.
  15. Jockie

    UDP data messed up

    On the servers where I'm scripting are the data what are available on the UDP connection misplaced. Is it possible to fix this? Server 1 and Server 2 Is it also possible to create other collums with own elementData of the players? (Online DxScoreboard) Grtz. Jockie
  16. I found the problems, those are the "[", "]", "" and "-" in the name. Like [DM] Pr0nOoB - Summer Beach So how to make is saveable and that the "[", "]", "" and "-" will save?
  17. I'm currently stuck with a tiny problem, I want to save every race map name into the database with accountname+stats. But the thing is, it does nothing. No errors in the debugscript, no overheaded data at database. fullname = "test" -- fullname is the name of the map(from a map table) --MySQL > Connection to the database, that works. ;D mysql_query( MySQL, "CREATE TABLE '<databasename>."..fullname.."' ( id INT( 11 ) NOT NULL , name VARCHAR( 255 ) NOT NULL , latest VARCHAR( 255 ) NOT NULL , played VARCHAR( 255 ) NOT NULL , won VARCHAR( 255 ) NOT NULL , latest1 VARCHAR( 255 ) NOT NULL , played1 VARCHAR( 255 ) NOT NULL , won1 VARCHAR( 255 ) NOT NULL , latest2 VARCHAR( 255 ) NOT NULL , played2 VARCHAR( 255 ) NOT NULL , won2 VARCHAR( 255 ) NOT NULL )") mysql_query( MySQL, "ALTER TABLE "..fullname.." ADD PRIMARY KEY ( id )") mysql_query( MySQL, "ALTER TABLE "..fullname.." CHANGE id id INT( 11 ) NOT NULL AUTO_INCREMENT ")
  18. I have this realy small problem, but I can't fix it.. Always says Base out of range. tonumber(string.gsub("$900","$", "")) and also tonumber(string.gsub("$900","$", ""),2) Both returns with nil.
  19. Jockie

    Coins script

    But what if the map is a massive bomb map? EDIT: Solved, used event "onRaceStateChanging" + triggering to client for player > trigger to server for coins, Bug found: The last 2 ranks of the players @ PostFinish are 2. You need to check the winner with getElementData(player, "state") > if alive or finished, winner price. EDIT2: Would be useful to retrieve the mode of the race resource, the Sprint, Base or Destruction Derby things. exports.race:getRaceMode (Because, if the player haven't finished the the race, but is still alive, it gets the coins, now)
  20. Jockie

    Coins script

    Oh thanks both, it works. (Or not..) (>c^.^)>cOokie EDIT: @ Destruction derby, the script doesn't give the player coins when it wins, it have to die after it wins. Also, the script doesn't give the player the coins when it finished the race. Currently I have this: http://mta.pastebin.com/hGSuAmCS
  21. You've forgot a line, how to know the old data of kills. Add between line 3 and 4. zombieKills = getElementData(killer, "zombieKills")
  22. addEvent( "onZombieWasted" ); addEventHandler( "onZombieWasted", getRootElement(), function (killer) zombieKills = 0 givePlayerMoney( killer, 25 ); setElementData (killer,"zombieKills",zombieKills+1) if (getElementData (killer,"zombieKills") == 1) then outputChatBox ("New rank! "..getPlayerName(killer).." is a Noob Killer. He killed 1 zombie.") setElementData (killer,"rank","Noob killer") end end ) ? EDIT: It sets the element data of zombieKills everytime to 1 when you kill a zombie. EDIT2:This will work. addEvent( "onZombieWasted" ); addEventHandler( "onZombieWasted", getRootElement(), function (killer) zombieKills = getElementData(killer, "zombieKills") if (zombieKills == "" or zombieKills == nil or zombieKills == false) then zombieKills = 0 end givePlayerMoney( killer, 25 ); setElementData (killer,"zombieKills",zombieKills+1) if (getElementData (killer,"zombieKills") == 1) then outputChatBox ("New rank! "..getPlayerName(killer).." is a Noob Killer. He killed 1 zombie.") setElementData (killer,"rank","Noob Killer") end end )
  23. You've forgot the " " @ line 6. if (getElementData (killer,zombieKills) == 1) then Turn into: if (getElementData (killer,"zombieKills") == 1) then EDIT: Also mentioned something else, you haven't set something on noobKiller @ line 8. Maybe you need to change it to: setElementData (killer,"rank","Noob killer") TIP: Use at the front of the script instead of [code].
×
×
  • Create New...