Jump to content

GanJaRuleZ

Members
  • Posts

    298
  • Joined

  • Last visited

Everything posted by GanJaRuleZ

  1. No problem , but go and learn scripting , like i said : Nobody will script for free I did it , because csmit believed i can't script ( I still think that.. ) , once more for csmit : Please don't reply with insults , we're not here to argue , we are here to help others..
  2. Same error but this time at line 42.
  3. addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish",getRootElement(), function (rank,finishtime) local account = getPlayerAccount(source) if isGuestAccount(account) then outputChatBox("You must be logged in to get the points and cash" , source, 255, 0, 0, true) else if rank == 1 then givePlayerMoney(source,1000) setAccountData( account, "Points", +3 ) end if rank == 2 then givePlayerMoney(source,500) setAccountData( account, "Points", +2 ) end if rank == 3 then givePlayerMoney(source,100) setAccountData( account, "Points", +1 ) end end end) ) Happy? Here to learn scripting : https://wiki.multitheftauto.com/wiki/Scr ... troduction
  4. Well csmit , maybe im not good in scripting , but the race part is my specialty , maybe he will pay someone else , since i don't need money , i gave him an option . But i don't want to start fight here , i'm not here to fight or to argue , i'm here to help people , and please don't post just to get higher posts count. That part is basically easy.. addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish",getRootElement(), function (rank,finishtime) if rank == 1 then givePlayerMoney(source,1000) setElementData( source, "Points", +3 ) end if rank == 2 then givePlayerMoney(source,500) setElementData( source, "Points", +2 ) end if rank == 3 then givePlayerMoney(source,100) setElementData( source, "Points", +1 ) end end) ) Btw , from now you must make the script for yourself
  5. Learn to script , nobody will script for free . You have 2 ways : 1. Learn to script 2. Pay somebody If you want to pay , you can pm me with the details..
  6. Huh , i didn't saw that , thanks anyway
  7. Well , after i tested this one too it gives me an another error .. : new script : local player = nil function thePlayerReachedHunter() if (player) then dxDrawText("The player ".. tostring(getPlayerName(player)) .." got hunter! NOW RUN !",155.0,549.0,669.0,591.0,tocolor(255,255,255,255),1.0,"diploma","left","top",false,false,false) end end addEvent("disableGhostMode",true) addEventHandler("disableGhostMode",root, function (thePlayer) player = thePlayer outputChatBox ( "#FFE303The ghostmode will be disabled in 5 seconds ",255,255,255 ,true ) addEventHandler ( "onClientRender", root, thePlayerReachedHunter ) setTimer(function () removeEventHandler ( "onClientRender", root, thePlayerReachedHunter ) end, 5000, 1) setTimer(function () for k,v in ipairs(getElementsByType("vehicle")) do setElementCollidableWith(v, v, true) end end, 5000, 1) end -- By SolidSnake Error : WARNING: Loading script failed: HunterGMDisabler\client.lua:21: ')' expected (to close '(' at line 10) near '<eof>'
  8. Well , i had a bit of free time and i tested it , it gives the following error : WARNING: stats\stats.lua:43: Bad argument @ 'setTimer' [Expected function at argument 1 , got nil] New script function DestructionWin() local alivePlayers = getAlivePlayers() if #alivePlayers == 1 then local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end local playername = getPlayerName(alivePlayers[1]) setAccountData(account,"Race Wins",tostring(raceWins)+1) outputChatBox ( "#FFA824The player " .. playername .. " won!", getRootElement(), 255, 255, 255, true ) end addEventHandler("onPlayerWasted", getRootElement(), function() local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end setAccountData(account,"Race Loses",tostring(raceLoses)+1) end) function updateTimePlayed() setTimer(updateTimePlayed,1000,1) if isGuestAccount(account) then return end local account = getPlayerAccount(source) local timePlayed = getAccountData(account, "Time played") if (not timePlayed) then setAccountData(account, "Time played","0:0:0") end local hours, mins, secs = unpack(split(timePlayed, ":")) local hours = tonumber(hours) local mins = tonumber(mins) local secs = tonumber(secs) if (hours and mins and secs) then local newsec = secs + 1 if ( newsec >= 60 ) then newsec = 0 mins = mins + 1 end if ( mins >= 60 ) then mins = 0 hours = hours + 1 end setAccountData ( account, "Time played", tostring(hours) ..":".. tostring(mins) ..":".. tostring(newsec)) end end end setTimer(updateTimePlayed,1000,1) function ratioCalculator() local KDR_DECIMAL_PLACES = 2 local account = getPlayerAccount(source) local raceLoses = getAccountData(account,"Race Loses") if raceLoses == 0 then setAccountData(account, "Ratio", "-") else local kdr = round(getAccountData(account, "Race Wins") / raceLoses, KDR_DECIMAL_PLACES) setAccountData(account, "Ratio", tostring(kdr)) end end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local raceWins = getAccountData(account,"Race Wins") local raceLoses = getAccountData(account,"Race Loses") local timePlayed = getAccountData(account, "Time played") local ratio = getAccountData(account, "Ratio") if raceWins then setAccountData(account,"Race Wins",tostring(raceWins)) else setAccountData(account,"Race Wins",0) end if raceLoses then setAccountData(account,"Race Loses",tostring(raceLoses)) else setAccountData(account,"Race Loses",0) end if timePlayed then setAccountData ( account, "Time played", tostring(hours) ..":".. tostring(mins) ..":".. tostring(newsec)) else setAccountData(account, "Time played","0:0:0") end if ratio then setAccountData(account,"Ratio",tostring(ratio)) else setAccountData(account,"Ratio",0) end end) function publicstatsinfo() local account = getPlayerAccount(source) if isGuestAccount(account) then return end local askdname = getPlayerName(source) local wins = getAccountData(account, "Race Wins") local loses = getAccountData(account, "Race Loses") local ratio = getAccountData(account, "Ratio") local timePlayed = getAccountData(account, "Time played") if loses and wins then outputChatBox("#FFA824*" .. askdname .. " won " .. wins .. " times and he/she lost " .. loses .. " times, his/her ratio is " .. ratio .. " and the total time played he/she is: " .. timePlayed, getRootElement(), 255, 12, 15, true) else outputChatBox("*You don't losed or won" , getRootElement(), 255, 12, 15, true) end end addEvent("stats", true) addEventHandler("stats", getRootElement(), publicstatsinfo) function checkCommand(message, messageType) if (messageType == 0) then if (message == "!stats") then cancelEvent() setTimer(triggerEvent, 100, 1, "stats", source) end end end addEventHandler("onPlayerChat", getRootElement(), checkCommand)
  9. Hmmm , as far i know scripting , that will not save an data + it saves for the element. As far , you must make for all the houses\cars , and another function I think you want to make it trought an command so it will be like --House script here function buyTheHouse() local account = getPlayerAccount ( thePlayer ) if isGuestAccount ( account ) then outputChatBox ( " You need to register in order to buy the house" , getRootElement() ) else setAccountData ( account , "ownHouse1" , playerHouse ) takePlayerMoney ( source , 2000 ) -- Here you can set your own price end end addCommandHandler ( "buyHouse1", buyTheHouse ) Maybe im wrong . Btw , you must do for all the house this way.. So what you have to do What you need to do! 1.Make Markers , and you should script : when the player hits the marker , it gets the data, remember , different data for every house! 2.When the player hits the marker , and the house belongs him , then he enters in a int.
  10. @myonlake : The single thing you edited its the " .. ratio .. " Btw : not there is the problem : the problem is at line 83.
  11. Well you can make for yourself too .. Here are is my suggestion : onClientRender You use this as a event handler , for the function , and you must script that everytime it saves the amount of the money
  12. Same error .. @GTX : Ty , i didn't saw that .
  13. Hi allz, In the last week , i worked just on the race stats , but i can't make it working -.-' Here is the script : function DestructionWin() local alivePlayers = getAlivePlayers() if #alivePlayers == 1 then local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end local playername = getPlayerName(alivePlayers[1]) setAccountData(account,"Race Wins",tostring(raceWins)+1) outputChatBox ( "#FFA824The player " .. playername .. " won!", getRootElement(), 255, 255, 255, true ) end addEventHandler("onPlayerWasted", getRootElement(), function() local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end setAccountData(account,"Race Loses",tostring(raceLoses)+1) end) function updateTimePlayed() setTimer(updateTimePlayed,1000,1) if isGuestAccount(account) then return end local account = getPlayerAccount(source) local timePlayed = getAccountData(account, "Time played") if (not timePlayed) then setAccountData(account, "Time played","0:0:0") end local hours, mins, secs = unpack(split(timePlayed, ":")) local hours = tonumber(hours) local mins = tonumber(mins) local secs = tonumber(secs) if (hours and mins and secs) then local newsec = secs + 1 if ( newsec >= 60 ) then newsec = 0 mins = mins + 1 end if ( mins >= 60 ) then mins = 0 hours = hours + 1 end setAccountData ( account, "Time played", tostring(hours) ..":".. tostring(mins) ..":".. tostring(newsec)) end end end setTimer(updateTimePlayed,1000,1) function ratioCalculator() local KDR_DECIMAL_PLACES = 2 local account = getPlayerAccount(source) local raceLoses = getAccountData(account,"Race Loses") if raceLoses == 0 then setAccountData(account, "Ratio", "-") else local kdr = round(getAccountData(account, "Race Wins") / raceLoses, KDR_DECIMAL_PLACES) setAccountData(account, "Ratio", tostring(kdr)) end end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local raceWins = getAccountData(account,"Race Wins") local raceLoses = getAccountData(account,"Race Loses") local timePlayed = getAccountData(account, "Time played") local ratio = getAccountData(account, "Ratio") if raceWins then setAccountData(account,"Race Wins",tostring(raceWins)) else setAccountData(account,"Race Wins",0) if raceLoses then setAccountData(account,"Race Loses",tostring(raceLoses)) else setAccountData(account,"Race Loses",0) if timePlayed then setAccountData ( account, "Time played", tostring(hours) ..":".. tostring(mins) ..":".. tostring(newsec)) else setAccountData(account, "Time played","0:0:0") if ratio then setAccountData(account,"Ratio",tostring(ratio)) else setAccountData(account,"Ratio",0) end) function publicstatsinfo() local account = getPlayerAccount(source) if isGuestAccount(account) then return end local askdname = getPlayerName(source) local wins = getAccountData(account, "Race Wins") local loses = getAccountData(account, "Race Loses") local ratio = getAccountData(account, "Ratio") local timePlayed = getAccountData(account, "Time played") if loses and wins then outputChatBox("#FFA824*" .. askdname .. " won " .. wins .. " times and he losed " .. loses .. " times ,his ratio is " .. ratio " and the total time he played is : " .. timePlayed .. ", getRootElement(), 255, 12, 15,true) else setAccountData(account, "RaceWins" , 0) setAccountData(account, "RaceLoses" , 0) end end addEvent("stats", true) addEventHandler("stats", getRootElement(), publicstatsinfo) function checkCommand(message, messageType) if (messageType == 0) then if (message == "!stats") then cancelEvent() setTimer(triggerEvent, 100, 1, "stats", source) end end end addEventHandler("onPlayerChat", getRootElement(), checkCommand) And the error is : SCRIPT ERROR: stats\stats.lua:83: unexpected symbol near ')' Btw : The time played belongs to Solidsnake Thank you.
  14. Check if the team is created , there must be a team named : teamName EDIT : I remade it simple ( BTW , idk if it will work ) addEvent ( "onPlayerChooseTeam" , true ) addEventHandler ( "onPlayerChooseTeam" , root , function teamName () local team = getTeamFromName ( "Example 1" ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Example 1" ) ) then setPlayerTeam ( thePlayer , team ) outputChatBox("You have successfully been moved to Example 1 Team.", thePlayer, root, 0, 255, 0) else outputChatBox ( "Your not in this team") end end)
  15. Ok , btw i don't know how to make it .. Btw i feel it is not perfect .. root = getRootElement () function someoneReachedHunter(number, sort, model) if sort == "vehiclechange" and model == 425 then local vehicles = getElementsByType("vehicle") for k,v in ipairs(vehicles) do setTimer( setElementCollisionsEnabled(v, false) , 5000 , 1 ) outputChatBox ( "#FFE303The ghostmode will be disabled in 5 seconds ",255,255,255 ,true ) end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) --end function thePlayerReachedHunter() local player = getPlayerName() local theVehicle = getPlayerOccupiedVehicle ( player ) if ( theVehicle = 425 ) then setTimer(dxDrawText("The player ".. player .." got hunter! NOW RUN !",155.0,549.0,669.0,591.0,tocolor(255,255,255,255),1.0,"diploma","left","top",false,false,false) , 50 , 1 ) else end addEventHandler ( "onClientRender", root, thePlayerReachedHunter ) I think the players will be overlayed ..
  16. Hi allz , is there an function or something to destroy a dx Text ? Thank you For example root = getRootElement () function text() setTimer(dxDrawText("This is a text",155.0,549.0,669.0,591.0,tocolor(255,255,255,255),1.0,"diploma","left","top",false,false,false , 50 , 1 ) end addEventHandler ( "onClientRender", root, text )
  17. Well , i started the script from 0 , and i made it working , but i don't know how to set these colors , can anybody help me? addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(), function (mapInfo) local map = exports.mapmanager:getRunningGamemodeMap() local mapname = getResourceName(map) rate = exports.mapratings:getMapRating(mapname) if rate then local average = rate.average local players = rate.count setTimer(outputChatBox,50,1,"#FFE303[RATE]This map has average rating of "..tostring(average).."/10 (by "..tostring(players).." players)",getRootElement(),255,255,255,true) else setTimer(outputChatBox,50,1,"#FFE303[RATE]This map isn't rated yet.",getRootElement(),255,255,255,true) end end ) P.S : Thanks Solidsnake , but i don't know how to make it...
  18. I mean each number has one HEX . Try /rate 2 , will give some sort of red and if you write /rate 10 , it will give green , so these i need these colors..
  19. GanJaRuleZ

    GhostMode

    Is there an function or an example to turn gm ( ghostmode ) on or off ? Thank you...
  20. Ok i made it working , but now , does anybody know the #FFFFFF ( HEX DECIMALS ) color codes from maprating resource ? Thank you..
  21. No errors but it doesn't output the rate it output this line : It has average rating nil/10 (by 1 players)
×
×
  • Create New...