-
Posts
253 -
Joined
-
Last visited
Everything posted by Miika
-
Working, but it not destroy final marker and blip...
-
Error: Loading script failed: Plane-mission\mission.lua:29: unexpected symbol near ')' Code: missionMarker = createMarker ( -1305.2, -120.3, 13.4, "cylinder", 2, 0, 255, 255, 170 ) addEventHandler("onResourceStart", resourceRoot, function ( ) missionBlip = createBlipAttachedTo(missionMarker,53) outputChatBox( "[Plane Mission] Älä vielä mene lentokone missionille. se on kesken", source, 0, 255, 255 ) end ) addEventHandler("onMarkerHit", missionMarker, function ( hitElement ) if (getElementType ( hitElement ) == 'player' ) then local plane = createVehicle ( 519, -1654, -162, 14, 0, 0, -45 ) warpPedIntoVehicle ( hitElement, plane ) outputChatBox( "[Plane Mission] Lennä punaiselle lipulle.", hitElement, 0, 255, 255 ) finalMarker = createMarker ( 338, 2505, 16, "checkpoint", 6, 255, 255, 0, 170 ) finalBlip = createBlipAttachedTo(finalMarker,19) end end ) addEventHandler("onMarkerHit", finalMarker, function ( hitElement ) if (getElementType ( hitElement ) == 'player' ) then if (getElementType ( hitElement ) == 'vehicle' ) then destroyElement( finalMarker ) destroyElement( finalBlip ) end end )
-
Next problem... Final marker wont destry if I hit it [server] missionMarker = createMarker ( -1305.2, -120.3, 13.4, "cylinder", 2, 0, 255, 255, 170 ) function createMissionMarker() missionBlip = createBlipAttachedTo(missionMarker,53) outputChatBox( "[Plane Mission] Älä vielä mene lentokone missionille. se on kesken", source, 0, 255, 255 ) end addEventHandler("onResourceStart", resourceRoot, createMissionMarker) function MarkerHit( hitElement, matchingDimension ) local plane = createVehicle ( 519, -1654, -162, 14, 0, 0, -45 ) warpPedIntoVehicle ( hitElement, plane ) outputChatBox( "[Plane Mission] Aja perseeseen! Muista pitää hauskaa!", hitElement, 0, 255, 255 ) finalMarker = createMarker ( 338, 2505, 16, "checkpoint", 6, 255, 255, 0, 170 ) finalBlip = createBlipAttachedTo(finalMarker,19) end addEventHandler("onMarkerHit", missionMarker, MarkerHit) function finalMarkerHit ( hitElement, matchingDimension ) destroyElement( finalMarker ) destroyElement( finalBlip ) end
-
missionMarker = createMarker ( -1305.2, -120.3, 13.4, "cylinder", 2, 0, 255, 255, 170 ) function createMissionMarker() missionBlip = createBlipAttachedTo(missionMarker,19) outputChatBox( "[Plane Mission] Älä vielä mene lentokone missionille. se on kesken", source, 0, 255, 255 ) end addEventHandler("onResourceStart", resourceRoot, createMissionMarker) function MarkerHit( hitElement, matchingDimension ) local plane = createVehicle ( 519, 70.21049, -233.00739, 2.33665 ) warpPedIntoVehicle ( 'hitElement, plane ) outputChatBox( "[Plane Mission] Test", source, 0, 255, 255 ) end addEventHandler("onMarkerHit", missionMarker, MarkerHit) You got a typo there, remove the ' before hitElement. It working! Thx.
-
missionMarker = createMarker ( -1305.2, -120.3, 13.4, "cylinder", 2, 0, 255, 255, 170 ) function createMissionMarker() missionBlip = createBlipAttachedTo(missionMarker,19) outputChatBox( "[Plane Mission] Älä vielä mene lentokone missionille. se on kesken", source, 0, 255, 255 ) end addEventHandler("onResourceStart", resourceRoot, createMissionMarker) function MarkerHit( hitElement, matchingDimension ) local plane = createVehicle ( 519, 70.21049, -233.00739, 2.33665 ) warpPedIntoVehicle ( 'hitElement, plane ) outputChatBox( "[Plane Mission] Test", source, 0, 255, 255 ) end addEventHandler("onMarkerHit", missionMarker, MarkerHit)
-
Not working. It crash the resource
-
Oh! Lua:10 bad 'ped' pointer How to fix it?
-
Oh! Lua:10 bad 'ped' pointer
-
I'm making plane system. But I have problem. Marker wont create plane. Mys script is: [server] missionMarker = createMarker ( -1305.2, -120.3, 13.4, "cylinder", 2, 0, 255, 255, 170 ) function createMissionMarker() missionBlip = createBlipAttachedTo(missionMarker,19) outputChatBox( "[Plane Mission] Älä vielä mene lentokone missionille. se on kesken", source, 0, 255, 255 ) end addEventHandler("onResourceStart", resourceRoot, createMissionMarker) function MarkerHit( hitElement, matchingDimension ) local plane = createVehicle ( 519, 70.21049, -233.00739, 2.33665 ) warpPedIntoVehicle ( source, plane ) outputChatBox( "[Plane Mission] Test", source, 0, 255, 255 ) end addEventHandler("onMarkerHit", missionMarker, MarkerHit) What is the problem? Sorry my bad english...
-
I make autoWeather mod. But it not working for good. My script is: -- Copyright SuomiGTA -- -- Tekijä: Miika822 -- -- Scriptin jälleenmyyminen EHDOTTOMASTI KIELLETTY! -- -- Ilmoitukset -- function onStart() outputChatBox("Miikan sää script v 1.0 on käynnistetty onnistuneesti.", source, 255, 0, 0) setTimer ( changeWeatherSunny, 1000, 1 ) end addEventHandler("onResourceStart", getRootElement(), onStart) function onJoin() outputChatBox("Sään tarjoaa Miikan sää scripti.") end addEventHandler("onPlayerJoin", getRootElement(), onJoin) -- Scripti alkaa kunnolla -- function changeWeatherSunny() setWeather ( 1 ) outputChatBox("Sää vaihdettiin aurinkoiseksi säämodin johdosta!") setTimer ( changeWeatherRainy, 300000, 1 ) end function changeWeatherRainy() setWeather ( 8 ) outputChatBox("Sää vaihdettiin myrskyksi säämodin johdosta!") setTimer ( changeWeatherSandstrom, 300000, 1 ) end function changeWeatherSandstrom() setWeather ( 19 ) outputChatBox("DARUDE SANDSTORM! -Säämodi") setTimer ( changeWeatherPink, 600000, 1 ) end function changeWeatherPink() setWeather ( 118 ) outputChatBox("Pinkki taivas ja kristalli vesi!") setTimer ( changeWeatherSunny, 300000, 1 ) end What is the problem? Sorry my bad english...
-
Nope it's found because the event onClientGUIClick added inside the event onClientResourceStart which mean the whole resource loaded therefore function changeLights exists. The problem from the server side. function changeLightsState() local sourceVehicle = getPedOccupiedVehicle(source) if sourceVehicle then if getVehicleOverrideLights ( sourceVehicle ) ~= 2 then setVehicleOverrideLights( sourceVehicle, 2 ) else setVehicleOverrideLights( sourceVehicle, 1 ) end end end addEvent ( "lightsState", true ) addEventHandler ( "lightsState", root, changeLightsState ) IT WORKING! Thx tapl!
-
Hi! I am making a car panel. But I have problem. TriggerServerEvent not working. My code is: [server side] function changeLightsState(source) if not isPedInVehicle(source) then return end local sourceVehicle = getPedOccupiedVehicle( source ) if getVehicleOverrideLights ( sourceVehicle ) ~= 2 then setVehicleOverrideLights( sourceVehicle, 2 ) else setVehicleOverrideLights( sourceVehicle, 1 ) end end addEvent ( "lightsState", true ) addEventHandler ( "lightsState", root, changeLightsState ) [Client side] function createCarPanel() carPanel = guiCreateWindow(250,100,445,445,"carPanel panel (TESTI)",false) guiSetVisible(carPanel, false) guiWindowSetSizable(carPanel, false) carPanelButton = guiCreateButton(14, 283, 136, 58, "asd", false, carPanel) addEventHandler ( "onClientGUIClick", carPanelButton, changeLights, false ) end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), createCarPanel ) function changeLights() triggerServerEvent("lightsState", localPlayer ) end function windowcloseopen () if (guiGetVisible (carPanel) == true) then guiSetVisible (carPanel, false) guiSetInputEnabled (false) showCursor (false) elseif (guiGetVisible (carPanel) == false) then guiSetVisible (carPanel, true) showCursor (true) end end bindKey ("f2", "down", windowcloseopen) What is the problem?
-
I find the proble. But thanks for helping"
-
bindKey ( player, c, down, setEngineState ) not working
-
BindKey not working The code is: (server side) function setEngineState(player) veh = getPedOccupiedVehicle(player) state = getVehicleEngineState(veh) if veh then setVehicleEngineState(veh,not state) end end bindKey ("c", "down", setEngineState) function command(player,cmd,amount) local vehicle = getPedOccupiedVehicle(player) local fuel = getElementData(vehicle,"fuel") local account = getPlayerAccount(player) local name = getAccountName(account) if isObjectInACLGroup("user."..name,aclGetGroup("Admin")) then if vehicle and tonumber(amount) and (tonumber(fuel) + tonumber(amount)) <= 100 then setElementData(vehicle,"fuel",tonumber(amount) + tonumber(fuel)) outputChatBox("Your vehicle has been refuelled successfully by Script.("..(amount).."%)",player) else outputChatBox("Please Type an amount that keep the car fuel below 100%.",player) end else outputChatBox("Access Denied.",255,255,0) end end addCommandHandler("refuel",command) Sorry my bad english...
-
Hi! I install the webchat resource and ajax. But if I start the resource, it says: "Resource 'webchat' start was requested (Failed to link to ajax)" What is the problem? Sorry my bad english
-
I change the function, but not working... local amark = { {1667.2,1014.3,10.8}, } function createRob() local random = math.random ( #amark ) local x, y, z = amark[random][1] Marker = createMarker ( x, y, z "cylinder", 4, 255, 255, 0, 170 ) setElementCollisionsEnabled( Marker, false ) bl = createBlipAttachedTo(Marker,11) outputChatBox( "Autokaupan ryöstö on saatavilla! Ryöstä se keltaisen rekan luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createRob) addEventHandler("onMarkerHit",root, function ( player ) if ( source ~= Marker ) then return end if ( isPedInVehicle( player ) ) then return end destroyElement( Marker ) destroyElement( bl ) randomMoney = math.random ( 3000, 5000 ) givePlayerMoney(player,randomMoney) setPlayerWantedLevel ( player, 6 ) outputChatBox("Sait $" .. tostring(randomMoney) .." rahaa ja 6 tähteä", player, 0, 250, 0) setTimer( createMarker, 900000, 1 ) end )
-
I want make "rob the car shop" resource.
-
My resource not working... local amark = { {1667.2,1014.3,10.8}, } function createMarker() local random = math.random ( #amark ) local x, y, z = amark[random][1] Marker = createMarker ( x, y, z "cylinder", 4, 255, 255, 0, 170 ) setElementCollisionsEnabled( Marker, false ) bl = createBlipAttachedTo(Marker,11) outputChatBox( "Autokaupan ryöstö on saatavilla! Ryöstä se keltaisen rekan luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createMarker) addEventHandler("onMarkerHit",root, function ( player ) if ( source ~= Marker ) then return end if ( isPedInVehicle( player ) ) then return end destroyElement( Marker ) destroyElement( bl ) randomMoney = math.random ( 3000, 5000 ) givePlayerMoney(player,randomMoney) setPlayerWantedLevel ( player, 6 ) outputChatBox("Sait $" .. tostring(randomMoney) .." rahaa ja 6 tähteä", player, 0, 250, 0) setTimer( createMarker, 900000, 1 ) end ) Sorry my bad english D:
-
Now I have new problem This code not working: -- Tästä lisää paikkoja -- {x, y, z} local apickup = { {2516,-1953.7,15.89999961853}, {2312.8000488281,-1460.7,20.1}, {1767.8,-1372.4,14.7}, {815.7,-1108.2,25.8}, {838.7,-2056.5,12}, {-967,-2158,34}, {-2336.3,-1623.5,482.8}, {-2134.1,181.8,34.2}, {-2737.8,129.3,3.4}, {-2519,1545,16.4}, {-1681.8,1210,20.2}, {1160,1394.5,5}, {2449.6,662.7,10.4}, } function createPickup() local random = math.random ( #apickup ) local x, y, z = apickup[random][1], apickup[random][2], apickup[random][3] armor = createPickup( x, y, z, 2 ) setElementCollisionsEnabled( armor, false ) bl = createBlipAttachedTo(armor,23) outputChatBox( "Armor pickup on spawnannut! Nouda se pääkallon luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createPickup) addEventHandler("onPickupHit",root, function ( player ) if ( source ~= armor ) then return end if ( isPedInVehicle( player ) ) then return end destroyElement( Pickup ) destroyElement( bl ) setPedArmor ( player, 100 ) local armor = getPedArmor( player ) outputChatBox("Sait armorisi täyteen (".. tostring(armor) ..")", player, 0, 250, 0) setTimer( createPickup, 90000, 1 ) end )