-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
-- server side script: addCommandHandler("kill", function (thePlayer) killPed(thePlayer) end)
-
Dude, I don't understand anything, could you try to explain yourself again better?
-
Yeah, but he'll have to set his alpha, I think collision shapes are better in this case .
-
Jaysd1, are you blind or what? he has a setTimer. I think you just don't know anything about his error and you want to increase your post count, if you keep doing that, you'll get a bad reputation. On topic: BoomVehicle = {} function respawnVehicle(vehicle) if (BoomVehicle[source]) then outputChatBox ("counter is running test funtion", sourcePlayer ) else outputChatBox ("counter is NOT running test funtion", sourcePlayer ) if vehicle == nil then return; end; if getElementType(vehicle) ~= "vehicle" then return; end; local sx = getElementData(vehicle,"posX"); local sy = getElementData(vehicle,"posY"); local sz = getElementData(vehicle,"posZ"); local rx = getElementData(vehicle,"rotX"); local ry = getElementData(vehicle,"rotY"); local rz = getElementData(vehicle,"rotZ"); spawnVehicle ( vehicle,sx, sy, sz, rx, ry, rz ) end end function Playerinvehicle ( sourcePlayer ) local testcount = BoomVehicle[source] if isPedInVehicle ( sourcePlayer ) then outputChatBox ("is in a vehicle.", sourcePlayer ) if (BoomVehicle[source]) then if isTimer(testcount) then killTimer ( testcount ) end outputChatBox ("counter is running.", sourcePlayer ) else outputChatBox ("counter is NOT running.", sourcePlayer ) end end end addEventHandler ( "onVehicleEnter", getRootElement(), Playerinvehicle ); function ehVehicleExit() BoomVehicle[source] = setTimer(respawnVehicle, 10000, 1, source) if isTimer(BoomVehicle[source]) then -- Check if timer is running using isTimer (this is an example of its use and all) outputChatBox ("counter is running exit vehicle.", sourcePlayer ) else outputChatBox ("counter is NOT runningexit vehicle.", sourcePlayer ) end end addEventHandler ( "onVehicleExit", getRootElement(), ehVehicleExit );
-
addEventHandler("onPlayerJoin",root,function () bindKey(source,"X","down",fakeDeath) end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"X","down",fakeDeath) end end) function fakeDeath(player) setPedAnimation(player,"WUZI","CS_Dead_Guy") end The animation is incorrect, you'll have to search for a good one.
-
First, you'll need to create a colshape: https://wiki.multitheftauto.com/wiki/Cli ... _functions And second, you'll need the event handler: addEventHandler("onClientResourceStart",resourceRoot, function() window = guiCreateWindow(15,306,121,48,"Audio Options",false) guiWindowSetSizable(window,false) guiSetVisible(window, false) on = guiCreateButton(9,24,40,15,"on",false,window) addEventHandler ( "onClientGUIClick", on, startSound, false ) off = guiCreateButton(64,25,40,14,"off",false,window) addEventHandler ( "onClientGUIClick", off, lol, false ) end ) function startSound() if not isElement(sound) then -- if our sound is not existing we can create one sound = playSound("sounds/pjanoo.mp3", false) setSoundVolume(sound, 1.0) -- i think this is default volume.. do we really need it? end end function lol() if isElement(sound) then -- if our sound is existing - we will stop it stopSound(sound) end end addEventHandler( "onClientElementColShapeHit", myColShape, function ( ) if ( getElementType( source ) == "player" ) and ( source == getLocalPlayer( ) ) then guiSetVisible(window, true) showCursor(true) end end );
-
My userpanel: https://community.multitheftauto.com/index.php?p= ... ls&id=2595 I made the resource, it seems like he "translated" it and compiled it.
-
No, you just took the code from Jasper's lolmode and paste into a .lua file.
-
That's not what you are saying in the description, you are saying that you made it.
-
You didn't scripted this, JasperNL=D did, you took it from a roleplay script from the community which was made by him, chill out and learn something by yourself.
-
Again valhalla roleplay: https://community.multitheftauto.com/index.php?p= ... ls&id=2591 Stolen script from JasperNL=D (didn't gave credits): https://community.multitheftauto.com/index.php?p= ... ls&id=2590
-
You can't replace the skin model (.DFF file), you can only replace the texture (.TXD file). Use the engine functions to do this: https://wiki.multitheftauto.com/wiki/Cli ... _functions
-
function showTheText ( ) local serverDisplay = textCreateDisplay() textDisplayAddObserver ( serverDisplay, source ) local serverText = textCreateTextItem ( "Downloading new vehicles!", 0.5, 0.0, 2, 0, 255, 255, 255, 5, "center", "top" ) textDisplayAddText ( serverDisplay, serverText ) setTimer ( textDestroyTextItem, 5000, 1, serverText ) setTimer ( textDestroyDisplay, 5000, 1, serverDisplay ) end addEventHandler ("onPlayerJoin", getRootElement(), showTheText)
-
------------------------------------- -- Code generated by DKR QT to Lua 0.1.7 -- -- Source: GUI.ui -- -- Date: 31/07/2011 - 01:29:51 -- ------------------------------------- addEventHandler("onClientResourceStart",resourceRoot, function() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 800, 600 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "Dialog", false) guiWindowSetSizable(gui["_root"], false) gui[""] = guiCreateButton(125, 268, 75, 24, "Accept", false, gui["_root"]) if on__clicked then addEventHandler("onClientGUIClick", gui[""], on__clicked, false) end gui[""] = guiCreateButton(206, 268, 75, 24, "Decline", false, gui["_root"]) if on__clicked then addEventHandler("onClientGUIClick", gui[""], on__clicked, false) end gui["checkBox"] = guiCreateCheckBox(10, 225, 341, 41, "I accept the rules and i will be play fair, will not bother others!", false, false, gui["_root"]) gui["tabWidget"] = guiCreateTabPanel(20, 45, 361, 181, false, gui["_root"]) gui["tab"] = guiCreateTab("Rules", gui["tabWidget"]) gui._placeHolders["textEdit"] = {left = 0, top = 0, width = 361, height = 161, parent = gui["tab"]} gui["tab_2"] = guiCreateTab("Staff", gui["tabWidget"]) gui["scrollArea"] = guiCreateScrollPane(339, 0, 121, 171, false, gui["tab_2"]) return gui, windowWidth, windowHeight end) function on__clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end --TODO: Implement your button click handler here end function on__clicked(button, state, absoluteX, absoluteY) if (button ~= "left") or (state ~= "up") then return end --TODO: Implement your button click handler here end -- End of DKR QT to Lua code --
-
http://www.mediafire.com/?mp8an1xce6y74az
-
Is your script set as type="client" in meta.xml?
-
Yes, but that's stupid since you don't need to check the weapon.
-
addEventHandler ("onClientPlayerDamage",getRootElement(), function (attacker,weapon,bodypart) if bodypart == 9 then local sound = playSound ("headshot.mp3",false) end end)
-
You can't ban someone from MTA (If i'm right), there's no global ban.
-
You welcome.
-
https://wiki.multitheftauto.com/wiki/Shader_examples In that link you'll find some shader examples.
-
local image = guiCreateStaticImage ( x/4, y/5.8, 399,169, "HOLSTEN"..math.random(1,4)..".png", false ) function headshot ( killer ) guiSetVisible ( image, true ) guiStaticImageLoadImage(image, "HOLSTEN"..math.random(1,4)..".png") end addEventHandler ( "onClientPlayerWasted", getRootElement(), headshot ) Do you know that you are creating the image only ONE time? the image won't update by his own.
-
Could you show me how are you using this? I mean, the full script.
-
local image = guiCreateStaticImage ( x/4, y/5.8, 399,169, "HOLSTEN"..math.random(1,4)..".png", false )
-
bandi, as you can see he's triggering the event to getRootElement().
