PaoloPG Posted August 16, 2013 Share Posted August 16, 2013 vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle, 1, 1 ) function lockPrivate( player, seat, Login ) if ( source == vehicle1 ) then local account = getPlayerAccount( player ) local accountName = ( account and getAccountName ( account ) or "" ) if not( accountName == "Paolo" ) then cancelEvent() outputChatBox("-|ExM|-:#fdfdfdEste Auto Pertenece a #Paolo#151627// ", player, 187, 255, 0, true) --- Mensaje else outputChatBox("-|ExM|- :#fdfdfdBienvenido A tu Auto #Paolo#151627//", player, 187, 255, 0, true) --- MSG end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate ) setVehicleDamageProof(vehicle, true) todo funciona pero quiero el godmode y el color del auto :B Link to comment
Castillo Posted August 16, 2013 Share Posted August 16, 2013 vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) function lockPrivate( player, seat, Login ) if ( source == vehicle1 ) then local account = getPlayerAccount( player ) local accountName = ( account and getAccountName ( account ) or "" ) if not( accountName == "Paolo" ) then cancelEvent() outputChatBox("-|ExM|-:#fdfdfdEste Auto Pertenece a #Paolo#151627// ", player, 187, 255, 0, true) --- Mensaje else setVehicleDamageProof(source, true) outputChatBox("-|ExM|- :#fdfdfdBienvenido A tu Auto #Paolo#151627//", player, 187, 255, 0, true) --- MSG end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate ) Link to comment
PaoloPG Posted August 16, 2013 Author Share Posted August 16, 2013 vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) function lockPrivate( player, seat, Login ) if ( source == vehicle1 ) then local account = getPlayerAccount( player ) local accountName = ( account and getAccountName ( account ) or "" ) if not( accountName == "Paolo" ) then cancelEvent() outputChatBox("-|ExM|-:#fdfdfdEste Auto Pertenece a #Paolo#151627// ", player, 187, 255, 0, true) --- Mensaje else setVehicleDamageProof(source, true) outputChatBox("-|ExM|- :#fdfdfdBienvenido A tu Auto #Paolo#151627//", player, 187, 255, 0, true) --- MSG end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate ) ._. eso devo ponerlo en el client.lua ? Lo e puesto y igual se daña Link to comment
PaoloPG Posted August 16, 2013 Author Share Posted August 16, 2013 Server side. Que es Server side? Link to comment
Castillo Posted August 16, 2013 Share Posted August 16, 2013 Es el tipo de script que debe ser, se define en el archivo meta.xml. Link to comment
Daniel1zD Posted August 16, 2013 Share Posted August 16, 2013 (edited) " PaoloPG" version="1.0" description="" type="script" /> vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) --setVehicleDamageProof ( vehicle1, true ) -- god --setVehicleColor ( vehicle1, 145, 0, 161, 124, 0, 0 ) -- color del auto --setVehicleHeadLightColor ( vehicle1, 150, 255, 0 )-- luzes de color vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) function lockPrivate( player, seat, Login ) if ( source == vehicle1 ) then local account = getPlayerAccount( player ) local accountName = ( account and getAccountName ( account ) or "" ) if not( accountName == "Paolo" ) then cancelEvent() outputChatBox("-|ExM|-:#fdfdfdEste Auto Pertenece a #Paolo#151627// ", player, 187, 255, 0, true) --- Mensaje else setVehicleDamageProof(source, true) outputChatBox("-|ExM|- :#fdfdfdBienvenido A tu Auto #Paolo#151627//", player, 187, 255, 0, true) --- MSG end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate ) Edited August 16, 2013 by Guest Link to comment
MTA Team 0xCiBeR Posted August 16, 2013 MTA Team Share Posted August 16, 2013 " PaoloPG" version="1.0" description="" type="script" /> vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) --setVehicleDamageProof ( vehicle1, true ) -- god --setVehicleColor ( vehicle1, 145, 0, 161, 124, 0, 0 ) -- color del auto --setVehicleHeadLightColor ( vehicle1, 150, 255, 0 )-- luzes de color función lockPrivate ( jugador , asiento, Entrar ) si ( fuente == vehículo1 ) entonces local de cuenta = getPlayerAccount ( jugador ) locales accountName = ( cuenta y getAccountName ( cuenta ) o "" ) si no ( accountName == "Paolo" ) a continuación, CancelarEvento ( ) outputChatBox ( "- | ExM | -: # fdfdfdEste Auto Pertenece a # Paolo # 151627 / /" , jugador , 187 , 255 , 0 , cierto ) --- Mensaje más setVehicleDamageProof ( fuente, cierto ) outputChatBox ( "- | ExM | -: # fdfdfdBienvenido A tu Auto # Paolo # 151627 / /" , jugador , 187 , 255 , 0 , cierto ) --- MSG final final final AddEventHandler ( "onVehicleStartEnter" , getRootElement ( ) , lockPrivate ) Eso me dio muerte cerebral..Espero solo sea una explicacion Link to comment
Daniel1zD Posted August 16, 2013 Share Posted August 16, 2013 bueno cometi el error de copiar el guion en español y pido disculpas por ese error que tuve cry: Link to comment
MTA Team 0xCiBeR Posted August 17, 2013 MTA Team Share Posted August 17, 2013 bueno cometi el error de copiar el guion en español y pido disculpas por ese error que tuve cry: esta bien igual el script, solo remplaza lo que esta en español por sus equivalentes en ingles.. Ej: "Si" iria "If" y asi Link to comment
Daniel1zD Posted August 17, 2013 Share Posted August 17, 2013 (edited) vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) --setVehicleDamageProof ( vehicle1, true ) -- god --setVehicleColor ( vehicle1, 145, 0, 161, 124, 0, 0 ) -- color del auto --setVehicleHeadLightColor ( vehicle1, 150, 255, 0 )-- luzes de color function lockPrivate( player, seat, Login ) if ( source == vehicle1 ) then local account = getPlayerAccount( player ) local accountName = ( account and getAccountName ( account ) or "" ) if not( accountName == "Paolo" ) then cancelEvent() outputChatBox("-|ExM|-:#fdfdfdEste Auto Pertenece a #Paolo#151627// ", player, 187, 255, 0, true) --- Mensaje else setVehicleDamageProof(source, true) outputChatBox("-|ExM|- :#fdfdfdBienvenido A tu Auto #Paolo#151627//", player, 187, 255, 0, true) --- MSG end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate ) " PaoloPG" version="1.0" description="" type="script" /> Edited August 18, 2013 by Guest Link to comment
MTA Team 0xCiBeR Posted August 17, 2013 MTA Team Share Posted August 17, 2013 Aqui una pequeña mejor al codigo de flaky, para detectar la cuenta y ademas para cancelar si eres invitado. vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) --setVehicleDamageProof ( vehicle1, true ) -- god --setVehicleColor ( vehicle1, 145, 0, 161, 124, 0, 0 ) -- color del auto --setVehicleHeadLightColor ( vehicle1, 150, 255, 0 )-- luzes de color vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) function lockPrivate( player, seat, Login ) if ( source == vehicle1 ) then local account = getPlayerAccount( player ) --Deteccion de cuenta invitado if isGuestAccount ( account ) then cancelEvent () end --Fin de deteccion local accountName = getAccountName ( account ) if not( accountName == "Paolo" ) then cancelEvent() outputChatBox("-|ExM|-:#fdfdfdEste Auto Pertenece a Paolo", player, 187, 255, 0, true) --- Mensaje else setVehicleDamageProof(source, true) outputChatBox("-|ExM|- :#fdfdfdBienvenido A tu Auto "..accountName, player, 187, 255, 0, true) --- MSG end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate ) Link to comment
Recommended Posts