explOdeR Posted June 23, 2012 Share Posted June 23, 2012 Hola gente de el foro *-* Saben he estado intentando hacer un script para darle un color a mi team de race ejemplo : si el color del team es AAFF00 : AMARILLO VERDOSO, quiero que las luces y el auto sea así agradeceria mucho que me ayudaran o me dijeran que tengo que leer :] Gracias Link to comment
Castillo Posted June 23, 2012 Share Posted June 23, 2012 onVehicleEnter getPlayerTeam getTeamColor setVehicleColor Link to comment
explOdeR Posted June 23, 2012 Author Share Posted June 23, 2012 ya se me es dificil lo unico que me queda es agregarlo al autoteam es el setVehicleColor Link to comment
BorderLine Posted June 24, 2012 Share Posted June 24, 2012 en ese caso, en el autoteam, deveras definir el vehicle, porq el argumento de setVehiceColor no indica el jugador, indica el vehiculo, por lo que deberas poner un getPedOccupiedVehicle Link to comment
explOdeR Posted June 26, 2012 Author Share Posted June 26, 2012 function onSetTeamColorToCar(thePlayer) if isPedInVehicle (thePlayer) then local hisTeam = getPlayerTeam(thePlayer) if (hisTeam) then local r,g,b = getTeamColor(hisTeam) local hisVehicle = getPedOccupiedVehicle(thePlayer) setVehicleColor(hisVehicle,tonumber(r),tonumber(g),tonumber(b)) else -- if player not have team then local r,g,b = math.random(255),math.random(255),math.random(255) local hisVehicle = getPedOccupiedVehicle(thePlayer) setVehicleColor(hisVehicle,r,g,b) end end end end function onWaitingForLaggers() --Delay it a bit to allow players to warp in their vehicle setTimer(onSetTeamColorToCar,2000,1,source) end addEventHandler("onNotifyPlayerReady",getRootElement(),onWaitingForLaggers) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),onSetTeamColorToCar) addEventHandler("onPlayerReachCheckpoint",getRootElement(),onSetTeamColorToCar) ? asi me quedo Link to comment
explOdeR Posted June 26, 2012 Author Share Posted June 26, 2012 nopes en debugscript sale no [end] algo asi pero faltan ends... Link to comment
Arsilex Posted June 26, 2012 Share Posted June 26, 2012 Prueba esto function onSetTeamColorToCar(thePlayer) if isPedInVehicle (thePlayer) then local hisTeam = getPlayerTeam(thePlayer) if (hisTeam) then local r,g,b = getTeamColor(hisTeam) local hisVehicle = getPedOccupiedVehicle(thePlayer) setVehicleColor(hisVehicle,tonumber(r),tonumber(g),tonumber(b)) else -- if player not have team then local r,g,b = math.random(255),math.random(255),math.random(255) local hisVehicle = getPedOccupiedVehicle(thePlayer) setVehicleColor(hisVehicle,r,g,b) end end end function onWaitingForLaggers() --Delay it a bit to allow players to warp in their vehicle setTimer(onSetTeamColorToCar,2000,1,source) end addEventHandler("onNotifyPlayerReady",getRootElement(),onWaitingForLaggers) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),onSetTeamColorToCar) addEventHandler("onPlayerReachCheckpoint",getRootElement(),onSetTeamColorToCar) Link to comment
explOdeR Posted June 26, 2012 Author Share Posted June 26, 2012 nop debugscript3 = Bad argument@ "isPedInVehicle" i cuando sale el color del auto al nextmap se cambia algo debe andar mal... Link to comment
BorderLine Posted June 26, 2012 Share Posted June 26, 2012 agregale un onResourceStart Link to comment
explOdeR Posted June 27, 2012 Author Share Posted June 27, 2012 function onSetTeamColorToCar(thePlayer) if isPedInVehicle (thePlayer) then local hisTeam = getPlayerTeam(thePlayer) if (hisTeam) then local r,g,b = getTeamColor(hisTeam) local hisVehicle = getPedOccupiedVehicle(thePlayer) setVehicleColor(hisVehicle,tonumber(r),tonumber(g),tonumber(b)) else -- if player not have team then local r,g,b = math.random(255),math.random(255),math.random(255) local hisVehicle = getPedOccupiedVehicle(thePlayer) setVehicleColor(hisVehicle,r,g,b) end end end function onWaitingForLaggers() --Delay it a bit to allow players to warp in their vehicle setTimer(onSetTeamColorToCar,2000,1,source) end addEventHandler("onNotifyPlayerReady",getRootElement(),onWaitingForLaggers) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),onSetTeamColorToCar) addEventHandler("onPlayerReachCheckpoint",getRootElement(),onSetTeamColorToCar) addEventHandler("onResourceStart",getRootElement(),onSetTeamColorToCar) Link to comment
Recommended Posts