-
Posts
306 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Klesh
-
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.
-
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.
-
Thank you castillo, like always you are the best.
-
Yes i know, this come with mta resource, but any help about kill zombie and appears on screen like someone kill a player?
-
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.
-
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!!
-
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.
-
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!
-
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?
-
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!!
-
Yes, i know but when i search Map: i dont where is the option to change the color.
-
TY, but its hard find it, thanks. To many cunfuse.
-
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.
-
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
-
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
-
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.
-
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.
-
the first code is server side the second is client side.
-
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
-
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
-
What do debug script? How works?
