Jump to content

Klesh

Members
  • Posts

    306
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Klesh

  1. Klesh

    Friendly Fire

    The Teams are created, but i put the scrip on folder with meta and that, but nothing. And im trying to do no only a friendlyfire for team, for any player, i mean any player cant kill another player.
  2. Klesh

    Friendly Fire

    I was reading on wiki.mta about friendly fire teams but the code on wiki no works; addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function () local allTeams = getElementsByType ( "team" ) for index, theTeam in ipairs(allTeams) do setTeamFriendlyFire ( theTeam, false ) end end) Thanks for Any help.
  3. Klesh

    Killmessages

    Thank you castillo, like always you are the best.
  4. Klesh

    Killmessages

    Yes i know, this come with mta resource, but any help about kill zombie and appears on screen like someone kill a player?
  5. Klesh

    Killmessages

    Hi community i try to do this script, is about when you kill some zombie this appears on screen like when you kill a player Player-----Weapon------Zombie I try to modify it the resource with a lot of functions but works, the function with i work is zombieWashted (), but nothing. Here is the resouce i was try modify: addEvent ("onClientPlayerKillMessage",true) function onClientPlayerKillMessage ( killer,weapon,wr,wg,wb,kr,kg,kb,width,resource ) if wasEventCancelled() then return end outputKillMessage ( source, wr,wg,wb,killer,kr,kg,kb,weapon,width,resource ) end addEventHandler ("onClientPlayerKillMessage",getRootElement(),onClientPlayerKillMessage) function outputKillMessage ( source, wr,wg,wb,killer,kr,kg,kb,weapon,width,resource ) if not iconWidths[weapon] then if type(weapon) ~= "string" then weapon = 999 end end local killerName local wastedName if not tonumber(wr) then wr = 255 end if not tonumber(wg) then wg = 255 end if not tonumber(wb) then wb = 255 end if not tonumber(kr) then kr = 255 end if not tonumber(kg) then kg = 255 end if not tonumber(kb) then kb = 255 end if ( source ) then if isElement ( source ) then if getElementType ( source ) == "player" then wastedName = getPlayerName ( source ) else outputDebugString ( "outputKillMessage - Invalid 'wasted' player specified",0,0,0,100) return false end elseif type(source) == "string" then wastedName = source end else outputDebugString ( "outputKillMessage - Invalid 'wasted' player specified",0,0,0,100) return false end if ( killer ) then if isElement ( killer ) then if getElementType ( killer ) == "player" then killerName = getPlayerName ( killer ) else outputDebugString ( "outputKillMessage - Invalid 'killer' player specified",0,0,0,100) return false end elseif type(killer) == "string" then killerName = killer else killerName = "" end else killerName = "" end --create the new text if not killerName then killerName = "" end return outputMessage ( {killerName, {"padding",width=3}, {"icon",id=weapon}, {"padding",width=3},{"color",r=wr,g=wg,b=wb}, wastedName}, kr,kg,kb ) end Client-Side local config = { ["lines"] = 5, ["startY"] = 0.35, ["textHeight"] = 16, ["iconHeight"] = 20, ["iconSpacing"] = 4, ["defaultWeapon"] = 255, ["fadeTime"] = 5000, ["startFade"] = 15000, ["align"] = "right", ["startX"] = -10 } local default = { ["lines"] = 5, ["startY"] = 0.25, ["textHeight"] = 16, ["iconHeight"] = 20, ["iconSpacing"] = 4, ["defaultWeapon"] = 255, ["fadeTime"] = 5000, ["startFade"] = 15000, ["align"] = "right", ["startX"] = -10 } local vehicleIDs = { [50]=true,[49]=true,[31]=true,[38]=true,[52]=true } function KillMessages_onPlayerWasted ( totalammo, killer, killerweapon, bodypart ) ---These are special checks for certain kill types local usedVehicle if killerweapon == 19 and isElement(killer) then --rockets killerweapon = killer and getElementType ( killer ) == "player" and getPedWeapon(killer) if not killerweapon then killerweapon = 51 end elseif vehicleIDs[killerweapon] then --heliblades/rammed if ( isElement(killer) and getElementType ( killer ) == "vehicle" ) then usedVehicle = getElementModel ( killer ) killer = getVehicleOccupant ( killer, 0 ) end elseif ( killerweapon == 59 and isElement(killer) ) then if ( getElementType ( killer ) == "player" ) then local vehicle = getPedOccupiedVehicle(killer) if ( vehicle ) then usedVehicle = getElementModel ( vehicle ) end end end --finish this -- Got a killer? Print the normal "* X died" if not if ( killer and isElement(killer) and getElementType ( killer ) == "player" ) then local kr,kg,kb = getPlayerNametagColor ( killer ) if getPlayerTeam" class="kw2">getPlayerTeam" class="kw2">getPlayerTeam ( killer ) then kr,kg,kb = getTeamColor ( getPlayerTeam" class="kw2">getPlayerTeam ( killer ) ) end -- Suicide? if (source == killer) then if not killerweapon then killerweapon = 255 end local triggered = triggerEvent ( "onPlayerKillMessage", source,false,killerweapon,bodypart ) --outputDebugString ( "Cancelled: "..tostring(triggered) ) Server-Side Thanks for any Help nad the commnuity.
  6. Klesh

    Scoreboard

    To allow color codes in scoreboard you must edit the meta in Admin Panel in-game. 1 - Should be you are admin. 2 - Press "p" to open admin panel. 3 - Search tab gui says "resouces". 4- Look the scoreboard resouce, then double click on it. 5 - See Allow Colorcoded Names change it to true. 6 - Restart scoreboard resource. Have fun and play!!
  7. Klesh

    getCamera

    Hi community of MTA, my problem is this How i can get the camera coords like this <camera lookX="2494.5971679688" lookY="-1673.1807861328" lookZ="13.335947036743" posX="2457.0390625" posY="-1647.9575195313" posZ="48.245067596436"/> I want a new code i try with spawns in the air and all that but nothing works, the camera or appears in anotherside or the look camera is not, pls help.
  8. Klesh

    smx Extension

    i have servers host, appear in game-monitor, but how i do to make appears the banners of my servers in the signature, any help is good!
  9. Klesh

    smx Extension

    Ok thanks samt.
  10. Klesh

    smx Extension

    Hi all community my friend is old in mta and he has send me a little script but the problem is in smx file like loginpanel.smx, when i open it says nul in black and some script codes, like getplayername and all that, how can i delete all nul words?
  11. Klesh

    getPlayerName

    Community of MTA team, i have a script, is a login panel all works good and fine, register/login, but the only think no works is in the login panel on Username no gets the player name so here is the code; addEvent ("login", true) addEvent ("register", true) addEvent ("checkaccname", true) function login (uname, pass) local account = getPlayerName ( uname ) if ( account ~= false ) then logIn ( source, account, tostring(pass) ) triggerClientEvent ( "hide", source ) else outputChatBox ( "Wrong username or password!", source, 255, 255, 0 ) end end addEventHandler ( "login", getRootElement(), login ) function register (uname, pass) if ( pass ~= "" and pass ~= nil ) then local accountAdded = addAccount( uname, pass ) if ( accountAdded ) then outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, Username : " .. uname .. " Password : " .. pass .. " remember it for login !", source ) logIn ( source, uname, tostring(pass) ) triggerClientEvent ( "hide", source ) else outputChatBox ( "Error creating account, contact the server admin", source ) end else outputChatBox ( "Error creating account, Enter your password", source ) end end addEventHandler ( "register", getRootElement(), register ) function check () account = getPlayerAccount ( source ) name = getPlayerName ( account ) if name ~= "guest" then triggerClientEvent ( "hide", source ) else triggerClientEvent ( "show", source ) end end addEventHandler ( "checkaccname", getRootElement(), check ) function login () name = getPlayerName ( source ) if name ~= "guest" then triggerClientEvent ( "hide", source ) else triggerClientEvent ( "show", source ) end end addEventHandler ( "onPlayerLogin", getRootElement(), login ) Any help is grate! thanks to all!!
  12. Yes, i know but when i search Map: i dont where is the option to change the color.
  13. TY, but its hard find it, thanks. To many cunfuse.
  14. Hi community, i try to search the think when the map name shows under radar, to change the color, pls and thanks for the help.
  15. Klesh

    Autologin

    Hi community, it try to put on lil_toady panel autologin with serial but this not works if someone can help pls.
  16. Klesh

    Math Money

    Here is my script but i dont know what i have tu put now, only i need when someones win get random money. thanks resourceRoot = getResourceRootElement() function onPlayerDestructionDerbyWin () end addEventHandler ("onResourceStart", resourceRoot, chooserandom) function give () local Player = getPlayerDestructionDerbyWin ( ) randomMoney = math.random ( 1, 1000 ) givePlayerMoney ( randomPlayer, randomMoney ) outputChatBox ( '*' .. getPlayerName ( randomPlayer ) .. ' Has Won $' .. randomMoney .. ' !', getRootElement(), 255, 255, 0 ) end
  17. Hi community i need to know what is wrong with this and why dont show in scoreboard. exports.scoreboard:addScoreboardColumn('Money') function setstats () local account = getPlayerAccount (source) local money = getPlayerMoney ( source ) setElementData ( source, "Money", "$" .. money ) end end addEventHandler ( "onPlayerSpawn", getRootElement(), setstats ) addEventHandler ( "onPlayerLogin", getRootElement(), setstats ) end
  18. You post in the wrong thread, this is a no request forum, here only can help but in this case here is the topic https://community.multitheftauto.com/ind ... includes=1 Check it.
  19. Klesh

    login

    ok thanks but i need to know what folder is, because i need to change the color of that.
  20. Klesh

    login

    Hi comunity i need to know where i can found the folder, (when some one register this allows a message you are now registered with the pass.... or when someone logins and this say, you have been automatically login). Help, where i count the folder and thanks.
  21. Klesh

    Win trouble

    I dont understand
  22. Klesh

    Win trouble

    the first code is server side the second is client side.
  23. Klesh

    Win trouble

    Hi comunity i have a script by me. but in scoreboard i set wins and this not works, here is the code addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) outputChatBox(getPlayerName ( winner ) .. " is the last survivor and win 3 points getRootElement(),0,255,0) setElementData(winner,"Points",tonumber(getElementData(winner,"Points"))+2) setAccountData (account, "race-points", tonumber(2)) setElementData(winner,"Wins",tonumber(getElementData(winner,"Wins"))+1) setAccountData (account, "race-wins", tonumber(1)) else setAccountData (account, "race-points", tonumber(points + 2)) end) addEventHandler("onPlayerWasted",getRootElement(), function () setElementData(source,"Deaths",tonumber(getElementData(source,"Deaths"))+1) end) server - side //////////////////////////////////// exports.scoreboard:addScoreboardColumn('Money') exports.scoreboard:addScoreboardColumn('Points') exports.scoreboard:addScoreboardColumn('Wins') exports.scoreboard:addScoreboardColumn('Achievements') function setstats () local account = getPlayerAccount (source) local money = getPlayerMoney ( source ) setElementData ( source, "Money", "$" .. money ) local points = getAccountData (account, "race-points" ) if points == false then setElementData ( source, "Points", "0" ) else setElementData ( source, "Points", points ) end local wins = getAccountData (account, "race-wins" ) if wins == false then setElementData ( source, "Wins", "0" ) else setElementData ( source, "Wins", Wins ) end local achive = getAccountData (account, "race-achive" ) if achive == false then setElementData ( source, "Achievements", "0" ) else setElementData ( source, "Achievements", achive ) end end addEventHandler ( "onPlayerSpawn", getRootElement(), setstats ) addEventHandler ( "onPlayerLogin", getRootElement(), setstats ) Help. What is wrong, why the wins not works, appears but not works. Thanks for help
  24. ok, another thing how can i save the deaths??? localPlayer = getLocalPlayer() function addColumns() exports.scoreboard:scoreboardAddColumn("Win Points") exports.scoreboard:scoreboardAddColumn("Deaths") setElementData(localPlayer,"Win Points",0) setElementData(localPlayer,"Deaths",0) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), addColumns) function get() local playerMoney = getPlayerMoney(source) local playerPoints = getElementData(getLocalPlayer(), "Win Points") local playerWasted = getElementData(getLocalPlayer(), "Deaths") end addEventHandler ( "onPlayerSpawn", getRootElement(), addColumns ) addEventHandler ( "onPlayerLogin", getRootElement(), addColumns ) cleint-side
  25. What do debug script? How works?
×
×
  • Create New...