-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Which game mode are you using?
-
You surely have another script making the double chat.
-
300000 / 1000 / 60 = 5 minutes. I did understand what did you want, though, I don't know if anyone is willing to make it for 2 pounds.
-
Go to map editor and instead of "race" definition, use the "play" or none.
-
addEventHandler ( "onPlayerWasted", getRootElement(), function ( ) if ( getPlayerTeam ( source ) ) then if ( getTeamName ( getPlayerTeam ( source ) ) == "Civilian" ) then spawnPlayer ( source, 312.30529785156, -2040.5495605469, 2.4078125953674, 90, getElementModel ( source ) ) elseif ( getTeamName ( getPlayerTeam ( source ) ) == "Umbrella Corporation" ) then spawnPlayer ( source, 245.29811096191, 1859.5770263672, 14.084012985229, 180, getElementModel ( source ) ) end fadeCamera ( source, true ) setCameraTarget ( source, source ) end end )
-
function onScriptInit ( ) outputChatBox ( "-----------------------------------" ) outputChatBox ( "My script loaded" ) outputChatBox ( "-----------------------------------" ) end addEventHandler ( "onResourceStart", resourceRoot, onScriptInit )
-
local markers = { {-1725, -121, 2 }, {-1854, 1402, 6.1}, {-2282, 2278, 4,5}, {-367, 1547, 75,1}, {345, 2534, 16,2}, {1641, 2412, 10}, {-2887, 503, 4}, {-1515, 721, 6}, {-683, 965, 12}, {948, 2279, 11}, {1488, 2146, 10}, {1910, 2157, 10}, {2242, 1977, 9}, {-658, 2318, 138}, {-2054, -2565, 30}, {-1416, -1468, 101}, {-605, -483, 25}, {-55, -326, 5}, {1077, -307, 75}, {-2644, 1334, 7}, {2481, 2796, 10}, {-857, -1944, 15}, {-87, -1574, 2}, {-2264, -1688, 480}, {-2029.1010742188, 172.45364379883, 27.35425567627 } } local towary = { {"Odpady", "Trociny", 0, 100, 250}, {"Odpady", "Puszki", 1, 200, 400}, {"Odpady", "Butelki", 2, 400, 550} } local towar = { } local kupuj = { } local x,y = guiGetScreenSize() function closegui() guiSetVisible(oknotow, false) showCursor(false) end function zakup ( ) if ( source == kupuj [ 1 ] ) then outputChatBox ( "Zaladowales towar o id 1!" ) elseif ( source == kupuj [ 2 ] ) then outputChatBox ( "Zaladowales towar o id 2!" ) elseif ( source == kupuj [ 3 ] ) then outputChatBox ( "Zaladowales towar o id 3!" ) end end oknotow = guiCreateWindow((x-500)/2,(y-350)/2,500,350,"System towarów",false) guiSetVisible ( oknotow, false ) info = guiCreateLabel (0.06,0.08,0.7,0.3,"Towar Ilosc score Min. suma Max. suma", true, oknotow) guiSetFont ( info, "default-bold-small" ) for k, v in ipairs ( towary ) do towar[1] = guiCreateLabel (0.03,0.1+0.08*k,0.2,0.1,v[2],true,oknotow) towar[2] = guiCreateLabel (0.27,0.1+0.08*k,0.2,0.1,v[3],true,oknotow) towar[3] = guiCreateLabel (0.46,0.1+0.08*k,0.2,0.1,v[4].."$",true,oknotow) towar[4] = guiCreateLabel (0.68,0.1+0.08*k,0.2,0.1,v[5].."$",true,oknotow) kupuj[k] = guiCreateButton (0.8,0.095+0.08*k,0.13,0.06,"Zaladuj",true,oknotow) addEventHandler ( "onClientGUIClick", kupuj[k], zakup, false ) end zamknij = guiCreateButton (0.45,0.9,0.15,0.07,"Zamknij",true,oknotow) addEventHandler ( "onClientGUIClick", zamknij, closegui ) for a, b in ipairs (markers) do destmarker = createMarker(b[1], b[2], b[3], "cylinder", 3, 255, 255, 0, 255) createBlip(b[1], b[2], b[3], 51, 2, 255, 0, 0, 255, 0, 1000) setElementData(destmarker, "id", b[4]) end source = getLocalPlayer() -- Cement Truck, DFT-30, Linerunner, Tanker, Mule, RoadTrain, Rumpo, Flatbed local vehicle_ids = {[524] = true, [578] = true, [403] = true, [514] = true, [414] = true, [515] = true, [440] = true, [455] = true} function system(hitElement) local vehicle = getPedOccupiedVehicle(hitElement) if destmarker then if vehicle then if vehicle_ids[getElementModel(vehicle)] then guiSetVisible(oknotow, true) showCursor(true) else outputChatBox("To nie jest pojazd dostawczy!", hitElement, 0, 255, 0) end else outputChatBox("Aby zaladowac/rozladowac towar musisz miec pojazd!", hitElement, 0, 255, 0) end end end addEventHandler( "onClientMarkerHit", resourceRoot, system ) Fixed. Problems found: 1: Your GUI-labels we're in front of the GUI-buttons, that's why you couldn't click them. 2: You was creating the close button and the info label 3 times, because you set it inside the loop. 3: You was cleaning the "towar" and "kapuj" tables every time you created the button, becuase you set it inside the loop.
-
What doesn't work? post your complete script.
-
setElementVisibleTo ( myMarker, getRootElement(), false ) setElementInterior ( myMarker, 17 ) function getdriver ( driver ) if ( driver ) then blipe = createBlipAttachedTo ( myMarker, 51, 1, 255, 255, 255, 255, 0, 9999, driver ) local textDisplay = textCreateDisplay ( ) local driver = getVehicleOccupant ( hijackerv ) local sombra = textCreateTextItem ( "Estas dentro del auto, apresúrate!!", 0.300, 0.955, 2, 255, 25, 25, 255, 2 ) local textItem = textCreateTextItem ( "Estas dentro del auto, apresúrate!!", 0.298, 0.955, 2, 0, 0, 0, 255, 2 ) textDisplayAddText ( textDisplay, textItem ) textDisplayAddObserver ( textDisplay, driver ) textDisplayAddText ( textDisplay, sombra ) setTimer ( textDestroyTextItem, 5000, 1, textItem ) setTimer ( textDestroyDisplay, 5000, 1, textDisplay ) setElementVisibleTo ( myMarker, driver, true ) else setElementVisibleTo ( myMarker, driver, false ) setElementVisibleTo ( blipe, driver, false ) setElementInterior ( myMarker, 1 ) end end addEventHandler ( "onVehicleEnter", hijackerv, getdriver ) function hijacker ( driver, matchingDimension, hijackerv ) setElementVisibleTo ( myMarker, driver, true ) setElementVisibleTo ( blipe, driver, true ) setElementInterior ( myMarker, 0 ) end addEventHandler ( "onVehicleEnter", hijackerv, hijacker ) The last argument of: createBlipAttachedTo is the visibleTo.
-
I don't think that's possible figleaf.
-
function zakup ( ) if ( source == kupuj [ 1 ] ) then outputChatBox ( "Zaladowales towar o id 1!" ) elseif ( source == kupuj [ 2 ] ) then outputChatBox ( "Zaladowales towar o id 2!" ) elseif ( source == kupuj [ 3 ] ) then outputChatBox ( "Zaladowales towar o id 3!" ) end end oknotow = guiCreateWindow((x-500)/2,(y-350)/2,500,350,"System towarów",false) for k, v in ipairs ( towary ) do towar = {} zakup = {} kupuj = {} info = guiCreateLabel (0.06,0.08,0.9,0.3,"Towar Ilosc score Min. suma Max. suma", true, oknotow) guiSetFont ( info, "default-bold-small" ) towar[1] = guiCreateLabel (0.03,0.1+0.08*k,0.9,0.3,v[2],true,oknotow) towar[2] = guiCreateLabel (0.27,0.1+0.08*k,0.9,0.3,v[3],true,oknotow) towar[3] = guiCreateLabel (0.46,0.1+0.08*k,0.9,0.3,v[4].."$",true,oknotow) towar[4] = guiCreateLabel (0.68,0.1+0.08*k,0.9,0.3,v[5].."$",true,oknotow) kupuj[k] = guiCreateButton (0.8,0.095+0.08*k,0.13,0.06,"Zaladuj",true,oknotow) addEventHandler ( "onClientGUIClick", kupuj[k], zakup, false ) zamknij = guiCreateButton (0.45,0.9,0.15,0.07,"Zamknij",true,oknotow) addEventHandler ( "onClientGUIClick", zamknij, closegui ) guiSetVisible ( oknotow, false ) end P.S: Is not possible to hide a blip in the "big map ( F11 )" and not in the radar.
-
He asked if there is ANY error in the debugscript.
-
Topic moved to: "Scripting" section.
-
To get selected item: guiGridListGetSelectedItem To get selected item text/data: guiGridListGetItemData guiGridListGetItemText
-
function Encender3 ( ) if ( getPlayerMoney ( source ) >= 500 ) then takePlayerMoney ( source, 500 ) giveWeapon ( source, 25, 100 ) else outputChatBox ( "No hay dinero no hay armas amigo" ) end end addEvent( "Armas.Escopeta", true ) addEventHandler( "Armas.Escopeta", getRootElement(), Encender3 )
-
You can use this small script I created for you and anyone else who needs it: http://www.mediafire.com/?lqq6gnd2hh8q54b