-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
-- server side addCommandHandler('pduty', function(source) if isPlayerInFaction(source, 1) then triggerClientEvent(source, 'showDutyGUI', source) end end ) and then add the event 'showDutyGUI' and in that event show the gui
-
You want to show a gui for 1 player only just like castillo you trigger a client event for the player like this: --server side triggerClientEvent(player, 'showGUI', player) --client side addEvent('showGUI', true) addEventHandler('showGUI', root, function() guiSetVisible(gui, true) end ) player is the player you want to show him the gui
-
You seem like you used to script something and now its mixing up.
-
screenSize = { guiGetScreenSize( ) }; should be: local sWidth, sHeight = guiGetScreenSize() idk Your code is messed up flyIn = function ( ) letterBox.animStartTick = 0; addEventHandler( "onClientRender", g_root, animateLetterBox_flyIn ); setTempPedRotating( true ); end You mean this? function flyIn() letterBox.animStartTick = 0; addEventHandler( "onClientRender", g_root, animateLetterBox_flyIn ); setTempPedRotating( true ); end And where is the animateLetterBox_flyIn Function? setTempPedRotating( true ); What is this function? did you make it up because this function doesn't exist. Your code is really weird.
-
Post your whole code, Are you sure that the source are defined, And post the errors or warnings, Did you add text item to the text display?
-
Problems that might be usefull to others if answered...
JR10 replied to will briggs's topic in Scripting
No problem. -
Problems that might be usefull to others if answered...
JR10 replied to will briggs's topic in Scripting
-- server side addCommandHandler('myped', function(source, _) triggerClientEvent(source, 'createMyPed', source) end ) --client side addEvent('createMyPed', true) addEventHandler('createMyPed', root, function() createPed(0, 0, 0, 0) --createPed(skin, x, y, z) end ) This way it will create a ped visible only for the player who type the command /myped. -
store it to a variable and then use stopSound function like this: local sound = playSound3D('sound.mp3', x, y, z) --later stopSound(sound)
-
local randDrugMoneyGet = math.random(50,500) local randMoney = unpack(randDrugMoneyGet[math.random(#randDrugMoneyGet)]) I don't understand what you want to do with the randMoney variable , seems like you are trying to get a random from randDrugMoneyGet which is impossible because its an integer not a table. randDrugMoneyGet is an integer ranging between 50 and 500. maybe explain what you want with randMoney. you should do the following: local randMoney = math.random(50,500) EDIT: iam too late EDIT2: randDrugMarker have nothing to do with randMoney. randDrugMarker is the coordinates of the marker randMoney is the random money. And dont double post.
-
addEventHandler("onPlayerGangZoneHit", getRootElement(), PlayerGangZoneHit) There is no such event , make a col shape and : addEventHandler('onColShapeHit', colShape, onMyColShapeHit) --arguments for this function function onMyColShapeHit(hitElement, matchingDimension)
-
You won't find a scripter for free you will have to pay for him , LUA may seem hard the beginning but it's really not. Main wiki page: https://wiki.multitheftauto.com/wiki/Main_Page You will find good tutorials , good luck.
-
Hmm, sorry didn't read well, you can only replace object's and car's model and you can import TXD to the skin like this: txd=engineLoadTXD('skin46.txd') engineImportTXD(txd, 46)
-
I really didn't want to post this but, What make's you diffrent when you just post "Good..."? That's the same.
-
Who said you can't? txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411) dff = engineLoadDFF ( "infernus.dff", 411) engineReplaceModel ( dff, 411) This is how you import dff and txd you can import DFF or TXD only and you can click on the function to know more about it.
-
So you can just copy and paste it? no. I told you what you got wrong and you must fix it yourself. -.-
-
As you can see he have nothing against you even though you are in CIT
-
I don't think that this should happen , Peacemaker you should stfu. Wether SANL or CIT get more players it doesn't matter. Castillo is just the most active member in this forum he always helps anyone , but like any one would say we dont give out the code you must try , and yes your code makes no sense. Btw if you got the best script and scripters what are you doing here ? Why you are here asking for help?? weird huh?
-
addEventHandler("silencedmode", getRootElement(), silencedmodes, thePlayer, number) function tazerShot(hitX, hitY, hitZ, hitElement) Why you are putting arguments in add event handler , Syntax: bool addEventHandler ( string eventName, element attachedTo, function handlerFunction, [bool getPropagated = true] ) function tazerShot(hitX, hitY, hitZ, hitElement) setPedFrozen ( source, true ) setPedAnimation( source, "ped", "FLOOR_hit_f") setTimer(setPedFrozen, time * 1000, 1, source, false) setTimer(setPedAnimation, time * 1000, 1, source) end I don't know where the source is defined it should be client but i think from what i read in your script it should be like this addEvent("silencedmode", true) addEventHandler("silencedmode", getRootElement(), silencedmodes, thePlayer, number) function tazerShot(hitX, hitY, hitZ, hitElement) setPedFrozen ( hitElement, true ) setPedAnimation( hitElement, "ped", "FLOOR_hit_f") setTimer(setPedFrozen, time * 1000, 1, hitElement, false) setTimer(setPedAnimation, time * 1000, 1, hitElement) end
-
Your blips is created succesfully? , if so then , set a timer that will get the player name tag color and set the player blip to it like this: this script doesnt include creating the blip only change it's color so you must add it to your script. playerTimer = {} addEventHandler('onResourceStart', resourceRoot, function() for i, v in ipairs(getElementsByType('player')) do playerTimer[v] = setTimer(updatePlayerBlip, 1000, 0, v) end end ) addEventHandler('onPlayerSpawn', root, function() function(source) playerTimer[source] = setTimer(updatePlayerBlip, 1000, 0, source) end end ) function getPlayerBlip(src) if src then local attached = getAttachedElements ( src ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then return element end end end end end function updatePlayerBlip(src) if src then if not isPedDead(src) then if getPlayerBlip(src) then local r, g, b = getPlayerNametagColor(src) setBlipColor(getPlayerBlip(src), r, g, b, 255) end end end end addEventHandler('onPlayerQuit', root, function() if isTimer(playerTimer[source]) then killTimer(playerTimer[source]) end end ) addEventHandler('onPlayerWasted', root, function() if isTimer(playerTimer[source]) then killTimer(playerTimer[source]) end end ) And dont double post.
-
You didn't, in 1.0.5 you cant switch users you cant run multiple clients. :\
-
Yes its obvious because Float:x are used in pwn and ; are also used in pwn. he just gave u an example, createMyPickup function will create a health pickup at the x, y, z you specify like this createMyPickup(0, 0, 0) will create a health pickup at 0, 0, 0, coordinates.
-
addEventHandler("onMarkerHit", Marker1, function() enterGates() end ) function enterGates(thePlayer, matchingDimension) if source == Marker1 then if isElementWithinMarker (thePlayer, Marker1) then local getTeam = getPlayerTeam1(getLocalPlayer()) if ( getTeam ) then local teamName = getTeamName(getTeam) if (teamName) == "Special Force" then moveObject ( object1, 10000, 144.6767578125, 2029.4296875, 18.25, 0, 0, 180 ) moveObject ( object2, 10000, 126.3423828125, 2029.4296875, 18.25, 0, 0, 180 ) end end end end end enterGates function is a function you called when the player hits Marker1 so the source isnt the marker the the params are thePlayer matchingDimension are wrong thats not the function in the onMarkerHit event thats another function you called enterGates function should be added to onMarkerHit event like this function stuff () object1 = createObject ( 988, 138.6767578125, 2029.4296875, 18.25, 0, 0, 180 ) object2 = createObject ( 988, 131.9423828125, 2029.4296875, 18.25, 0, 0, 180 ) Marker1 = createMarker ( 135.48503112793, 2038.0122070313, 16.815912246704, "cylinder", 8, 255, 255, 255, 50) Marker2 = createMarker ( 135.48503112793, 2021.5325927734, 16.815912246704, "cylinder", 8, 255, 255, 255, 50) end addEventHandler("onResourceStart", resourceRoot, stuff) function enterGates(thePlayer, matchingDimension) if source == Marker1 then if isElementWithinMarker (thePlayer, Marker1) then local getTeam = getPlayerTeam1(getLocalPlayer()) if ( getTeam ) then local teamName = getTeamName(getTeam) if (teamName) == "Special Force" then moveObject ( object1, 10000, 144.6767578125, 2029.4296875, 18.25, 0, 0, 180 ) moveObject ( object2, 10000, 126.3423828125, 2029.4296875, 18.25, 0, 0, 180 ) end end end end end addEventHandler("onMarkerHit", Marker1, enterGates) dont forget to remove the "1" at each getPlayerTeam function.
-
why you are making it client side? it will work server side it only moves for the cient thats why other players dont see it make your script server sided and if you must make it client side then triggerServerEvent that moves the gate that way the players can see it. and dont double post.
-
Can you tell us what you want?
-
function onSpawn() setRandomVehicle(getPedOccupiedVehicle(source)) end addEventHandler("onPlayerSpawn", getRootElement(), onSpawn) how do u expect the player to be in a vehicle when he spawns? addEventHandler('onVehicleEnter', root, function(player, seat) if seat == 0 then setRandomVehicle(source) end end )