
Evil-Cod3r
Members-
Posts
370 -
Joined
-
Last visited
Everything posted by Evil-Cod3r
-
Please small help to finsh my gameMode
-
i got problem with the the first thing It show the Leve :false ExP:false Total Exp :Fale why ? and the sound for level up is it Play for level or every time i got +1Exp ?? function levelup () local Exp = getElementData(localPlayer,"ExP") local Level = getElementData(localPlayer,"Level") if isElement(expLabel) then destroyElement(expLabel) end expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"ExP gained: ??\nTotal ExP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) guiLabelSetColor(expLabel,0,255,0) guiLabelSetVerticalAlign(expLabel,"top") guiLabelSetHorizontalAlign(expLabel,"left",false) guiSetFont(expLabel,"clear-normal") end setTimer ( levelup, 2000, 1) exports.scoreboard:scoreboardAddColumn("ExP") exports.scoreboard:scoreboardAddColumn("Level") local levels = {[30] = 1, [55] = 2, [75] = 3, [85] = 4, [95] = 5, [120] = 6, [150] = 7, [230] = 8, [350] = 9, [500] = 10} function win(ammo, killer, weapon, bodypart) if (killer and killer ~= source) then local H = getElementData(killer, "ExP") local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) setElementData(killer, "ExP", tonumber(H)+1) triggerClientEvent ( killer, "playSound" , killer ) if levels[tonumber(H)] then setElementData(killer, "Level", "Lvl ".. levels[tonumber(H)] .." !") triggerClientEvent ( killer, "playSound" , killer ) end outputChatBox(killer1 .. "Killed " .. noob .. " and gained +1 Exp", getRootElement(), 255, 255, 0, false) end end addEventHandler( "onPlayerWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "lvl") or "Level 0 !") setElementData(source, "ExP", getAccountData(account, "exp") or "0") end addEventHandler ("onPlayerLogin", root, onLogin) function saveData(thePlayer, theAccount) if (theAccount and not isGuestAccount(theAccount)) then setAccountData (theAccount, "lvl", getElementData(thePlayer, "Level")) setAccountData (theAccount, "exp", getElementData(thePlayer, "ExP")) end end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function (prev) saveData(source, prev) end)
-
Hi all i have Made This but the Problem when i restart the Script Level and Exp will be set 0 and all what i have been gained wll gone even if it login or logout exports.scoreboard:scoreboardAddColumn("EXP") exports.scoreboard:scoreboardAddColumn("Level") function win(ammo, killer, weapon, bodypart) local H = getElementData(killer, "EXP") local S = getElementData(killer, "Level") local killer1 = getPlayerName(killer) local noob = getPlayerName(source) if killer and killer ~=source then setElementData(killer, "EXP", tonumber(H)+1) triggerClientEvent ( killer, "playSound" , killer ) if tonumber(H) == 30 then setElementData(killer, "Level", "Lvl 1 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 55 then setElementData(killer, "Level", "Lvl 2 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 75 then setElementData(killer, "Level", "Lvl 3 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 85 then setElementData(killer, "Level", "Lvl 4 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 95 then setElementData(killer, "Level", "Lvl 5 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 120 then setElementData(killer, "Level", "Lvl 6 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 150 then setElementData(killer, "Level", "Lvl 7 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 230 then setElementData(killer, "Level", "Lvl 8 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 350 then setElementData(killer, "Level", "Lvl 9 !") triggerClientEvent ( killer, "playSound" , killer ) elseif tonumber(H) == 500 then triggerClientEvent ( killer, "playSound" , killer ) setElementData(killer, "Level", "Lvl 10 !") end outputChatBox(killer1 .. "Killed " .. noob .. " and gained +1 EXP", getRootElement(), 255, 255, 0, false) end end addEventHandler( "onPlayerWasted", getRootElement(), win) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "lvl") or "Level 0 !") setElementData(source, "EXP", getAccountData(account, "exp") or "0") end addEventHandler ("onPlayerLogin", root, onLogin) function onQuit() local account = getPlayerAccount(source) if not account then return end if not isGuestAccount(account) then setAccountData (account, "lvl", getElementData(source, "Level")) setAccountData (account, "exp", getElementData(source, "EXP")) end end addEventHandler ("onPlayerQuit", root, onQuit)
-
Thx Castillo i owe you One !
-
any small help ?
-
now it can delete by admin or Modrator Only
-
what about this ? function wasted ( killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then local sound = playSound("sounds/1.ogg") setSoundVolume(sound, 1.5) outputChatBox("**Great Shot Player +$40!**",source,255,255,0) givePlayerMoney ( killer, 40 ) if (bodypart == 9) then local sound = playSound("sounds/2.ogg") setSoundVolume(sound, 1.5) outputChatBox("**OWned->HeadShot +$50**",source,255,255,0) givePlayerMoney ( killer,50 ) end else local sound = playSound("sounds/3.ogg") setSoundVolume(sound, 1.5) outputChatBox("**Woops Your Dead Try Next Time - $5**",source,255,255,0) takePlayerMoney( killer, 5) end end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) and can you help me with this function levelup () local Exp = getElementData(source,"Exp") local Level = getElementData(source,"Level") expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"EXP gained: ??\nTotal EXP: ??\nLevel: Unknown",true) guiLabelSetColor(expLabel,0,255,0) guiLabelSetVerticalAlign(expLabel,"top") guiLabelSetHorizontalAlign(expLabel,"left",false) guiSetFont(expLabel,"clear-normal") guiSetText ( expLabel, "Exp.. Level" ) setTimer ( levelup, 2000, 1) end end
-
Hi all i try Make a Sound_Pack System For My GameMode i made this is it right ? function Wasted ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then local sound = playSound("sounds/1.ogg") setSoundVolume(sound, 1.5) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) function headshotKill ( attacker, attackerweapon, bodypart, loss ) if bodypart == 9 then local sound = playSound("sounds/2.ogg") setSoundVolume(sound, 1.5) end addEventHandler("onClientPlayerWasted", getLocalPlayer(),headshotKill) function dead () local sound = playSound("sounds/3.ogg") setSoundVolume(sound, 1.5) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), dead )
-
Here You Go call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Race Wins") function DestructionWin( ) local alivePlayers = getAlivePlayers( ) if #alivePlayers == 1 then local account = getPlayerAccount( alivePlayers[1] ) local wins = getAccountData( account,"Race Wins" ) or 0 if account then if isGuestAccount( account ) then return end setAccountData( account,"Race Wins", wins + 1 ) end local playername = getPlayerName( alivePlayers[1] ) outputChatBox ( "#FFA824The player " .. playername .. " won!", root, 255, 255, 255, true ) end end addEventHandler( "onPlayerWasted", root, function( ) local account = getPlayerAccount( source ) local loses = getAccountData( account,"Race Loses" ) or 0 if account then if isGuestAccount( account ) then return end setAccountData( account,"Race Loses", loses + 1 ) end end ) function updateRatio (thePlayer) local account = getPlayerAccount( theplayer ) if account then if isGuestAccount( account ) then return end local wins = getAccountData( account, "Race Wins" ) or 0 local loses = getAccountData( account, "Race Loses" ) or 0 if loses == 0 then setAccountData(account, "ratio", "-") else local kdr = round( wins / loses, 2) setAccountData(account, "ratio", kdr) end end end function publicstatsinfo( ) if isElement( source ) then local account = getPlayerAccount( source ) if account then if isGuestAccount( account ) then return end local askdname = getPlayerName( source ) local wins = getAccountData( account, "Race Wins" ) or 0 local loses = getAccountData( account, "Race Loses" ) or 0 local ratio = getAccountData( account, "Ratio" ) or N/A if loses and wins then outputChatBox("#FFA824*" .. askdname .. " won " .. tostring( wins ) .. " times and he lost " ..tostring( loses ).. " times, his ratio is " .. tostring( ratio ) .. "%", root, 255, 12, 15, true) else outputChatBox("#FFA824*" .. askdname .. " doesen't losed or won " , root, 255, 12, 15, true) end end else outputChatBox( "Error source is not player" ) end end addEvent( "stats", true ) addEventHandler( "stats", root, publicstatsinfo ) function checkCommand( message, messageType ) if messageType == 0 then if message == "!stats" then triggerEvent( "stats", source ) elseif message == "!st" then triggerEvent( "stats", source ) cancelEvent( ) end end end addEventHandler( "onPlayerChat", root, checkCommand ) function getPlayerFromNamePart(Name) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end restriction = {} addCommandHandler("stats", function (thePlayer, cmd, whoToCheck) local playerName = getPlayerName(thePlayer) if restriction[playerName] then outputChatBox("#FFA824You have to wait 30 seconds", thePlayer, 255, 0, 0, true) else restriction[playerName] = true setTimer(restrictionEnd, 30000, 1, playerName) local player = getPlayerFromNamePart( whoToCheck ) if (player) then local account = getPlayerAccount( player ) if account then if isGuestAccount( account ) then return end local wins = getAccountData( account, "Race Wins" ) or 0 local loses = getAccountData( account, "Race Loses" ) or 0 ratio = (tonumber(wins)/tonumber(loses))*10 or N/A outputChatBox("#FFA824*[sTATS] Player's "..tostring(player).." stats : " , root, 255, 12, 15, true) if wins then outputChatBox("#FFA824*Wins: "..tostring(wins).."!", root, 255, 12, 15, true) else outputChatBox("#FFA824*Wins: 0 !" , root, 255, 12, 15, true) end if loses then outputChatBox("#FFA824*Loses: "..tostring(loses).."!", root, 255, 12, 15, true) else outputChatBox("#FFA824*Loses: 0 !", root, 255, 12, 15, true) end if ratio then outputChatBox("#FFA824*Ratio: "..tostring(ratio).."% !", root, 255, 12, 15, true) else outputChatBox("#FFA824*Ratio: - %", root, 255, 12, 15, true) end end else outputChatBox( "Player not found!" ) end end end) function restrictionEnd(playerName) restriction[playerName] = nil end
-
NeverMined Thx For Help Me
-
Castiloo not cancel the Command i want he Take the frist greande and if he write gun dont take any weapon but grenade
-
Hi iam trying to Make a script Anti-Gun Command if you all remmebr BaseMode if Player throw his greande and write gun in f8 he select his weapons and get another greande can some one give me the commands and event or example to Make anti-gun for that ?
-
do you know what i like in mta? if there any script disable some thing make an anti for that and it well work fine 100% function loginPlayer ( thePlayer, command, username, password ) local account = getAccount ( username, password ) if ( account ~= false ) then logIn ( thePlayer, account, password ) else outputChatBox ( "Wrong username or password!", thePlayer, 255, 255, 0 ) end end addCommandHandler ( "login", loginPlayer )
-
i think you can make a table For the first time i help some one and my code works iam so Happy
-
Castillo Can You Give us an example so i wont fall in the same mistake ? please
-
Castillo you mean my script wont work ?
-
not Tested ---- serverSide function whatever (thePlayer) pThink = exports["something"]:getSomething(thePlayer) end addEvent( "playerSide", true ) addEventHandler( "playerSide", getRootElement(), whatever) ------ clientSide function Here (thePlayer) triggerServerEvent("playerSide", getLocalPlayer()) think = '*' ..pthink end
-
i dont know if it right or not function onPlayerQuit() local playerAccount = getPlayerAccount(source) if (playerAccount) then local stat = getPedStat ( source, 71 ) --- deset egal skill setAccountData(playerAccount, "Whatever", stat) end end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit) function onPlayerLogin() local stat = getPedStat ( source, 71 ) if (playerAccount) then local stat1 = getAccountData(playerAccount, "Whatever", stat1) if (stat1) then setPedStat(source, 71, 999) end end end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin)
-
This is an example local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 ) -- add hill_Enter as a handler for when a player enters the hill area function hill_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then --if the element that entered was player --let's get the name of the player local nameOfThePlayer = getPlayerName ( thePlayer ) --announce to everyone that the player entered the hill outputChatBox ( nameOfThePlayer.." entered the zone!", getRootElement(), 255, 255, 109 ) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter )
-
Thank You So Mutch Castillo i owe 1 Realy Realy Awosem Man Now Your in the Credits
-
its Run No Proplem but need simple thing if he press F3 and he is not admin outputChatBox("You Muste Be Admin ..") and if he admin and press F3 show and hide the window just these 2 things
-
........ Fixed Thx