Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. drk

    small problem

    Server-side: local marker1 = createMarker ( 131, 68, 2 ) addEventHandler ( 'onMarkerHit', root, function ( player, marker ) if ( isElementWithinMarker ( player, marker1 ) ) then triggerClientEvent ( 'onMarker1Hit', localPlayer ) end end ) Client-side: addEvent ( 'onMarker1Hit', true ) addEventHandler ( 'onMarker1Hit', root, function ( ) guiSetVisible ( shopWindow, true ) end ) If not work, please explain what.
  2. getColorFromString? Get the color from your nick and set same color in vehicle.
  3. @@GanJaRuleZ It's possible but LuaDec convert MTA:SA scripts to Lua. Then you need to change function arguments, fix some errors and events will not appear. Why use it ?
  4. @@SoiiNoob He wants a decompiler, not a compiler.
  5. Download LuaDec for Lua 5.1 If you need help go to Skype
  6. drk

    GUI Label Colorcodes

    Yeah, and the problem isn't Race mode. Problem isn't there, and it isn't getPlayerName ( player, 'hex' ), it's getPlayerName ( player, boolHex ).
  7. Yeah, if you leave the server and another player joins, when you join again your ID will change.
  8. You can use a variable with a boolean value to see if player is in the event, then your respawn system will only kill and spawn player if the player isn't in a event. But you will need to put all in the same script.
  9. drk

    GUI Label Colorcodes

    Sorry for replying the post again... I tried guiCreateColorLabel function from the forum and It don't work. It only display the first colored text. The only one who works is dxDrawColorText. Maybe I will need to create my custom functions
  10. Of Windows Server 2008. Install Windows Server 2008 R2 Standard.
  11. Dedicated server = Dedicated machine. Dedicated machine is a real machine who can be controlled by remote and it's 24H online. Why the files have to be different on a Dedicated server? For the timed out problem try installing the standard version. If it continues then the problem is the machine because I have Windows Server 2008 too and It works perfectly.
  12. Hi all! Today I will show you how to create a simple noob ID system ( this is only for begginers ). Now, starting the script: Create a .lua file. Open it. Now we will create a table "ID" and handle a event to on the resource start add a column where will show the players ID. executeSQLQuery [[ CREATE TABLE IF NOT EXISTS ID ( player TEXT, id NUMBER ) ]] addEventHandler ( "onResourceStart", resourceRoot, function ( ) end ) Done! Event handled. Now we will use function call to add a scoreboard column Write this: executeSQLQuery [[ CREATE TABLE IF NOT EXISTS ID ( player TEXT, id NUMBER ) ]] addEventHandler ( "onResourceStart", resourceRoot, function ( ) call ( getResourceFromName ( "scoreboard" ), "addScoreboardColumn", "ID List" ) -- We will call 'scoreboard' resource and use addScoreboardColumn to add a new column to the scoreboard end ) Where "scoreboard" is your scoreboard resource name. Ok. Now we will use a for-loop to get all player elements. executeSQLQuery [[ CREATE TABLE IF NOT EXISTS ID ( player TEXT, id NUMBER ) ]] addEventHandler ( "onResourceStart", resourceRoot, function ( ) call ( getResourceFromName ( "scoreboard" ), "addScoreboardColumn", "ID List" ) -- We will call 'scoreboard' resource and use addScoreboardColumn to add a new column to the scoreboard for i,v in ipairs ( getElementsByType "player" ) do -- For-loop end ) Now we need only to set ID List column text and save data to the SQL Table. executeSQLQuery [[ CREATE TABLE IF NOT EXISTS ID ( player TEXT, id NUMBER ) ]] addEventHandler ( "onResourceStart", resourceRoot, function ( ) call ( getResourceFromName ( "scoreboard" ), "addScoreboardColumn", "ID List" ) -- We will call 'scoreboard' resource and use addScoreboardColumn to add a new column to the scoreboard for i,v in ipairs ( getElementsByType "player" ) do -- For-loop local sel = executeSQLQuery [[ SELECT * FROM ID WHERE player = '"..getPlayerName(v).."' ]] if ( not sel or #sel == 0 ) then executeSQLQuery [[ INSERT INTO ID VALUES ( '"..sel[1]['player'].."', '"..tostring(id).."' ) ]] setElementData ( v, "ID List", tostring ( i ) ) else setElementData ( v, "ID List", tostring ( i ) ) end end -- end the for-loop end -- end function ) Almost done. Now we need to set the id of new player when join. addEventHandler ( "onPlayerJoin", root, function ( ) local sel = executeSQLQuery [[ SELECT * FROM ID WHERE player = '"..getPlayerName(source).."' ]] if ( not sel or #sel == 0 ) then for i,v in ipairs ( getElementsByType "player" ) do executeSQLQuery [[ INSERT INTO ID VALUES ( '" .. getPlayerName ( source ) .. "', '"..tostring(_).."' ) ]] setElementData ( source, "ID List", tostring(i) ) end else setElementData ( source, "ID List", sel[1]['player'] ) end end ) Ok. All done. Complete code: executeSQLQuery [[ CREATE TABLE IF NOT EXISTS ID ( player TEXT, id NUMBER ) ]] addEventHandler ( "onResourceStart", resourceRoot, function ( ) -- declare function call ( getResourceFromName ( "scoreboard" ), "addScoreboardColumn", "ID List" ) -- We will call 'scoreboard' resource and use addScoreboardColumn to add a new column to the scoreboard for i,v in ipairs ( getElementsByType "player" ) do -- For-loop local sel = executeSQLQuery [[ SELECT * FROM ID WHERE player = '"..getPlayerName(v).."' ]] if ( not sel or #sel == 0 ) then executeSQLQuery [[ INSERT INTO ID VALUES ( '"..sel[1]['player'].."', '"..tostring(id).."' ) ]] setElementData ( v, "ID List", tostring ( i ) ) else setElementData ( v, "ID List", tostring ( i ) ) end end -- end the for-loop end -- end function ) addEventHandler ( "onPlayerJoin", root, function ( ) local sel = executeSQLQuery [[ SELECT * FROM ID WHERE player = '"..getPlayerName(source).."' ]] if ( not sel or #sel == 0 ) then for i,v in ipairs ( getElementsByType "player" ) do executeSQLQuery [[ INSERT INTO ID VALUES ( '" .. getPlayerName ( source ) .. "', '"..tostring(_).."' ) ]] setElementData ( source, "ID List", tostring(i) ) end else setElementData ( source, "ID List", sel[1]['player'] ) end end ) Don't know how to create the XML? <meta> <info author = 'Your name' description = 'Description goes here' version = 'Version goes here' type = 'Type: misc / script / map / gamemode' /> <script src = 'file.lua' type='server' /> </meta> Ok. All done. If you do not understand, you can use my Resource Creator ^^ If you have any problems, don't hesitate to contact us. And next time, I will try to make a better tutorial
  13. Lua is Canse Sensitive. OnPlayerWasted is nil. It's onPlayerWasted
  14. Hum, good ._. I never seen this function
  15. LOL You can't set the veh color with a hex color. Search for the hex color RGB code and use setVehicleColor
  16. drk

    Again Help

    https://wiki.multitheftauto.com/ http://lua-users.org/wiki/TutorialDirectory
  17. I don't know the right color but it's like this: #ff4500
  18. The problem is solved, no need anymore Winky
  19. drk

    Scoreboard help

    Go to Admin Panel -> Resources -> Select resource dxscoreboard or scoreboard ( or what your scoreboard name is ), click in Config and set Allow color coded names to true.
  20. drk

    all vehicles freeze

    Yeah, this is what I tried to say @@Cx.83 If is this what you want, you can get the position where you want the car and use createVehicle. Then use setElementFrozen or if you want like many maps you can try setElementColisionsEnabled ( I think is it ).
  21. drk

    all vehicles freeze

    @@Solidsnake14 Maybe he don't want to set all vehicles frozen? Maybe he want to create a vehicle in the map and set it frozen like a "Ghost car", you understand what I want to say by "Ghost car" no?
  22. drk

    Is this possible?

    addEventHandler ( 'onPlayerLogout', root, function ( _, account ) if ( account and not isGuestAccount ( account ) ) then local joinTime = getElementData ( _, 'joinTime' ) setAccountData ( account, 'joinTime', joinTime ) end end )
  23. I'm trying to compile MTA:SA on Windows but I get error "c:\users\twitter\desktop\mtasa-blue\mta10\core\stdinc.h(11) : fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory" d3dx9.h isn't in source code I downloaded three times and don't work. I tried another downloader and don't work too.
×
×
  • Create New...