Jump to content

xMKHx

Members
  • Posts

    148
  • Joined

  • Last visited

Everything posted by xMKHx

  1. 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
  2. xMKHx

    Remaining Time

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

    Remaining Time

    No anyone helpme please
  5. xMKHx

    Remaining Time

    You mean something like this local time = getRealTime () local timestamp = time.timestamp local remaining_hours = getPlayerVIPHours - timestamp ????
  6. 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
  7. 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
  8. xMKHx

    Remaining Time

    I tried it before i post this topic but nothing, not working !
  9. 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
  10. 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 )
  11. xMKHx

    HLSL

    Any body here use or work or know HLSL Language or know to use it I have a question
  12. 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 )
  13. You can find all MTA Contro Names here https://wiki.multitheftauto.com/wiki/Control_names
  14. 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.
  15. Well i have join your server, you have a bug in your chat system Guest Players can chat also Its easy to fix it, do it
  16. You can check MTA Resources Directory You find headshot script Here is the code addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then if ( getPlayerWeapon(attacker) == wepID ) killPed(source, attacker, weapon, bodypart) -- This to kill the player with one shot setElementHealth(source, HowMuchHealYouWant) -- This will damage him how much you want end end end )
  17. local BodyPart = -- Add you Body part here for the shot part, Ex: Head, Leg if bodypart == BodyPart then if ( getPlayerWeapon(theAttacker) == wepID ) setElementHealth(theVectim, health )
  18. addEventHandler ( "onClientPlayerDamage", root, function ( attacker, weapon, bodypart, loss ) if (attacker ) and ( getElementType( attacker ) == "ped" ) then return end cancelEvent () end ) I didn't understand what do you mean exactly but may this help you You can add a team or group or Element Data if (getPlayerTeam(source, getTeamFromName("TeamName")) then
  19. Accept my facebook invitation my name: Med Kamel Haddad
×
×
  • Create New...