xMKHx

Members
  • Content Count

    131
  • Joined

  • Last visited

Everything posted by xMKHx

  1. You can use any save system from the community ! or you can link the fighting style system with mysql or sql you can add this in server side of the fighting styles script function createTable () executeSQLQuery("CREATE TABLE IF NOT EXISTS fightingstyle (account TEXT, styleID INT)") outputDebugString("CREATED TABLE fightingstyle ( account TEXT, styleID INT)", 3, 0, 255, 0) end addEventHandler("onResourceStart", resourceRoot, createTable) then add this function function isPlayerAlreadyBoughtNewFightingStyle (player) local account = getAccountName(getPlayerAccount(player)) local query = executeSQLQuery("SELECT * FROM fightingstyle WHERE account=?", account) if (query) and (#query > 0) then return true else return false end end then add this in the function when you buy or get the new fighting style function onBuyNewFightingStyle () if (isPlayerAlreadyBoughtNewFightingStyle(source) == true) then local acc = getAccountName(getPlayerAccount(source)) executeSQLQuery("UPDATE fightingstyle SET styleID=? WHERE account=?", theID, acc) else executeSQLQuery("INSERT INTO fightingstyle(account,styleID) VALUES(?,?)", acc, theID) end end
  2. i'm using my phone try this function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function findPlayer (player, cmd, target) local target_ = getPlayerFromPartialName ( target ) local targetN = getPlayerName(target_) if cmd == "find" then if target_ then createBlipAttachedTo ( getPlayerFromName(targetN), 52 ) else outputChatBox("Player not found !", player, 255, 0, 0) end end end addCommandHandler("find", findPlayer)
  3. try this i'm using my phone i didn't test it local car = getPedOccupiedVehicle ( getLocalPlayer() ) local carfullhp = math.floor(getElementHealth(car)/10) local carhp = carfullhp - 25 dxDrawRectangle(screenW * 0.7760, screenH * 0.8796, screenW * 0.1083/100*carhp, screenH * 0.0278, tocolor(171, 100, 17, 207), false)
  4. What are we looking for ? We're looking for staffs to manage the server and controle it and help players ... Requirements: - Good English skills - Able to handle the duty Where you can apply ? Here is our Forum Link: UDCMTA Good Luck
  5. xMKHx

    Timer to Progress

    Thank You so Much
  6. xMKHx

    Timer to Progress

    Example I have a timer for a function function test () setTimer(outputChatBox, 3000, 1, "Hello World") end i want to change it to a progressbar guiCreateProgressBar
  7. Hello Today i'm asking if is there any possibility to move a timer (setTimer) to a progress ?
  8. xMKHx

    Remaining Time

    Worked fine, but first the vip sets auto for all server accounts online and offline 2nd the resul in the db is 0
  9. xMKHx

    Remaining Time

    Hours table already created, i use outputChatBox but no result the same time
  10. Check this may help you https://community.multitheftauto.com/index.php?p=resources&s=details&id=14305
  11. xMKHx

    Remaining Time

    No anyone helpme please
  12. xMKHx

    Remaining Time

    You mean something like this local time = getRealTime () local timestamp = time.timestamp local remaining_hours = getPlayerVIPHours - timestamp ????
  13. xMKHx

    Remaining Time

    function onResourceStart () executeSQLQuery("CREATE TABLE IF NOT EXISTS vip (account TEXT, hours INT)") end addEventHandler("onResourceStart", resourceRoot, onResourceStart) function isPlayerVIP (player) local account = getAccountName(getPlayerAccount(player)) local query = executeSQLQuery("SELECT * FROM vip WHERE account=?", account) if (query) and (#query > 0) then return true else return false end end function getPlayerVIPHours (player) if (isPlayerVIP(player)) then local account = getAccountName(getPlayerAccount(player)) local query = executeSQLQuery("SELECT * FROM vip WHERE account=?", account) for k,v in ipairs (query) do vHours = v.hours end return vHours end end function endVIP (player) setElementData(player, "VIP", "No") local acc = getAccountName(getPlayerAccount(player)) executeSQLQuery("DELETE FROM vip WHERE account=?", acc) end function myHours (player) if (isPlayerVIP(player) == false) then return exports.chgnote:createNote("You are not VIP", player, 255, 0, 0) end local hours = getPlayerVIPHours(player) local sec = hours / 60 local min = sec / 60 local hour = min / 1000 exports.chgnote:createNote("You have "..hour.." VIP Hours", player, 0, 255, 0) exports.chgnote:createNote("You have "..min.." VIP Mins", player, 0, 255, 0) exports.chgnote:createNote("You have "..sec.." VIP Secs", player, 0, 255, 0) end addCommandHandler("viphours", myHours) function addVIP (player, cmd, newVIP, hours) local target = getPlayerFromNick ( newVIP ) local adderName = getPlayerName(player) local targetN = getPlayerName( target ) if (target == false) then return exports.chgnote:createNote("There is no player with that name !", player, 255, 0, 0) end if ( hours == false) then return exports.chgnote:createNote("Please insert a valid hours !", player, 255, 0, 0) end if (isPlayerVIP(target) == false) then if cmd == "addvip" then if targetN then if hours then outputChatBox(adderName.." gave "..targetN.." "..hours.." VIP Hours !", root, 0, 255, 0) setElementData(target, "VIP", "Yes") local sec = 1000 local min = 60 * 1000 local hour = min * 60 local playeraccount = getPlayerAccount ( target ) remaining_time = setTimer(endVIP, hours * hour, 1, player) setAccountData(playeraccount, "VIP_Hours", getTimerDetails(remaining_time)) local acc = getAccountName(getPlayerAccount(target)) local remainingHours = getTimerDetails(remaining_time) if (remainingHours) then executeSQLQuery("INSERT INTO vip(account,hours) VALUES(?,?)", acc, remainingHours) outputChatBox("[Test] Remaining Time is: "..remainingHours , root, 255, 255, 0) end end end end end end addCommandHandler("addvip", addVIP) Well i used this method, as you can see at line 16 i added a function to know your vip hours remaining, but nothing if happening @Sasu i'll try your method
  14. xMKHx

    Remaining Time

    function onResourceStart () executeSQLQuery("CREATE TABLE IF NOT EXISTS vip (account TEXT, hours INT)") end addEventHandler("onResourceStart", resourceRoot, onResourceStart) function isPlayerVIP (player) local account = getAccountName(getPlayerAccount(player)) local query = executeSQLQuery("SELECT * FROM vip WHERE account=?", account) if (query) and (#query > 0) then return true else return false end end function getPlayerVIPHours (player) if (isPlayerVIP(player)) then local account = getAccountName(getPlayerAccount(player)) local query = executeSQLQuery("SELECT * FROM vip WHERE account=?", account) for k,v in ipairs (query) do vHours = v.hours end return vHours end end function myHours (player) if (isPlayerVIP(player) == false) then return exports.chgnote:createNote("You are not VIP", player, 255, 0, 0) end local hours = getPlayerVIPHours(player) exports.chgnote:createNote("You have "..hours.." VIP Hours", player, 0, 255, 0) end addCommandHandler("viphours", myHours) function addVIP (player, cmd, newVIP, hours) local target = getPlayerFromNick ( newVIP ) local adderName = getPlayerName(player) local targetN = getPlayerName( target ) if (target == false) then return exports.chgnote:createNote("There is no player with that name !", player, 255, 0, 0) end if ( hours == false) then return exports.chgnote:createNote("Please insert a valid hours !", player, 255, 0, 0) end if (isPlayerVIP(target) == false) then if cmd == "addvip" then if targetN then if hours then local time = getRealTime() local timestamp = time.timestamp local vHours = timestamp+hours*3600 outputChatBox(adderName.." gave "..targetN.." "..vHours.." VIP Hours !", root, 0, 255, 0) local acc = getAccountName(getPlayerAccount(target)) executeSQLQuery("INSERT INTO vip(account,hours) VALUES(?,?)", acc, vHours) setElementData(target, "VIP", "Yes") end end end end end addCommandHandler("addvip", addVIP) not completed
  15. xMKHx

    Remaining Time

    I tried it before i post this topic but nothing, not working !
  16. xMKHx

    Remaining Time

    Hello, i'm working on a VIP Script, its important in RPG Servers Well i made the full script, i can give anyone vip and remove it but still one thing, its the timer, peoples call it vip hours! I want to make an expired date or something like that, i mean i will give someone 100 hours of vip, and after 100 hours the vip will be removed from him, i think you understand what i mean
  17. xMKHx

    [Help] Damage

    Try This addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then if ( getPlayerWeapon(attacker) == wepID )² setElementHealth(source -50) end end end )
  18. xMKHx

    HLSL

    Any body here use or work or know HLSL Language or know to use it I have a question
  19. xMKHx

    [Help] Damage

    I didn't give you a full or working functions If you want a working one use this Its Server Side addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then if ( getPlayerWeapon(attacker) == wepID ) killPed(source, attacker, weapon, bodypart) end end end )
  20. You can find all MTA Contro Names here https://wiki.multitheftauto.com/wiki/Control_names
  21. Many players have weak computers, they have weak RAM, 2GB and Bad Graphic Card like Intel HD Graphic or bad CPU Well i'm with you with this idea, i 've already started working on this project and i just had a problem with Dx Gridlist, I also i didn't find a solution to add a custom ped walking style, i have made some Dx Guis like Spawners and Jobs....etc Also the Players who have weak computer can't play or install GTA V on his computer, that's why we've to make an official GTA V Server or add functions or solutions or methods to change Walking style and animation, editing .ifp files in Multi Theft Auto I thought that i'm the only one who thinking of it but when i saw this topic i felt happy, I'm thinking of making an Official GTA V Server in MTA, We've to make a Development Team to work on, each one get his scripts until we finish it, i'm ready to work I've long time working on this project but i didn't find anyone to help or work with, hope you think like me Regards xMKHx.