Jump to content

EvoGT

Members
  • Posts

    61
  • Joined

  • Last visited

Everything posted by EvoGT

  1. EvoGT

    Strange bugs

    Hello. Well i noticed some strange bugs. resource link : https://community.multitheftauto.com/in ... ls&id=6623 The strange is that when i test this script in my local server, everything works perfectly. And when i test it on my VPS server ( fedora 32 bit ) it bugs.. i dont know why.. in my local and my VPS server. i used /login /register ... ( registered ) I dont know why it bugs... Could someone tell me why ?
  2. Thanks to all You all are awesome <3
  3. How can i make sound on login and register ? What script should i use ?
  4. EvoGT

    Resource Bugs

    function checkForHunter(number,sort,model) thePlayer = source if sort == "vehiclechange" then if model == 425 then if getElementData(thePlayer,"playerGotHunter") == false then setElementData(thePlayer,"playerGotHunter",true) outputChatBox ( getPlayerName(source).." #FFFFFFgot #abcdef400 points #FFFFFFand #abcdef5000$ #FFFFFFhunter bonus!", getRootElement(), 255, 255, 255, true ) setElementData(thePlayer,"Points",tonumber(getElementData(thePlayer,"Points"))+400) givePlayerMoney(thePlayer,5000) setElementData(thePlayer,"Hunters",tonumber(getElementData(thePlayer,"Hunters"))+1) end end end end What is wrong here ? Why it dont update hunter stats.
  5. EvoGT

    Resource Bugs

    Recource Link: https://community.multitheftauto.com/in ... ls&id=6623 There is 2 bugs 1. When player takes hunters, it dont update stats !hunters and write 0 2. Same For Wins. gRoot = getRootElement() LastWinners={"","","","",""} function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playermoney = getPlayerMoney ( source ) local playerpoints = getElementData(source,"Points") local playertime = getElementData(source,"Playtime") local playerwins = getElementData(source,"Wins") local playerdeaths = getElementData(source,"Deaths") local playerhunters = getElementData(source,"Hunters") setAccountData ( playeraccount, "money", playermoney ) setAccountData ( playeraccount, "points", playerpoints ) setAccountData ( playeraccount, "playtime", playertime ) setAccountData ( playeraccount, "wins", playerwins ) setAccountData ( playeraccount, "deaths", playerdeaths ) setAccountData ( playeraccount, "hunters", playerhunters ) end end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "money" ) local playerpoints = getAccountData ( playeraccount, "points" ) local playertime = getAccountData ( playeraccount, "playtime" ) local playerwins = getAccountData ( playeraccount, "wins" ) local playerdeaths = getAccountData ( playeraccount, "deaths" ) local playerhunters = getAccountData ( playeraccount, "hunters" ) setPlayerMoney ( source, playermoney ) setElementData(source,"Points",playerpoints or 0) setElementData(source,"Playtime",playertime or 0) setElementData(source,"Wins",playerwins or 0) setElementData(source,"Deaths",playerdeaths or 0) setElementData(source,"Hunters",playerhunters or 0) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin) function BuyNos (player, command) if (getPlayerMoney(player) > 10000) then local auto = getPedOccupiedVehicle(player) local nick = getPlayerName(player) addVehicleUpgrade(auto,1010) setPlayerMoney(player, getPlayerMoney(player) - 10000 ) outputChatBox("#191970* " .. nick .. " #8bbae9bought for #FFFFFF$10000 #8bbae9nitro!", getRootElement(), 255, 255, 255, true) else outputChatBox("#8bbae9Not enough money.", player, 255, 255, 255, true) end end addCommandHandler("nos", BuyNos) function BuyRepair (player, command) if (getPlayerMoney(player) > 20000) then local auto = getPedOccupiedVehicle(player) local nick = getPlayerName(player) fixVehicle(auto) setPlayerMoney(player, getPlayerMoney(player) - 20000 ) outputChatBox("#191970* " .. nick .. " #8bbae9bought for #FFFFFF$20000 #8bbae9repair!", getRootElement(), 255, 255, 255, true) else outputChatBox("#8bbae9Not enough money.", player, 255, 255, 255, true) end end addCommandHandler("fix", BuyRepair) function BuyFlip (player, command) if (getPlayerMoney(player) > 20000) then local auto = getPedOccupiedVehicle(player) local nick = getPlayerName(player) rx, ry, rz = getVehicleRotation (auto) setVehicleRotation (auto, rx +180, ry, rz +180) setPlayerMoney(player, getPlayerMoney(player) - 20000 ) outputChatBox("#191970* " .. nick .. " #8bbae9bought for #FFFFFF$20000 #8bbae9flip!", getRootElement(), 255, 255, 255, true) else outputChatBox("#8bbae9Not enough money.", player, 255, 255, 255, true) end end addCommandHandler("flip", BuyFlip) addEventHandler ("onPlayerChat",getRootElement(), function(message,type) local nick = getPlayerName(source) if (string.find(message,"!points")) and not (string.find(message," !points")) then local playerpoints = getElementData(source,"Points") outputChatBox("#191970* " .. nick .. " #8bbae9 has #FFFFFF" .. playerpoints .. "#8bbae9 points", getRootElement(), 255, 255, 255, true) else if (string.find(message,"!cash")) and not (string.find(message," !cash")) then outputChatBox("#191970* " .. nick .. " #8bbae9 has #FFFFFF" .. getPlayerMoney(source) .. "$#8bbae9 money ", getRootElement(), 255, 255, 255, true) else if (string.find(message,"!playtime")) and not (string.find(message," !playtime")) then local playertime = getElementData(source,"Playtime") outputChatBox("#191970* " .. nick .. " #8bbae9 has played for #FFFFFF" .. playertime .. "#8bbae9 minutes", getRootElement(), 255, 255, 255, true) else if (string.find(message,"!wins")) and not (string.find(message," !wins")) then local playerwins = getElementData(source,"Wins") outputChatBox("#191970* " .. nick .. " #8bbae9 has #FFFFFF" .. playerwins .. "#8bbae9 wins", getRootElement(), 255, 255, 255, true) else if (string.find(message,"!deaths")) and not (string.find(message," !deaths")) then local playerdeaths = getElementData(source,"Deaths") outputChatBox("#191970* " .. nick .. " #8bbae9 has #FFFFFF" .. playerdeaths .. "#8bbae9 deaths", getRootElement(), 255, 255, 255, true) else if (string.find(message,"!hunters")) and not (string.find(message," !hunters")) then local playerhunters = getElementData(source,"Hunters") outputChatBox("#191970* " .. nick .. " #8bbae9 has #FFFFFF" .. playerhunters .. "#8bbae9 hunters", getRootElement(), 255, 255, 255, true) end end end end end end end) function updatePlayersStats ( ) for index, player in ipairs ( getElementsByType "player" ) do setElementData ( player, "Money", getPlayerMoney ( player ) ) end end setTimer ( updatePlayersStats, 5000, 0 ) function UpdateMinute ( ) for index, player in ipairs ( getElementsByType "player" ) do setElementData(player,"Playtime",tonumber(getElementData(player,"Playtime"))+1) end end setTimer ( UpdateMinute, 60000, 0 ) function checkForHunter(number,sort,model) thePlayer = source if sort == "vehiclechange" then if model == 425 then if getElementData(thePlayer,"playerGotHunter") == false then setElementData(thePlayer,"playerGotHunter",true) outputChatBox ( getPlayerName(source).." #FFFFFFgot #abcdef400 points #FFFFFFand #abcdef5000$ #FFFFFFhunter bonus!", getRootElement(), 255, 255, 255, true ) setElementData(thePlayer,"Points",tonumber(getElementData(thePlayer,"Points"))+400) givePlayerMoney(thePlayer,5000) setElementData(thePlayer,"Hunters",tonumber(getElementData(thePlayer,"Hunters"))+1) end end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),checkForHunter) function onPlayerDeadInRace() local thePlayer = source local dPlayers = getDeadRacePlayers() local aPlayers = getAliveRacePlayers() local Position = aPlayers + 1 if dPlayers + aPlayers >= 2 then local cashForPlayer = math.floor((120/Position)*(dPlayers + aPlayers)) local pointsForPlayer = math.floor((30/Position)*(dPlayers + aPlayers)) givePlayerMoney(thePlayer,cashForPlayer) setElementData(thePlayer,"Points",tonumber(getElementData(thePlayer,"Points"))+pointsForPlayer) if Position == 1 then outputChatBox ("#abcdef* 1st! You got #FFFFFF" .. pointsForPlayer .." #FFFFFFpoints #abcdefand #FFFFFF" .. cashForPlayer .."$",thePlayer,255,255,255,true) setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) if LastWinners[1] == "" then if LastWinners[2] == "" then if LastWinners[3] == "" then if LastWinners[4] == "" then if LastWinners[5] == "" then LastWinners[5] = thePlayer else LastWinners[4] = thePlayer end else LastWinners[3] = thePlayer end else LastWinners[2] = thePlayer end else LastWinners[1] = thePlayer end else LastWinners[5] = LastWinners[4] LastWinners[4] = LastWinners[3] LastWinners[3] = LastWinners[2] LastWinners[2] = LastWinners[1] LastWinners[1] = thePlayer end else outputChatBox ("#abcdef* You got #FFFFFF" .. pointsForPlayer .." #FFFFFFpoints #abcdefand #FFFFFF" .. cashForPlayer .."$",thePlayer,255,255,255,true) setElementData(thePlayer,"Deaths",tonumber(getElementData(thePlayer,"Deaths"))+1) end else outputChatBox("#8bbae9* Minimum 2 players to get stats and cash!",thePlayer,255,255,255,true) end end addEvent("onPlayerWasted", true) addEventHandler("onPlayerWasted", gRoot , onPlayerDeadInRace) function getAliveRacePlayers() local alivePlayers = 0 for index,player in ipairs(getElementsByType("player")) do if getElementData(player,"state") == "alive" then alivePlayers = alivePlayers + 1 end end return alivePlayers end function getDeadRacePlayers() local deadPlayers = 0 for index,player in ipairs(getElementsByType("player")) do if getElementData(player,"state") == "dead" then deadPlayers = deadPlayers + 1 end end return deadPlayers end
  6. EvoGT

    GUI

    Okay, thanks.
  7. EvoGT

    GUI

    When i try to change alpha, it looks bad. I want to know, how to make like this ( in pic )
  8. EvoGT

    GUI

    How can i make GUI like this ? *Red does not have anything to do with the subject
  9. i wont learn it : x my en too bad.. Could you make bind?
  10. Tottaly mest up.. ok i will try to bind it . heh. local weapon = createWeapon("m4",0,0,0) --Create a Mp5 at the Cordinates 0,0,0 function fireWeapon () setWeaponState ( weapon,"firing") end bindKey ( string mouse1, string both, function handlerFunction, [ var arguments, ... ] ) function fireWeapon ( string moise1, string both, [ var arguments, ... ] ) im soo bad at scripting : X
  11. Okey, if i'l bind it. But what should i do to put that shotting gun on the car ( where is weapon )
  12. There is fireWeapon for that, it just needs to be called multiple times because it only shots one bullet per call. Maybe is it possible to bind it ? Like i press "O" And the weapon shot until i press O ?
  13. Thanks guys for your post's, but i dont know what you writed : X
  14. Maybe i can use this function fireandcreate () local weapon = createWeapon("mp5",0,0,0) --Create a Mp5 at the Cordinates 0,0,0 fireWeapon(weapon) --Fires the Weapon end ?
  15. I did something like this processLineOfSight ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings = true, bool checkVehicles = true, LoL.. I dont know how to start.. Help me to do this script .
  16. I need help in scripting it. i tryed but nothing worked. So, maybe mta community will try to script it. I think that the script will not be long I would be very grateful
  17. Hello Scripters Look here: You see i attached gun to car. is it possible to: to check if there's a vehicle with processLineOfSight and decrease their health and draw a line using dxDrawLine3D. Please help me how to do this.
  18. EvoGT

    Will it work ?

    "Solidsnake" name="helpme" version="1.0.0" type="script"/>
  19. function DestructionDerby:onPlayerWasted(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= 1 then RaceMode.endMap() Make to function DestructionDerby:onPlayerWasted(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= 0 then RaceMode.endMap() And when last player alive deaths , will start next map. You have to test with 2 players on server to take effect.
  20. EvoGT

    Will it work ?

    Tryed , dont work ://
  21. EvoGT

    Will it work ?

    It works here, you must put it as client side on meta.xml. its Client sided. Maybe i know where the failure. I need to make it when every time shots the car , to make lower, not once. What should i add ?
  22. EvoGT

    Will it work ?

    I tryed make it myself and what i made: function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if (weapon == 31) and (getElementType(hitElement) == "vehicle") then -- if i shot to car.... setElementHealth(hitElement, getElementHealth(hitElement)-100) -- makes car hp lower.. i think.. end end -- And this for every time player shots to car. addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) Will it work ?
  23. EvoGT

    Will it work ?

    Solid, dont work it doesn't makes car hp lower
  24. EvoGT

    Will it work ?

    Solidsnake, do you understand what im trying to do ?
×
×
  • Create New...