-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
See? you have both as server side... "dfsdssdsdasd" name="heal gun" version="1.0.0" type="script"/>
-
Well, I damaged a vehicle and then I shoot at it and it "healed" it. How's your meta.xml?
-
Check if the "lolmode" game mode is into a ZIP, if so, unpack it, because this game mode uses XML to save data, so it can't be saved if it's into a ZIP file.
-
You're welcome.
-
I'm pretty sure you put the client side as a server side script (in meta.xml).
-
Please use only English only on this section, you may use the Portuguese section instead: viewforum.php?f=120
-
setWeaponProperty doesn't allow negative values. You can do this though: -- client side: function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if (weapon == 31 and hitElement and getElementType(hitElement)=="vehicle") then -- If the weapon is a M4 and the element hit is a vehicle if getElementHealth(hitElement) >= 1000 then return end -- If the vehicle health is 1000%, don't heal it. setElementHealth(hitElement, getElementHealth(hitElement)+100) -- Set the vehicle health +100%. end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) -- server side: addEventHandler("onResourceStart",resourceRoot, function () setWeaponProperty(31, "pro", "damage", 0) end) This way it won't damage the vehicle at all, but it should heal it.
-
Check the resource name, it must be the same, upper case, lower case.
-
Wrong. /run exports["invincibleped"]:setElementInvulnerable(ped1inside, true)
-
Is an exported function from Benxamix's resource, so you have to use it like this: exports[resourceName]:setElementInvulnerable(element, boolean) The resourceName is the name of the resource which has the function: setElementInvulnerable.
-
So, you steal scripts from other servers? are you f**** kidding me? we don't help people who steal scripts! P.S: Part of that script is mine, I'm pretty sure, that's why It seem familiar.
-
Jaysd1, the variable "localPlayer" doesn't has to be defined anymore, the new MTA has it built-on.
-
local sx,sy = guiGetScreenSize() function drawPedTags() for i,v in ipairs(getElementsByType("ped")) do local name = getElementData(v,"name") if name then local x,y,z = getElementPosition(v) local cx,cy,cz = getCameraMatrix() local r,g,b = 0,255,0 local nameLength = dxGetTextWidth(name,textScale,textFont) if isLineOfSightClear(cx,cy,cz,x,y,z,true,true,false,true,false,true,false,v) then if getDistanceBetweenPoints3D(cx,cy,cz,x,y,z) <= 45 then local px,py = getScreenFromWorldPosition(x,y,z+0.3,0.06) if px then local hp = getElementHealth(v) if hp > 0 then local width = dxGetTextWidth(name,1,default) dxDrawColorText(name, px + 1, py + 1, px + 1, py + 1, tocolor(r,g,b,255), 1, "pricedown", "center", "center", false, false) dxDrawColorText(name, px, py, px, py, tocolor(r,g,b,255), 1, "pricedown", "center", "center", false, false) end end end end end end end addEventHandler("onClientRender",getRootElement(),drawPedTags) The code seems familiar, I'm pretty sure you didn't script this.
-
You don't need these: addEventHandler ( "Close", root, Close) addEventHandler ( "Open", root, Open)
-
If I'm right, replacing wheels is pretty buggy, at least it never worked for me.
-
chat_range = 100 function onChat(player,_,...) cancelEvent() local x, y = getElementPosition(player) local circlearea = createColSphere ( x, y, 5, chat_range ) local msg = table.concat({...}, " ") local r,g,b = 255,255,255 local cmd = gettok(msg, 1, 32) playerName = getPlayerName(player) for i,v in ipairs(getElementsWithinColShape(circlearea, "player")) do if cmd ~= "" and cmd ~= nil then if cmd == "/do" and msg:gsub(cmd,"") ~= "" then outputChatBox(msg:gsub(cmd,"") .. " (("..playerName.."))", v,r,g,b,true) else outputChatBox(playerName.." dice: #ffffff"..msg,v,r,g,b,true) end end end destroyElement ( circlearea ) end addCommandHandler("Chat",onChat) addEventHandler ( "onPlayerChat", getRootElement(), function (msg) onChat(source,_,msg) end) That'll output the same, but it'll cut the /do part.
-
When you copy things from another topics, try to copy them completely. local wheels = { {fileName="wheel/wheel_gn1", model=1082}, } function load() for index, wheel in pairs(wheels) do txd = engineLoadTXD ( wheel.fileName ..".txd" ) engineImportTXD ( txd, wheel.model ) dff = engineLoadDFF ( wheel.fileName ..".dff", 0 ) engineReplaceModel ( dff, wheel.model ) end end addEventHandler("onClientResourceStart",resourceRoot, function () setTimer ( load, 1000, 1) end)
-
The function: setPedWeaponInfo does not exists, maybe you meant: setWeaponProperty But, is server side only.
-
John, because he always copy from the wiki, that's how the example works for: engineReplaceModel
-
Ok, I've noticed of some typos in my script, here: addCommandHandler("transferTo", function (thePlayer, cmd, toWho, cash) if (toWho == "") then return end local playerTo = getPlayerFromPartOfName(toWho) if (not isElement(playerTo)) then outputChatBox("This player is not online.",thePlayer,255,0,0) return end local cash = tonumber(cash) if getPlayerMoney(thePlayer) >= cash then outputChatBox("You have sent $".. tostring(cash) .." to ".. tostring(getPlayerName(playerTo)),thePlayer,0,255,0) outputChatBox(tostring(getPlayerName(thePlayer)) .." has sent you $".. tostring(cash) ..".",playerTo,0,255,0) givePlayerMoney(playerTo, cash) takePlayerMoney(thePlayer, cash) else outputChatBox("You don't have $".. tostring(cash) ..".",thePlayer,255,0,0) end end) function getPlayerFromPartOfName(thePlayerName) 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 I also changed the part of name function to get it even if is upper case.
-
I think you have to use a crack: "GTA SA 1.00 No CD", to make it work with Steam.
-
That's not possible, it gives the money and takes it from you. You have it as server side, right? in the meta.xml.
-
This should work: addCommandHandler("transferTo", function (thePlayer, cmd, toWho, cash) if (toWho == "") then return end local playerTo = findPlayerByName(toWho) if (not isElement(playerTo)) then outputChatBox("This player is not online.",thePlayer,255,0,0) return end local cash = tonumber(cash) if getPlayerMoney(thePlayer) >= cash then outputChatBox("You have sent $".. tostring(cash) .." to ".. tostring(getPlayerName(playerTo)),thePlayer,0,255,0) outputChatBox(tostring(getPlayerName(thePlayer)) " has sent you $".. tostring(cash),playerTo,0,255,0) givePlayerMoney(playerTo, cash) takePlayerMoney(thePlayer, cash) else outputChatBox("You don't have $".. tostring(cash) ..".",thePlayer,255,0,0) end end) function findPlayerByName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end
-
--This function is executed when the button is clicked - it warps the local player. local function onTeleportButtonClicked() local localVehicle = getPedOccupiedVehicle(localPlayer) if localVehicle then if getVehicleController(localVehicle) == localPlayer then --IF the player is driving a vehicle, warp the vehicle. setElementPosition(localVehicle, 1523.9138183594, 1527.1204833984, 10.2602405548) end else setElementPosition(localPlayer, 1523.9138183594, 1527.1204833984, 10.2602405548) end end addEventHandler("onClientGUIClick", GUIEditor_Button[1], onTeleportButtonClicked, false)
-
Wafamde, he want's a script to send money to another players, and the script has to detect part of player name(s).
