-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
I'm sorry then, I don't use linux
-
Here: http://www.mediafire.com/?aaca37cwsub9cvz If I remember well, these are the required files to get your server as 1.0.5.
-
If i'm right, what he want's is to respawn a VEHICLE but a PLAYER, let's wait and see.
-
addEventHandler("onVehicleExplode", getRootElement(), function () setTimer(respawnVehicle, 5000, 1, source) end) This should respawn the vehicle when it explodes after 5 seconds.
-
If the MTA team would translate it to Portuguese, then it would be unfair to others, since Portuguese is not the only Language in the world.
-
Stolen DKR radio: https://community.multitheftauto.com/ind ... ls&id=2293
-
Go to the admin panel go to 'server' tab and press 'Set game type'.
-
Well, it's not translated 100% spanish, so you'll have to translate from English also .
-
Karlis, if you do that the bind won't work at all.
-
Sleny, please don't start a war because of that, as you may know, some Spanish-speaking players are already translating the wiki to Spanish, I think you should do the same, that's what RaceXTreme said.
-
chat_range=100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"L","down","chatbox","L") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"L","down","chatbox","L") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("[local]"..nick..": #ffffff"..msg,v,30,30,200,true) end end end addCommandHandler("L",onChat)
-
Very long time ago when I couldn't play MTA I played SAMP for about a month, and I opened my own server, well, my ping was 65000 or something like that, then I switched to MTA and my ping got to 280-300 max.
-
local lowerBound,upperBound = unpack(get("color_range")) g_Root = getRootElement () g_ResourceRoot = getResourceRootElement ( getThisResource () ) getPlayerColor = getPlayerNametagColor addEventHandler ( "onResourceStart", g_ResourceRoot, function() for i,player in ipairs(getElementsByType"player") do processPlayer ( player ) end end) function processPlayer ( player ) local r, g, b = math.random(lowerBound, upperBound), math.random(lowerBound, upperBound), math.random(lowerBound, upperBound) setPlayerNametagColor(player, r, g, b) end addEventHandler ( "onPlayerJoin", g_Root, processPlayer ) local groups = {"Admin","Moderator","Member","V.I.P","Scripter"} local clanTags = { ["Admin"] = "ADM", ["Moderator"] = "MOD", ["Member"] = "M", ["V.I.P"] = "V.I.P", ["Scripter"] = "SCP", } function chatMyBox (msg, type) if type == 0 then cancelEvent() local r, g, b = getPlayerColor(source) local name = getPlayerName(source) local msg = msg:gsub('#%x%x%x%x%x%x', '') if getMyGroup(source) then outputChatBox( "#FF0000["..clanTags[getMyGroup(source)].."]" .. name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) else outputChatBox( name .. ': #FFFFFF' .. msg, g_Root, r, g, b, true) end end end addEventHandler('onPlayerChat', g_Root, chatMyBox) function getMyGroup(player) local account = getPlayerAccount(player) for i,v in pairs(groups) do if isObjectInACLGroup( 'user.'..getAccountName( account ), aclGetGroup(v) ) then return v end end return false end I think that's a better way of doing this.
-
Firstly, don't double post, and second, you didn't understood what Citizen meant, he was telling you that the MTA team is busy with MTA 1.1 (that means they are fixing bugs, adding new features and so on).
-
No problem, but remember this, if you want to get it fixed, tell them what you have.
-
Well, you could have said that at the start, because it will never work if you won't trigger these events. addEventHandler ( "onPlayerJoin", getRootElement(), function() bindKey (source, "f", "down", engineOffOn ) bindKey(source, "l", "down", changeLightsState ) end) addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), function() for index, player in pairs(getElementsByType("player")) do unbindKey (player, "f", "down", engineOffOn ) unbindKey(player, "l", "down", changeLightsState ) end) function engineOffOn(player) local vehicle = getPedOccupiedVehicle( player ) if vehicle then if ( getVehicleEngineState ( vehicle ) ~= false ) then setVehicleEngineState ( vehicle, false ) else setVehicleEngineState ( vehicle, true ) end end end function changeLightsState(player) local vehicle = getPedOccupiedVehicle( player ) if vehicle then if ( getVehicleOverrideLights ( vehicle ) ~= 2 ) then setVehicleOverrideLights( vehicle, 2 ) else setVehicleOverrideLights( vehicle, 1 ) end end end
-
Well, then you are either lying or not using it as you should, since it works just fine here. How are you triggering "bindKeys" and "unbindKeys"?
-
Well, that resource was really bugged or you messed everything. Apart from that, is it working?
-
Your problem here is that you just copy & paste from the wiki, you don't even think what you are doing. addEvent ( "bindKeys",true ) addEventHandler ( "bindKeys", getRootElement(), function() bindKey (source, "f", "down", engineOffOn ) bindKey(source, "l", "down", changeLightsState ) end) addEvent ( "unbindKeys",true ) addEventHandler ( "unbindKeys", getRootElement(), function() unbindKey (source, "f", "down", engineOffOn ) unbindKey(source, "l", "down", changeLightsState ) end) function engineOffOn(player) local vehicle = getPedOccupiedVehicle( player ) if vehicle then if ( getVehicleEngineState ( vehicle ) ~= false ) then setVehicleEngineState ( vehicle, false ) else setVehicleEngineState ( vehicle, true ) end end end function changeLightsState(player) local vehicle = getPedOccupiedVehicle( player ) if vehicle then if ( getVehicleOverrideLights ( vehicle ) ~= 2 ) then setVehicleOverrideLights( vehicle, 2 ) else setVehicleOverrideLights( vehicle, 1 ) end end end
-
Maybe because you aren't using bindKey right? addEvent ( "bindKeys",true ) addEventHandler ( "bindKeys", getRootElement(), function() -- Initilize Player Element Data local players = getElementsByType ( "player" ) for k,p in ipairs(players) do if p == source then bindKey (p, "f", "down", engineOffOn ) bindKey(p, "l", "down", changeLightsState ) end end end ) addEvent ( "unbindKeys",true ) addEventHandler ( "unbindKeys", getRootElement(), function() -- Initilize Player Element Data local players = getElementsByType ( "player" ) for k,p in ipairs(players) do if p == source then unbindKey (p, "f", "down", engineOffOn ) unbindKey(p, "l", "down", changeLightsState ) end end end ) function engineOffOn(player) local vehicle = getPedOccupiedVehicle( player ) if ( getVehicleEngineState ( theVehicle ) ~= false ) setVehicleEngineState ( vehicle, false ) else setVehicleEngineState ( vehicle, true ) end end function changeLightsState(player) local vehicle = getPedOccupiedVehicle( player ) if ( getVehicleOverrideLights ( playerVehicle ) ~= 2 ) then setVehicleOverrideLights( vehicle, 2 ) else setVehicleOverrideLights( vehicle, 1 ) end end Try that. Edit: Why do you check if source is one of these players? because if you want to bind it just for the one who triggered the event just bind it for source.
-
chat_range=100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"L","down","chatbox","L") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"L","down","chatbox","L") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,msg) local px,py,pz=getElementPosition(player) local nick=getPlayerName(player) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("[local]"..nick..": #ffffff"..msg,v,30,30,200,true) end end end addCommandHandler("L",onChat) I think that should work.
-
Freeroam has a chat script also (if i'm not wrong), so maybe it's that or "playercolors" (this is the most usual).
-
Vehicle mods: https://community.multitheftauto.com/ind ... ls&id=2280 https://community.multitheftauto.com/ind ... ls&id=2277 -- I don't think this one is from him either.
-
outputChatBox function has a last argument, used color code or not, set it to true, example: outputChatBox("#FF0000Hello world.",getRootElement(),255,255,255,true) Did you meant that? And for /me with different style, do this: addEventHandler ( "onPlayerChat", getRootElement(), function ( message, messageType ) if messageType == 1 then cancelEvent() outputChatBox("* ".. getPlayerName(source) .. "".. tostring(message),getRootElement(),255,100,0) -- should output in some kind of orange colour. end end)
-
The /me command is a built-in command, you can cancel it. addEventHandler ( "onPlayerChat", getRootElement(), function ( message, messageType ) if messageType == 1 then cancelEvent() end end)
