
t3wz
Members-
Posts
149 -
Joined
-
Last visited
Everything posted by t3wz
-
Make sure that the script is in the right type (server) Make sure that there's no other resources which sets the player's skin (spawnmanager etc) Also don't use 1LoL1/ozulus' code, setPedSkin is a deprecated function.
-
Well, i have made a dxGridlist, if you want here is the topic about it, hope it helps.
-
Thanks guys What you mean? explain better.
-
dxGridlists Code used in the video: This framework allows you to make gridlists with dxs, The gridlists works like the default CEGUI system so you won't have a lot of work to adapt your code for this framework. Note that the core is writed in the OOP format (using metatables, not the MTA default system) so you have to write your scripts in this format too, The self for all functions should be the gridlist which you want to perform an action and not something else. You're free to fork, edit and use this as you want, but sell it or remove the author's name isn't permitted, Also pull requests to improve the code are welcome Fell free to contact me if you have any questions or something else. How to use To use this you have to download and include the main file within your project folder and add it to the meta.xml file, After this you can use all the functions that are listed in the documentation page. Download GitHub Documentation The documentation can be found at the project wiki, There also examples there. __ Sorry if there's some grammar errors, my english isn't that good
-
getVehicles is returning a boolean so you don't have any table in the vehLists function. function getVehicles(accountname) local query = dbQuery(connection, "SELECT * FROM vehicles_table WHERE username = '".. tostring(accountname) .."'LIMIT 1" ) local result = dbPoll(query, -1) if type(result) == "table" then return result else return {} end end
-
You don't need to return anything, dbPoll is used to get the result of a dbQuery. obs: if you're calling checking() in another function then the return is necessary
-
You have to check if getPlayerTeam don't returned false, after this you get the team name.
-
The error is self explanatory, add the resource to the ACL.
-
This code can be simplified, define thousand functions for the timers isn't needed. relog = {} function outputChange(dataName,oldValue) if getElementType(source) == "player" and dataName == "blood" then local newValue = getElementData(source,dataName) if ( newValue - oldValue ) < 0 then local time = getRealTime() if relog[source] and relog[source] and isTimer ( relog[source] ) then killTimer ( relog[source] ) end relog[source] = setTimer ( function(player) local _, seconds = getTimerDetails ( sourceTimer ) local seconds = seconds -1 if seconds ~= 0 then outputChatBox ( "Antirelog: "..seconds.." seconds left",player,255,69,0) else outputChatBox ( "Antirelog: You can disconnect now", player, 255, 69, 0 ) relog[player] = nil end end , 1000, 16, source ) end end end addEventHandler("onElementDataChange",getRootElement(),outputChange) function antiQuitPlayer ( quitType ) if quitType == "Quit" or quitType == "Timed out" then if relog[source] and isTimer ( relog[source] ) then killTimer ( relog[source] ) relog[source] = nil --banPlayer ( source, false, false, true, nil, nil, 3600 ) local playerAccount = getPlayerAccount(source) if ( playerAccount ) then setAccountData(playerAccount,'blood',-55) end end end end addEventHandler ( "onPlayerQuit", getRootElement(), antiQuitPlayer )
-
make the timer's variable global. timer = setTimer ........
-
aclGetGroup has only one parameter, you've to do other check (with or) for co-owners. if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup('Owner')) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup('Co-Owner')) then
-
19641 is a SAMP object and doesn't exists in MTA, so you can't use it unless you convert it using the Engine functions.
-
onClientResourceStart
-
It doesn't works because the source of the onClientPlayerVehicleEnter is "the player that entered the vehicle", To set the color of the vehicle you'll need something like this: addEventHandler ("onClientPlayerVehicleEnter", function ( vehicle ) setVehicleColor ( vehicle, 255, 255, 255 ) end ) more info at the wiki.
-
In Lua . means all characters so you have to use %. to detect dots. ip = getPlayerIP ( player ):gsub ( "%.", "" ) more info here.
-
in the newValue variable you're increasing nil with + 0.05 (this will cause an error on /debugscript) also source isn't defined on the timer's function, you have to make a loop with all players and then increase him reputation.
-
Nope, the dx* functions need to be in a render event, so adding it to the event "onClientResourceStart" will not work, In this event you use addEventHandler ( "onClientRender", ... addEventHandler( "onClientResoureStart", resourceRoot, function() addEventHandler ( "onClientRender", root, renderDxs ) end ) function renderDxs ( ) -- dxs here end obs: you don't need to use getResourceRootElement, resourceRoot is the same thing, more easily
-
You want to load a skin (tdx/dff) for only one player/account? if yes see this topic (third post), It's serial-based but you can edit it to use accounts.
-
setAircraftMaxHeight
-
getLocalPlayer can be used only in the client side (and you're trying to use this in the server side), When you add a command with addCommandHandler the function which you pass as parameter in the third argument automatically gain 2 new parameters playerSource, string commandName playerSource will be the player who triggered the command (then you can use this instead of getLocalPlayer), commandName will be the command name (eh, obviously ) Your final code will be like this one: function Lol( playerSource, commandName ) local localPlayerName = getPlayerName( playerSource ) outputChatBox ( "#164F8C[TEXT]"..localPlayerName.."#FFFFFFis Laughing out loud!", getRootElement(), 255, 255, 255, true ) end addCommandHandler("lol", Lol) about using parameters in the commands you can read about it in the wiki (scroll down a bit until find "Handler function parameters"), Read the examples also.
-
guiSetEnabled @edit didn't see the pa3cks' post
-
In your second code source isn't defined, if you want to destroy the vehicle of the player who typed the command you have to add a parameter to the function (thePlayer for example) which will be the player who typed the command (as described in the wiki) and replace source with the parameter "name" (thePlayer using my example...). function SaveVehicleDataOnQuit( thePlayer ) -- define thePlayer for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "Owner") == thePlayer then -- replace source with thePlayer destroyVehicle(veh) end end end addCommandHandler("hide",SaveVehicleDataOnQuit)
-
It works with all dx "elements" (using a render target), About the second video that you provide, you can see its source here, might this help...
-
See: using db* functions SQL Reference