Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. WhoAmI

    Help

    toggleControl "sprint"
  2. Well, some way you will do that, but databse has to be optimalised and easy to read and get data.
  3. So you can use databse there. I'll do the project for you. https://scr.hu/d3DoOe In 'pickup' you store all players, in 'player' you store all players which picked atleast one pickup and in 'player_pickup' you store id_player and what pickup he picked id_pickup.
  4. Well, this script seems to save all things including interior. I have no idea. Any errors in debug?
  5. WhoAmI

    hlep error

    'passowrd' isn't a string, as error said.
  6. Well, what I would do is store playtime in seconds and then count how many minutes, hours, days he plays. Like that call ( getResourceFromName ( "scoreboard" ), "scoreboardAddColumn", "Play Time" ) ---Export of ScoreBoard addEventHandler("onPlayerLogin", root, function(_, acc) if not isGuestAccount(acc) then local playedTime = getAccountData(acc, "onlineTime"); if not playedTime then playedTime = 0; end setElementData(source, "onlineTime", playedTime); local player = source; local timer = setTimer(function() setElementData(player, "onlineTime", getElementData(player, "onlineTime") + 1); triggerEvent("onChangePlaytime", player); end, 1000, 0); setElementData(source, "timer:onlineTime", timer); end end); addEventHandler("onChangePlaytime", root, function() local playTime = getElementData(source, "onlineTime"); if playTime then if playTime >= 0 then setElementData(player, "Play Time", playTime .. " seconds") elseif playTime >= 60 then playTime = math.floor(playTime / 60) setElementData(player, "Play Time", playTime .. " minutes") elseif playTime >= 3600 then playTime = math.floor(playTime / 3600) setElementData(player, "Play Time", playTime .. " hours") elseif playTime >= 86400 then playTime = math.floor(playTime / 86400) setElementData(player, "Play Time", playTime .. " days") end end end); function saveData(player, acc) if acc and not isGuestAccount(acc) then setAccountData(acc, "onlineTime", getElementData(player, "onlineTime")); if isTimer(getElementData(player, "timer:onlineTime")) then killTimer(getElementData(player, "timer:onlineTime")); end end end addEventHandler("onPlayerDisconnect", root, function() saveData(source, getPlayerAccount(source)); end); addEventHandler("onPlayerLogout", root, function(acc) saveData(source, acc); end); Didn't test. @EDIT: Updated.
  7. Probably some system saves interior and position and on connecting it only loads position without interior.
  8. WhoAmI

    dxDrawImage

    What you need to move dx thing is interpolateBetween And to make 'dead' image is guiSetEnabled
  9. I don't think that MySQL database is necessary there. I think normal table will do the work. Something like local playerPickups = {} addEventHandler("onPickupHit", root, function(player) if isElement(player) and getElementType(player) == "player" then if not playerPickups[player] then playerPickups[player] = 1; else return; end else return; end end)
  10. WhoAmI

    .

    What you need to do is working on percentage units. Look yourScreenWitdth = 1920 yourScreenHeight = 1080 dxWidth = 1555 dxHeight = 1003 screenWidth, screenHeight = guiGetScreenSize(); --onClientRender dxDrawRectangle( (dxWidth/yourScreenWitdth) * sreenWidth, (dxHeight/yourScreenHeight) * screenHeight, lenght, 16, tocolor(rr,gg,bb,alpha), false) dxDrawRectangle( (dxWidth/yourScreenWitdth) * sreenWidth, (dxHeight/yourScreenHeight) * screenHeight, 320, 16, tocolor(0, 0, 0, 120), false) Hope you understand.
  11. Yea, I figured it out already.
  12. Yea, I tried it already. I have to get its position manually for all vehicles.
  13. I believe it is in race gamemode. Just use CTRL + F like said @Walid.
  14. Hm okay, but how to get the 'component' name of the vehicle? I just want to get front and back lights. @EDIT: I found it. https://wiki.multitheftauto.com/wiki/Ge ... Components
  15. Hello there. I just want to know if is there possible to get position of light in vehicle, just something like https://wiki.multitheftauto.com/wiki/GetPedBonePosition but in vehicle
  16. dxgui is resource which you can download in community site. Also, you can design your own GUI with drawing functions. https://wiki.multitheftauto.com/wiki/Cl ... _functions
  17. As far as I know it's not possible.
  18. As far as I know, you can't export OOP functions.
  19. WhoAmI

    Group save

    Read my posts, please...
  20. WhoAmI

    Group save

    Well, this script uses other script called 'NGSQL'. Do you have it? Or other question... Where did you get that script from?
  21. WhoAmI

    Group save

    So? That post says nothing to me. All I can say is that your 'group system' doesn't save data.
  22. Okay, then in the event that you create this label add following lines triggerServerEvent("s_getGroups", localPlayer) --insert this into event you create CurrentGroupLabel addEvent("c_getGroups", true) addEventHandler("c_getGroups", localPlayer, function (groups) guiSetText(Project.CurrentGroupLabel, groups) end ); And the serverside code should look like that function getGroups() if (isElement(source) and getElementType(source) == "player") then local allGroups = aclGroupList(); local groups = ""; for _, v in ipairs(allGroups) do if (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), v)) then groups = aclGroupGetName(v) .. ", " .. groups; end end triggerClientEvent(source, "c_getGroups", source, groups); end end addEvent("s_getGroups", true) addEventHandler("s_getGroups", root, getGroups)
  23. If I understand it you want to show player's groups, yea? If so, function would look like that -- serverside function getGroups(player) if (isElement(player) and getElementType(player) == "player") then local allGroups = aclGroupList(); local groups = ""; for _, v in ipairs(allGroups) do if (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), v)) then groups = aclGroupGetName(v) .. ", " .. groups; end end return groups; end end It should return a string which will contain all names of groups that declared player is in.
×
×
  • Create New...