
florent6001
Members-
Posts
11 -
Joined
-
Last visited
florent6001's Achievements

Square (6/54)
0
Reputation
-
Do you have skype? I'm not really good in script
-
how to do that?
-
can i make the last survivor in a script?
-
the function: function getActivePlayers() return g_CurrentRaceMode.activePlayerList end
-
That doesn't work
-
Someones can help me please?
-
Hi, the last survivor doesn't work. Nothing is displayed when a player is alone alive. And when the last player get the hunter the nextmap doesn't start, he need to press enter or die My destructionderby.lua function DestructionDerby:handleFinishActivePlayer(player) -- Update ranking board for player being removed --if not self.rankingBoard then --self.rankingBoard = RankingBoard:create() --self.rankingBoard:setDirection( 'up', getActivePlayerCount() ) --end local timePassed = self:getTimePassed() local rank = self:getPlayerRank(player) if rank == 1 then --if getResourceState( getResourceFromName( "podium" )) ~= "running" then triggerClientEvent("winnerMessage",resourceRoot,"Winner!!!", getPlayerNametagText(player)) --else -- triggerClientEvent("winnerMessage",resourceRoot,"","") --end --else --self.rankingBoard:add(player, timePassed, rank) end -- Do remove finishActivePlayer(player) if rank and rank > 1 then triggerEvent( "onPlayerFinishDD",player,tonumber( rank ) ) end -- Update ranking board if one player left local activePlayers = getActivePlayers() triggerEvent("onPlayerDeadInRace",getRootElement(),rank,player) if #activePlayers == 1 then --self.rankingBoard:add(activePlayers[1], timePassed, #activePlayers) if (not isMapDM()) then if getResourceState( getResourceFromName( "podium" )) ~= "running" then triggerClientEvent("winnerMessage",resourceRoot,"Winner!!!", getPlayerNametagText(activePlayers[1])) else triggerClientEvent("winnerMessage",resourceRoot,"","") setElementHealth(activePlayers[1],0) end end if getElementModel(getPedOccupiedVehicle(activePlayers[1])) == 425 then setElementHealth(activePlayers[1],0) end triggerEvent( "onPlayerWinDD",activePlayers[1] ) end end
-
Resolved, that was: earnMoneyForDeath thx
-
Hi all, My userpanel doesn't give money when i die, someones can help me? This is my script: function earnMoneyForDeath(whatPosition,player) if whatPosition == 1 then if isPlayerLogged(player) then local playerCount = #getElementsByType("player") if infos.minPlayer <= playerCount then local expToEarn = playerCount*5 local cashToEarn = playerCount*25 addDataValue ( player, "cash", cashToEarn) addDataValue ( player, "points", expToEarn) earnTeamExpAndCash(player,expToEarn,cashToEarn) outputChatBox("[EARNED] #FFFFFF You won $"..cashToEarn.." and "..expToEarn.." points.",player,_r,_g,_b,true) else outputChatBox("[EARNED] #FFFFFF Minimum Players Required to Earn Points / Cash : "..infos.minPlayer..".",player,_r,_g,_b,true) end end else if isPlayerLogged(player) then local playerCount = #getElementsByType("player") if infos.minPlayer <= playerCount then local expToEarn = (playerCount-whatPosition)*4 local cashToEarn = (playerCount-whatPosition)*20 addDataValue ( player, "cash", cashToEarn) addDataValue ( player, "points", expToEarn) earnTeamExpAndCash(player,expToEarn,cashToEarn) outputChatBox("[EARNED] #FFFFFF You won $"..cashToEarn.." and "..expToEarn.." points.",player,_r,_g,_b,true) else outputChatBox("[EARNED] #FFFFFF Minimum Players Required to Earn Points / Cash "..infos.minPlayer..".",player,_r,_g,_b,true) end end end end addEvent("onPlayerDeadInRace",true) addEventHandler("onPlayerDeadInRace",getRootElement(),earnMoneyForDeath)
-
Hi all, I need you: Login Work but not the Register function iLogin(username, password) --if (not username == "") and (not password == "") then local account = getAccount(username, password) if (account ~= false) then logIn(source, account, password) outputChatBox("#ffffff* #00ff00You successfully logged in as "..username, source, 0, 255, 0, true) triggerClientEvent(source, "destroyLogin", source) else outputChatBox("#ffffff* #ff0000Wrong username and/or password!", source, 255, 0, 0, true) end --else -- outputChatBox("#ffffff* #ff0000Please, enter your username and/or password.", source, 255, 0, 0, true) --end end addEvent("iLogin", true) addEventHandler("iLogin", root, iLogin) function iRegister(username, password) --if (not username == "") and (not password == "") then local account = getAccount(username, password) if (account == false) then local accountAdded = addAccount(tostring(username), tostring(password)) if (accountAdded) then outputChatBox("#ffffff* #00ff00You have successfully registered.", source, 0, 255, 0, true) triggerClientEvent(source, "destroyLogin", source) else outputChatBox("#ffffff* #ff0000An error occured! Please, report!", source, 255, 0, 0, true) end else outputChatBox("#ffffff* #ff0000That account already exists!", source, 255, 0, 0, true) end --else -- outputChatBox("#ffffff* #ff0000Please, enter your username and/or password.", source, 255, 0, 0, true) --end end addEvent("iRegister", true) addEventHandler("iRegister", root, iRegister) local vibX, vibY = 0, 0 local x, y = guiGetScreenSize() local LogoSizeX, LogoSizeY = 196, 56 local WindowSizeX, WindowSizeY = 425, 425 local BGSizeX, BGSizeY = 350, 295 local ButtonSizeX, ButtonSizeY = 450*0.475, 250*0.115 local font = dxCreateFont( "files/bebas.ttf", 22 ) local bgnumber = 0 local coul = 255,204,0 passwordEditBox = guiCreateEdit(((x-105)/2), ((y-22)/2)-20, 105, 22, "", false) guiSetFont(passwordEditBox, "default-bold-small") usernameEditBox = guiCreateEdit(((x-105)/2), ((y-2)/2)-80, 105, 22, "", false) guiSetFont(usernameEditBox, "default-bold-small") guiEditSetMasked(passwordEditBox, true) loginButton = guiCreateButton(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+30, ButtonSizeX, ButtonSizeY, "LOGIN", false) guiSetFont(loginButton, "default-bold-small") guiSetAlpha(loginButton, 0) registerButton = guiCreateButton(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+40+ButtonSizeY, ButtonSizeX, ButtonSizeY, "REGISTER", false) guiSetFont(registerButton, "default-bold-small") guiSetAlpha(registerButton, 0) playasguestButton = guiCreateButton(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+50+(ButtonSizeY*2), ButtonSizeX, ButtonSizeY, "PLAY AS GUEST", false) guiSetFont(playasguestButton, "default-bold-small") guiSetAlpha(playasguestButton, 0) function renderLogin() dxDrawRectangle(((x-WindowSizeX)/2), ((y-WindowSizeY)/2), WindowSizeX, WindowSizeY*0.05, tocolor( 0, 0, 0, 150 )) -- header dxDrawRectangle(((x-WindowSizeX)/2), ((y-WindowSizeY)/2), WindowSizeX, WindowSizeY*0.875, tocolor( 0+math.random(0,bgnumber), 0+math.random(0,bgnumber), 0+math.random(0,bgnumber), 150+math.random(0,bgnumber) )) --background dxDrawRectangle(((x-WindowSizeX)/2), ((y-WindowSizeY)/2)+(WindowSizeY*0.875)-7, WindowSizeX, 7, tocolor( 0+math.random(0,bgnumber), 0+math.random(0,bgnumber), 0+math.random(0,bgnumber), 150+math.random(0,bgnumber) )) --bar down dxDrawText("Welcome to Play 4 Fun!",0, ((y-WindowSizeY)/2), x, 0,tocolor(255,255,255,255), 1.55*(7*7/dxGetFontHeight(1.55, font)), "default-bold", "center", "top", false, false, false, true, true) dxDrawImage(((x-LogoSizeX)/2)+math.random(0,vibX), (((y-LogoSizeY)/2)-160)+math.random(0,vibY), LogoSizeX, LogoSizeY, "img/logo.png", 0,0,0,tocolor(255, 255, 255, 255),true) dxDrawRectangle(((x-BGSizeX)/2), ((y-BGSizeY)/2)+15, BGSizeX, BGSizeY-10, tocolor( 255, 204, 0, 50 )) -- BG LOGIN STATS HERE dxDrawRectangle(((x-BGSizeX)/2), ((y-WindowSizeY)/2)+(WindowSizeY*0.05), BGSizeX, BGSizeY*0.275, tocolor( 255, 204, 0, 100 )) -- BG header dxDrawText("Enter your account's details:", 0, ((y-BGSizeY)/2)+5, x, BGSizeY-10,tocolor(255,255,255,255), 1.1*(6*7/dxGetFontHeight(1.1, font)), "default-bold", "center", "center", false, false, false, true, true) dxDrawText("Username ", 0, -185, x, y,tocolor(255,255,255,255), 1.25*(6*6/dxGetFontHeight(1.25, font)), "default-bold", "center", "center", false, false, false, true, true) dxDrawText("Password", 0, -85, x, y,tocolor(255,255,255,255), 1.25*(6*6/dxGetFontHeight(1.25, font)), "default-bold", "center", "center", false, false, false, true, true) dxDrawRectangle(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+30, ButtonSizeX, ButtonSizeY, tocolor( 255, 255, 255, 100 )) -- Login button if hovered == 1 then dxDrawRectangle(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+30, ButtonSizeX, ButtonSizeY, tocolor( 255,204,0, 150 )) -- Login button hover end dxDrawRectangle(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+40+ButtonSizeY, ButtonSizeX, ButtonSizeY, tocolor( 255, 255, 255, 100 )) -- Register button if hovered == 2 then dxDrawRectangle(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+40+ButtonSizeY, ButtonSizeX, ButtonSizeY, tocolor( 255,204,0, 150 )) -- Register button hover end dxDrawRectangle(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+50+(ButtonSizeY*2), ButtonSizeX, ButtonSizeY, tocolor( 255, 255, 255, 100 )) -- Play As Guest button if hovered == 3 then dxDrawRectangle(((x-ButtonSizeX)/2), ((y-ButtonSizeY)/2)+50+(ButtonSizeY*2), ButtonSizeX, ButtonSizeY, tocolor( 255,204,0, 150 )) -- Play As Guest button hover end dxDrawText("Login", 0, 60, x, y,tocolor(255,255,255,255), 1.25*(6*6/dxGetFontHeight(1.25, font)), "default-bold", "center", "center", false, false, false, true, true) dxDrawText("Login", 0, 60, x, y,tocolor(255,255,255,255), 1.25*(6*6/dxGetFontHeight(1.25, font)), "default-bold", "center", "center", false, false, false, true, true) dxDrawText("Register", 0, 140, x, y,tocolor(255,255,255,255), 1.25*(6*6/dxGetFontHeight(1.25, font)), "default-bold", "center", "center", false, false, false, true, true) dxDrawText("Play as guest", 0, 215, x, y,tocolor(255,255,255,255), 1.25*(6*6/dxGetFontHeight(1.25, font)), "default-bold", "center", "center", false, false, false, true, true) end addEventHandler("onClientRender", root, renderLogin) addEventHandler("onClientResourceStart", resourceRoot, function() showCursor(true) guiSetInputEnabled(true) local xmlL = xmlLoadFile("@remember.xml") if xmlL then local xmlNodeL = xmlFindChild(xmlL, "username", 0) if xmlNodeL then guiSetText(usernameEditBox, xmlNodeGetValue(xmlNodeL)) end local xmlNode2L = xmlFindChild(xmlL, "password", 0) if xmlNode2L then guiSetText(passwordEditBox, xmlNodeGetValue(xmlNode2L)) end end end ) addEventHandler("onClientMouseEnter", root, function() if source == loginButton then hovered = 1 playSound("files/hover.mp3") elseif source == registerButton then hovered = 2 playSound("files/hover.mp3") elseif source == playasguestButton then hovered = 3 playSound("files/hover.mp3") end end ) addEventHandler("onClientMouseLeave", root, function() if source == loginButton then hovered = 0 elseif source == registerButton then hovered = 0 elseif source == playasguestButton then hovered = 0 end end ) addEventHandler("onClientGUIClick", root, function() if source == loginButton then triggerServerEvent("iLogin", localPlayer, guiGetText(usernameEditBox), guiGetText(passwordEditBox)) elseif source == registerButton then triggerServerEvent("iRegister", localPlayer, guiGetText(usernameEditBox), guiGetText(passwordEditBox)) elseif source == playasguestButton then destroyLogin("guest") outputChatBox("* #00ff00You're now playing as guest.", 255, 255, 255, true) end end ) function destroyLogin(action) if action ~= "guest" then local xml = xmlLoadFile("@remember.xml") if not xml then xml = xmlCreateFile("@remember.xml", "rememberMe") end local xmlNode = xmlFindChild(xml, "username", 0) if not xmlNode then xmlNode = xmlCreateChild(xml, "username") end local xmlNode2 = xmlFindChild(xml, "password", 0) if not xmlNode2 then xmlNode2 = xmlCreateChild(xml, "password") end xmlNodeSetValue(xmlNode, guiGetText(usernameEditBox)) xmlNodeSetValue(xmlNode2, guiGetText(passwordEditBox)) xmlSaveFile(xml) xmlUnloadFile(xml) end destroyElement(usernameEditBox) destroyElement(passwordEditBox) destroyElement(registerButton) destroyElement(loginButton) destroyElement(playasguestButton) showCursor(false) guiSetInputEnabled(false) removeEventHandler("onClientRender", root, renderLogin) end addEvent("destroyLogin", true) addEventHandler("destroyLogin", root, destroyLogin)
-
Hi all, i tried to download and launch this gamemode: But i have a white screen after the login, can you help me please? thank's you