-
Posts
1,283 -
Joined
-
Last visited
Everything posted by manve1
-
EDIT: copy my code again, added command handler, when u type "/vehicle" it will create vehicle near u.
-
That script is server-sided
-
change: setPlayerTeam (player, team Admins) to: setPlayerTeam (player, "Admins")
-
You can start making scripts yourself and you won't need to ask others for them: https://wiki.multitheftauto.com/wiki/Scr ... troduction
-
I think this should work: addCommandHandler('vehicle', function() local x, y, z = getElementPosition( getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ) vehicle = createVehicle ( 411, x, y + 3, z ) end ) addEventHandler ( "onVehicleStartEnter", root, function( player, seat, jacked ) if source == vehicle then if (seat == 0) and ( getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ) then cancelEvent() outputChatBox ( "Welcome to your vehicle, sir.", player, 0, 0, 150, true ) elseif ( not getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ) then outputChatBox('This vehicle is private.', player, 0, 0, 150, true) end end end )
-
@Solidsnake14 Thanx @Teteomar have you looked at my first (( the topic )) post? it already has math.random( 1, 90 )
-
Edit ==> i get error at getElementByType [Expected element at argument 1, got nil]
-
--client function rendertxt (motdt) local sWidth,sHeight = guiGetScreenSize() addEventHandler('onClientPlayerJoin', getRootElement(), function() addEventHandler('onClientRender', root, function() texts = dxDrawText( motdt, sWidth * 0.456, sHeight * 0.051, sWidth * 0, sHeight * 0,tocolor(255,255,255,195),1.0,"bankgothic","left","top",false,false,false,true) end ) end ) addCommandHandler('remove', function() removeEventHandler('onClientRender', root, rendertxt) end ) end addEvent("rendertxt",true) addEventHandler("rendertxt", root, rendertxt ) try this.
-
I am trying to make a script which would change the markers color into the teams color: function mark( thePlayer ) local r, g, b, a = getTeamColor( getPlayerTeam(thePlayer) == "LS" ) setMarkerColor( topdeck, r, g, b, a ) end ) addEventHandler('onMarkerHit', topdeck, mark)
-
Not adding to the label numbers, but like if i created a label at a wide of '0.8' i want to fill all of it in but with random numbers till 90
-
guiSetPosition is for GUI elements, not for DirectX drawings. For such usage, create variables with the position values and update them when you need to move the DirectX draw ( it will work since the text, image or whatever you're drawing is updated every frame ). Bit out of topic but: Anderl I said I'm not sure, and that was reason why i wasn't sure.
-
How could it if you gave the script like for every 1 sec and made it for 1 go? try: --serverside function Nemesisbymanawydan ( ) baz = createObject ( 360, -1935.5480957031, 665.44055175781, 48, 0, 0, 0 ) nemesi = exports [ "slothBot" ]:spawnBot ( -1935.5480957031, 665.44055175781, 47.0, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemesi, 107 ) outputChatBox ("#9E0000Nemesis: #0D9905STARS",getRootElement(), 255, 255, 255, true ) local myBlip = (createBlipAttachedTo ( nemesi, 0 )) attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) triggerClientEvent ( "nsound", root ) triggerClientEvent ( "nemesismissel", root ) setTimer( function() setElementHealth ( nemesi, 100 ) end, 1000, 0) end addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan) addEvent("onBotWasted",true) addEventHandler("onBotWasted",getRootElement(), function (killer) if (source == nemesi) then givePlayerMoney(killer,math.random(4000,6000)) -- 4000, 6000 money for kill nemesis-- outputChatBox ( getPlayerName ( killer ) .. " #081DBFkilled Nemesis, congratulations",getRootElement(), 255, 255, 255, true ) setTimer(Nemesisbymanawydan, 60000, 1) -- 60000 time for nemesis respawn in milliseconds-- end end) Edit: changed it back to 1second for regeneration to fully 100health
-
I am trying to make a script which set one label to a random number between 1 and 90, but when i set it using math.random it sets it only to 1 number, and i want like to expand it, and have it like filled fully, till the end of the label, not just one number local rp = guiCreateWindow( 0.1, 0.15, 0.8, 0.75, '', true ) local troll = guiCreateLabel( 0.05, 0.05, 0.9, 0.05, '', true, rp) setTimer( function() guiSetText( troll, math.random( 1, 90 ) ) end, 5000, 1 ) Edit: would it be possible to make all numbers different?
-
server function Nemesisbymanawydan ( ) baz = createObject ( 360, -1935.5480957031, 665.44055175781, 48, 0, 0, 0 ) nemesi = exports [ "slothBot" ]:spawnBot ( -1935.5480957031, 665.44055175781, 47.0, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) setElementModel ( nemesi, 107 ) outputChatBox ("#9E0000Nemesis: #0D9905STARS",getRootElement(), 255, 255, 255, true ) local myBlip = (createBlipAttachedTo ( nemesi, 0 )) attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) triggerClientEvent ( "nsound", root ) triggerClientEvent ( "nemesismissel", root ) setTimer( function() setElementHealth ( nemesi, 100 ) end, 1000, 1) end addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan) addEvent("onBotWasted",true) addEventHandler("onBotWasted",getRootElement(), function (killer) if (source == nemesi) then givePlayerMoney(killer,math.random(4000,6000)) -- 4000, 6000 money for kill nemesis-- outputChatBox ( getPlayerName ( killer ) .. " #081DBFkilled Nemesis, congratulations",getRootElement(), 255, 255, 255, true ) setTimer(Nemesisbymanawydan, 60000, 1) -- 60000 time for nemesis respawn in milliseconds-- end end)
-
I just want this script to be fixed, i can't figure out how to fix it my self, so i though i would come here for help: addEventHandler('onPlayerLogin', getRootElement(), function( ) if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup ("Admin")) then addCommandHandler( 'fixall', function() fixVehicle ( getElementsByType('vehicle') ) outputChatBox( '#FF0000[iNFO]: #FFFFFFAll vehicles were repaired by admin [ '.. getPlayerName( getRootElement() ) ..' ]', root, 255, 255, 255, true ) end ) end end )
-
SERVER: local marker1 = createMarker( 2316.25, -1933, 12, 'cylinder', 3.0, 155, 155, 0, 155 ) theTrashCar = createVehicle( 408, 2201, -1978, 17, 0, 0, 270 ) addEventHandler('onMarkerHit', marker1, function( thePlayer ) if ( getPedOccupiedVehicle( thePlayer ) == theTrashCar ) then triggerClientEvent('marker1_', thePlayer) end end ) CLIENT: addEvent('marker1_', true) addEventHandler('marker1_', getRootElement(), function() owner = getPedOccupiedVehicle( localPlayer ) setElementFrozen( localPlayer, true ) setElementFrozen( owner, true ) end )
-
I got this part, but i can't figure out how to. EDIT: my script looks like this: addEventHandler('onMarkerHit', marker1, function( thePlayer ) if ( getPedOccupiedVehicle( thePlayer ) == theTrashCar ) then triggerClientEvent('marker1_', thePlayer) end end ) well, i got the car made .. but i can't figure out why it doesn't get the car
