Jump to content

EvoGT

Members
  • Posts

    61
  • Joined

  • Last visited

Details

  • Gang
    EvoGT

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

EvoGT's Achievements

Snitch

Snitch (10/54)

0

Reputation

  1. EvoGT

    State Problem

    Sometimes it Writes My name, that i win. But win gets other player . Where could the problem be ?
  2. EvoGT

    State Problem

    Maybe this local isNew = getElementData (getLocalPlayer(), "state") if isNew == "waiting" How to make that player with state "waiting" cant win.
  3. EvoGT

    State Problem

    function DestructionWin( vehicle ) local alivePlayers = getAlivePlayers( ) if (#alivePlayers == 1) then if isElement( alivePlayers[1] ) then local account = getPlayerAccount( alivePlayers[1] ) if isGuestAccount( account ) then return end local mapsWonDM = tonumber(loadPlayerData(thePlayer,"mapsWonDM")) savePlayerData(thePlayer,"mapsWonDM", mapsWonDM+1) outputChatBox ( "#00FF00* [#FFFFFFWIN#00FF00]#FFFFFF" .. getPlayerName( alivePlayers[1] ) .. " #FFFFFFwins this map!", root, 255, 255, 255, true ) end end end addEvent( 'onPlayerRaceWasted',true ) addEventHandler( "onPlayerRaceWasted", root,DestructionWin ) There is a problem , that player with state "waiting" can win ;/
  4. EvoGT

    Wins script

    Soo. How can i make it with this if (#alivePlayers == 1) then But including setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) pls help.
  5. EvoGT

    Wins script

    I know I tryed to make something.. But i need to change from if Position == 1 then to if (#alivePlayers == 1) then
  6. EvoGT

    Wins script

    The way of if Position == 1 then is buggy. I need to change it with if (#alivePlayers == 1) then
  7. EvoGT

    Wins script

    Solid look what i am trying to do this is from mtasa resources. 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* [WIN] 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* [PRIZE] 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 This scripts bugs. That why i am trying to remake wins script with this: And this setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) and this if (#alivePlayers == 1) then help pls
  8. EvoGT

    Wins script

    addEvent( 'onPlayerRaceWasted',true ) ... addEventHandler( "onPlayerRaceWasted", root,DestructionWin )
  9. EvoGT

    Wins script

    Can you help me to make script when player last player alives , he wins ! i have to use this : setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) Script: function DestructionWin( vehicle ) local alivePlayers = getAlivePlayers( ) if (#alivePlayers == 1) then if isElement( alivePlayers[1] ) then local account = getPlayerAccount( alivePlayers[1] ) if isGuestAccount( account ) then return end setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) outputChatBox ( "#FFA824The player " .. getPlayerName( alivePlayers[1] ) .. " won!", root, 255, 255, 255, true ) end What is wrong here ?
  10. Ok i will try but i am not strong in scripting. But willing that MTA community will help. I wanna keep this function ( ( i want to keep this function bec i can replace this with that witch dont work ) setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) Lets try : X local alivePlayers = getAlivePlayers( ) if (#alivePlayers == 1) then setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) outputChatBox ( "The player " .. getPlayerName( alivePlayers[1] ) .. " wins!", root, 255, 255, 255, true ) Dont lol !
  11. Tell me something now... 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* [WIN] 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* [PRIZE] 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 This is from resource : https://community.multitheftauto.com/in ... ls&id=6623 And its making me mad ! When i and my brother test this script on local server, with 2 PC's everything works !wins updating and player who die last wins. When i test it in my server witch running fedora 13 . With 2 PC's it bugs... The player cant win.. When the last player dieds it writes not "[WIN] 1st! You got..." but "[PRIZE] You got...." Why?? on local everything works perfectly
  12. EvoGT

    hunter script

    Client localPlayer = getLocalPlayer() function addColumns() exports.scoreboard:scoreboardAddColumn("Hunters") end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), addColumns) addEventHandler('onClientPlayerJoin', root, function() setElementData(source,"Hunters",0) end ) Server gRoot = getRootElement() LastWinners={"","","","",""} function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local playerhunters = getElementData(source,"Hunters") setAccountData ( playeraccount, "hunters", playerhunters ) end end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local playerhunters = getAccountData ( playeraccount, "hunters" ) setElementData(source,"Hunters",playerhunters or 0) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin) 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).."Gots Hunter!", getRootElement(), 255, 255, 255, true ) setElementData(thePlayer,"Hunters",tonumber(getElementData(thePlayer,"Hunters"))+1) end end end end When i take hunter, it dont add to hunters 1 and dont even outputChatBox
  13. EvoGT

    hunter script

    But how to do that when take hunter it show on scoreboard Like : i am going with infernus and take hunter . From "Hunters 0" ~~~~> "Hunters 1"
×
×
  • Create New...