-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
So there is no compiling in MTA 1.1?
-
Server side: addEvent ( "onPlayerDownloadResource" , true ) addEventHandler ( "onPlayerDownloadResource" , root , function ( ) if hasObjectPermissionTo ( source , "function.banPlayer" , false ) then triggerClientEvent ( source , "initGUI" , source ) end end ) Client side: function initGUI( ) btnOutput = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Output!", true ) addEventHandler ( "onClientGUIClick", btnOutput, outputEditBox, false ) editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "Type your message here!", true ) guiEditSetMaxLength ( editBox, 128 ) end addEvent ( "initGUI" , true ) addEventHandler ( "initGUI" , root , initGUI ) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), function ( ) triggerServerEvent ( "onPlayerDownloadResource" , getLocalPlayer()) end) function outputEditBox ( button ) if button == "left" then local text = guiGetText ( editBox ) outputChatBox ( text ) end end
-
Or just: addCommandHandler("togglenick", function(player) setPlayerNametagShowing( player, not isPlayerNametagShowing( player ) ) end)
-
There is no updates on the freeroam resource so far.
-
Ah, weird. I guess it's not possible with that URL.
-
Yeah same, The thing is I can't open the URL used in callRemote nothing appears, just white. https://community.multitheftauto.com/mta/resources.php
-
Try: server side: function spawn() local repulo1 = createVehicle(519,1949.039,-2494.000,14.539,0,0,90) local pilota1 = createPed(61,0,0,0) warpPedIntoVehicle(pilota1,repulo1) triggerClientEvent ( "fly", getRootElement(),pilota1) end addEvent("onResourceDownloaded",true) addEventHandler("onResourceDownloaded",root,spawn) client side: addEventHandler("onClientResourceStart",resourceRoot, function() triggerServerEvent("onResourceDownloaded",getLocalPlayer()) end) function go(pilota1) setPedControlState(pilota1,"accelerate",true) setTimer(setPedControlState,4000,1,pilota1,"steer_back",true) setTimer(setPedControlState,10000,1,pilota1,"steer_back",false) end addEvent( "fly", true ) addEventHandler("fly",root,go) Not tested, but should work.
-
Thanks. I did, But I want to get more info (author, type), I tried opening the page, nothing appear just white.
-
Is there a way to get a community resource info? like: version, type, name, author? With scripting ofc, i know callRemote but i never used it, and i don't know how to do that. Thanks in advance.
-
Here Total Wins: addEventHandler("onPlayerFinish",root, function(rank,time) if rank == 1 then if getElementData(source,"totalWins") ~= false then setElementData(source,"totalWins",getElementData(source,"totalWins") + 1) else setElementData(source,"totalWins",1) end end end) Not tested, should work. Later you can get the totalWins by using: getElementData(player,"totalWins")
-
The Wiki isn't that complicated, if you really want to learn, read the wiki carefully and slowly, practise, start creating small things like small commands, and keep practising.
-
You can use MTA Account System setAccountData getAccountData And then addEventHandler onPlayerWasted: addEventHandler("onPlayerWasted",root, function(_,killer) if getAccountData(killer,"totalKills") ~= false then setAccountData(killer,"totalKills",getAccountData(killer,"totalKills") + 1) else setAccountData(killer,"totalKills",0) end end) Just a start.
-
I faced that problem, if I'm right the problem is the dimension, the map editor dimension is 200. So here: <def name="RP definitions"> <element name="office_door_cp" friendlyname="Office door" icon="edf/img/office_door_cp.png"> <data name="name" type="string" default="" /> <data name="team" type="integer" default="0" /> <data name="position" type="coord3d" default="0,0,0" /> <data name="type" type="selection:arrow,checkpoint,corona,cylinder,ring" default="checkpoint" /> <data name="size" type="number" default="3" /> <data name="color" type="color" default="#0000FF" /> <data name="interior" type="integer" default="0" /> <data name="dimension" type="integer" default="200" /> <data name="command" type="selection:enter,exit", default="enter" /> <data name="icon" type="integer" default="1" /> <marker position="!position!" type="!type!" size="!size!" color="!color!" interior="!interior!" dimension="!dimension!" /> <blip position="!position!" icon="!icon!" size="2" color="#FFFFFF" dimension="!dimension!" /> </element> </def>
-
Try: privategatesphere = createColSphere ( 1394, -2438, 14, 12 ) privateGate = createObject(16773, 1393.1313476563, -2438.46875, 16.553903579712, 16, 0, 270) local isGateMoving = false function openprivateGate() if (getPlayerFromName("crwblyth" or "XxHEWESxX")) then if isGateMoving then return end moveObject(privateGate, 7000, 1390.3840332031, -2438.361328125, 20.691507339478) isGateMoving = true setTimer(function() isGateMoving = false end,7000,1) end end function closeprivateGate() if (getPlayerFromName("crwblyth" or "XxHEWESxX")) then if isGateMoving then return end moveObject(privateGate, 7000, 1393.1313476563, -2438.46875, 16.553903579712) isGateMoving = true setTimer(function() isGateMoving = false end,7000,1) end end addEventHandler ( "onColShapeHit", privategatesphere, openprivateGate ) addEventHandler ( "onColShapeLeave", privategatesphere, closeprivateGate )
-
No, edit client.lua to this: function someName ( killer, weapon, bodypart ) if(killer == getLocalPlayer()) then return end if bodypart == 9 then local sound = playSound("headshot.wav",false) end end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), someName ) I added a check to see if the kill wasn't suicide, and also the important thing checking if it was a head shot.
-
i want script anti helicopter kill and anti cars kill
JR10 replied to IIIIlllllIII's topic in Scripting
Start with: https://wiki.multitheftauto.com/wiki/Scr ... troduction Sorry then -
i want script anti helicopter kill and anti cars kill
JR10 replied to IIIIlllllIII's topic in Scripting
You also said, that we don't want to help you, which is wrong, we would just like that you try something yourself first. What i gave you should work. -
i want script anti helicopter kill and anti cars kill
JR10 replied to IIIIlllllIII's topic in Scripting
Post English only here,there is languages sections. Btw, you are wrong, it's not that we don't want to help you, but we would like that you try something yourself first. Mind explaining what the hell is this post? -
function LSpdgarage_func ( player , dim) if getElementType(player) ~= "player" then return end if isPedInVehicle(player) then return end setElementInterior ( player, 0,1530.4194335938, -1677.4145507813, 5.890625 ) end addEventHandler ( "onMarkerHit", SFPDInnen, LSpdgarage_func )