JuanM27 Posted November 16, 2011 Share Posted November 16, 2011 (edited) buenos dias, bueno le comento que estube haciendo un scritp de un job en el cual ya me ayudaron en otro post. pero ahora se me presento un problema y no se si es problema del script o algo de configuracion o de algun otro script que se mescla con el mio. bueno lo que pasa es que el trabajo funciona bien si solamente un player esta realizando el job, pero si hay 2 player en el trabajo, es como que se mesclan y a 1 player se le desaparece los blips o si 1 player pasa por el destino le paga a los 2 players el script me base en el script que esta publicado "busjob", yo le agregue varias cosas y una interfaz de usuario. aca dejor los lua aver si me pueden ayudar aver cual es mi error, por que la verdad no sirbe hacer un job si solo puede jugarlo de 1 player a la vez lua cliente GUIEditor_Label = {} theWindow = guiCreateWindow(350,50,250,350,"[Life]Recolector de Basura",false) guiWindowSetSizable(theWindow,false) guiSetVisible (theWindow, false) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) guiSetFont(GUIEditor_Label[1],"default-bold-small") aceptaBut = guiCreateButton(0.15,0.9,0.3,0.1,"Aceptar",true,theWindow) closeBut = guiCreateButton(0.47,0.9,0.3,0.1,"Close",true,theWindow) info = guiCreateLabel(0.08,0.05,0.9,0.3,"¿Estas Listo para trabajar de basurero?",true,theWindow) guiLabelSetColor(info, 0, 255, 0) info2 = guiCreateLabel(0.15,0.12,0.60,0.3,"Selecciona el Skin a Utilizar!",true,theWindow) guiLabelSetColor(info2, 0, 255, 0) -- es X, Y, Anchura, Altura function creamoslista() autos = guiCreateGridList ( 0.01, 0.19, 0.91, 0.70, true,theWindow ) column = guiGridListAddColumn( autos, "Skins Disponibles", 0.93, true, theWindow ) skin = guiGridListAddRow( autos ) guiGridListSetItemText(autos, skin , column,"16",false,false) skin1 = guiGridListAddRow( autos ) guiGridListSetItemText(autos, skin1 , column,"27",false,false) skin2 = guiGridListAddRow( autos ) guiGridListSetItemText(autos, skin2 , column,"260",false,false) end function resourceStart () bindKey ("F10", "down", menuShow) creamoslista() end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function menuShow () visableornot = guiGetVisible (theWindow) if (visableornot == true) then guiSetVisible (theWindow, false) showCursor (false) end if (visableornot == false) then guiSetVisible (theWindow, true) showCursor (true) end end addEvent ("menuShow",true) addEventHandler ("menuShow",getRootElement(),menuShow) addEvent ("aceptar", true) function guiClick (button, state, absoluteX, absoluteY) if (source == aceptaBut) then if (guiGridListGetSelectedItem (autos)) then local carName = guiGridListGetItemText (autos, guiGridListGetSelectedItem (autos)) triggerServerEvent ("aceptar", getLocalPlayer(), carName) guiSetVisible ( theWindow, false ) showCursor ( false ) end elseif (source == closeBut) then guiSetVisible ( theWindow, false ) showCursor ( false ) end end addEventHandler ("onClientGUIClick", getRootElement(), guiClick) lua server local rootElement = getRootElement() local busses = {[408] = true} local busTable1 = { [1]={1812.65198, -1889.86047, 13.41406}, [2]={1825.22791, -1635.03711, 13.38281}, [3]={1855.01685, -1430.47449, 13.39063}, [4]={1732.81580, -1296.87122, 13.44294}, [5]={1473.19226, -1295.77124, 13.48315}, [6]={1443.60376, -1498.26660, 13.37650}, [7]={1426.37280, -1716.12439, 13.38281}, [8]={1315.06909, -1656.43799, 13.38281}, [9]={1359.06250, -1432.39734, 13.38281}, [10]={1169.82983, -1392.34473, 13.41728}, [11]={930.76508, -1392.92627, 13.26561}, [12]={815.24756, -1317.91345, 13.44460}, [13]={585.04199, -1320.53748, 13.40609}, [14]={526.99365, -1624.20361, 16.63225}, [15]={461.62615, -1653.70983, 25.22295}, [16]={349.00375, -1641.37426, 33.01234}, [17]={283.18347, -1508.26440, 32.50707}, [18]={491.83459, -1355.50476, 16.90455}, [19]={536.49957, -1262.72802, 16.39253}, [20]={781.46032, -1058.33422, 24.61377}, [21]={958.81518, -1028.21887, 30.35637}, [22]={1068.69287, -1043.55017, 31.81931}, [23]={1249.08374, -1042.40075, 31.72193}, [24]={1258.61950, -1126.96130, 23.86060}, [25]={1329.75378, -1152.39172, 23.64844}, [26]={1443.83020, -1164.71899, 23.65625}, [26]={1701.49987, -1164.30590, 23.65625}, [27]={1871.31677, -1063.75439, 23.68160}, [28]={1966.66015, -1052.50097, 24.26155}, [29]={2163.81005, -1121.65563, 25.39998}, [30]={2163.66894, -1288.02343, 23.82031}, [31]={2124.11914, -1381.50024, 23.83589}, [32]={2109.97851, -1448.50256, 23.82812}, [33]={2078.30712, -1800.12365, 13.38281}, [34]={2078.02832, -1921.02990, 13.31513}, } local miauto = createMarker (767.1, -1032, 24, "cylinder", 1.5,0,255,0,150) function vehicleMarkerHit3 ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) ==getTeamFromName( "Recolector de Basura") then Monters = createVehicle ( 408, 746.14221191406, -1054.2919921875, 23.8869, 0, 0, 125 ) warpPedIntoVehicle(hitElement, Monters) outputChatBox("Para Ganar Dinero Tienes que Ir A Las Figuras Señaladas en el Mapa con El Camion", hitElement, 0, 255, 0 ) else outputChatBox("Solo a Empleados de Recolector se le dará el Camion.!!", hitElement, 0, 255, 0 ) end end addEventHandler( "onMarkerHit", miauto , vehicleMarkerHit3 ) function exit(player) if not busses[getElementModel(getPedOccupiedVehicle(player))] then destroyElement ( Monters ) else destroyElement ( Monters ) end end addEventHandler("onVehicleExit",getRootElement(),exit) function fin( player ) destroyElement ( source ) exit(player) outputChatBox("Usted dejo de Trajabar", player, 255, 200, 0) setPedSkin(player,0) local teamCivil = getTeamFromName ( "Civil" ) setPlayerTeam ( player, teamCivil) end addCommandHandler("endbasu",fin) function getNewBusLocation(thePlayer, ID) local x, y, z = busTable1[ID][1], busTable1[ID][2], busTable1[ID][3] triggerClientEvent(thePlayer,"bus_set_location",thePlayer,x,y,z) end function onVehicleEnter(thePlayer) if not busses[getElementModel(source)] then return end if not getPlayerTeam(thePlayer) then return end if getTeamName(getPlayerTeam(thePlayer)) == "Recolector de Basura" then local x, y, z = getNewBusLocation(thePlayer, 1) setElementData(thePlayer,"busTable1",1) end end addEventHandler("onVehicleEnter",rootElement,onVehicleEnter) addEvent("bus_finish",true) addEventHandler("bus_finish",rootElement, function (client) if not isPedInVehicle(client) then return end if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end givePlayerMoney(client, 200) outputChatBox ("Ganaste $200 por juntar la basura de la calle.", client, 0,255,0) if #busTable1 == tonumber(getElementData(client,"busTable1")) then setElementData(client,"busTable1",1) else setElementData(client,"busTable1",tonumber(getElementData(client,"busTable1"))+1) end getNewBusLocation(client, math.random(#busTable1)) end) function aceptatrabajo() local BasuTeam = createTeam("Recolector de Basura", 255, 200, 30) if getElementType (source) == "player" then level = getPlayerWantedLevel(source) if level == 0 then local BasuTeam = getTeamFromName ( "Recolector de Basura" ) setPlayerTeam ( source, BasuTeam) outputChatBox("Estas Trabajando Como Recolector de Basura.", source, 0,255,0) outputChatBox("Ve a buscar el Camion para comenzar a trabajar!!", source, 0,255,0) else outputChatBox ("Solamente a Personajes que no sea buscados por la policia se le da el trabajo!!!", source, 255,0,0) end end end function creablipcirculo() rpBlipOne = createBlip ( 780.59680175781, -1037.4835205078, 24.361700057983, 44 ) -- blip en el mapa y radar end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), creablipcirculo) punto = createMarker (780.59680175781,-1037.4835205078,24.361700057983,"cylinder",2.0,0,0,225,100) addEvent ("aceptar", true) function aceptar( id ) if id == "260" then setPedSkin(source,id) aceptatrabajo() elseif id == "16" then setPedSkin(source,id) aceptatrabajo() elseif id == "27" then setPedSkin(source,id) aceptatrabajo() else outputChatBox ("Selecciona un Skin Valido!!", source, 255,0,0, false) end end addEventHandler( "aceptar", getRootElement(), aceptar ) function menuShow (jugador) if (source == punto) then triggerClientEvent (jugador,"menuShow",getRootElement(),jugador) end end addEventHandler ("onMarkerHit",getRootElement(),menuShow) bueno eso es el script. PD: lo pregunto aca para no hacer un nuevo post, perdon si no cumplo con alguno normas del foro. existe algun recurso que le agregue la cantidad de estrellas de busqueda al player? ejemplo el server cit tiene por ejemplo en el nombre del personaje: JuanM27[0] siendo el 0 la cantidad de estrellas. o si no existe cual seria el archivo que tengo que modificar, muchas gracias Edited November 16, 2011 by Guest Link to comment
Recommended Posts