Narutimmy Posted February 12, 2013 Posted February 12, 2013 Hola lo que pasa es que quiero que todos los autos por ejemplo el hydra solo puedan se usados por una cuenta... osea asi encuentren el auto tirado no lo puedan usar. Tenia este scrip que es para los Niveles pero quiero para cuenta. function bloqeo ( thePlayer, seat, jacked ) local elev = tonumber ( getElementData ( thePlayer, "level" ) ) or 0 local id = getElementModel ( source ) if ( seat == 0 ) and ( id == 432 or id == 425 or id == 520 ) and ( elev < 40 ) then -- donde dice 40 cambialo por el level que quieras outputChatBox ( "[sERVER]: Nesesitas ser Nivel 40 para usar este Veiculo", thePlayer, 255, 100, 100, false ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), bloqeo ) mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 Usa getPlayerAccount getAccountName Asi? function naru ( thePlayer, seat, jacked ) local elev = tonumber ( getElementData ( thePlayer, "level" ) ) or 0 local id = getElementModel ( source ) local account = getPlayerAccount(source) if ( seat == 0 ) and ( id == 434 ) and ( elev < 1 ) and (account == Narutimmy) then -- donde dice 40 cambialo por el level que quieras outputChatBox ( "[sERVER]: Auto de Narutimmy", thePlayer, 255, 100, 100, false ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), naru ) no entendi el getAccountName mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
FraN-724 Posted February 12, 2013 Posted February 12, 2013 Te puedes guiar por mi script, este es FraN = createVehicle ( 411, 3904.248046875, -667.126953125, 59.951560974121, 0, 0, 0) setVehicleDamageProof ( FraN, true ) setVehicleColor ( FraN, 0, 187, 255, 187, 255, 0 ) setElementData(FraN , "owner", "FraN-724") function onLockedVehicleEnter ( player, seat, jacked ) if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then outputChatBox ("Propiedad De "..tostring(getElementData(source, "owner" )), player, 255, 50, 0) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter )
Plate Posted February 12, 2013 Posted February 12, 2013 function naru ( thePlayer, seat, jacked ) local elev = tonumber ( getElementData ( thePlayer, "level" ) ) or 0 local id = getElementModel ( source ) local account = getPlayerAccount(thePlayer) local name = getAccountName(account) if ( seat == 0 ) and ( id == 434 ) and ( elev < 1 ) and (name == Narutimmy) then outputChatBox ( "[sERVER]: Auto de Narutimmy", thePlayer, 255, 100, 100, false ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), naru ) nose si va a andar asi probalo igual Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 Te puedes guiar por mi script, este es FraN = createVehicle ( 411, 3904.248046875, -667.126953125, 59.951560974121, 0, 0, 0) setVehicleDamageProof ( FraN, true ) setVehicleColor ( FraN, 0, 187, 255, 187, 255, 0 ) setElementData(FraN , "owner", "FraN-724") function onLockedVehicleEnter ( player, seat, jacked ) if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then outputChatBox ("Propiedad De "..tostring(getElementData(source, "owner" )), player, 255, 50, 0) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) owner es la cuenta? asi? setVehicleDamageProof ( id, true ) setElementData(id , "Narutimmy", "Zastin") function onLockedVehicleEnter ( player, seat, jacked ) local id = getElementModel ( source ) if getElementData(source, "Narutimmy") and getElementData(source, "Narutimmy" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) and ( id == 434 ) then outputChatBox ("Propiedad De "..tostring(getElementData(source, "Narutimmy" )), player, 255, 50, 0) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 function naru ( thePlayer, seat, jacked ) local elev = tonumber ( getElementData ( thePlayer, "level" ) ) or 0 local id = getElementModel ( source ) local account = getPlayerAccount(thePlayer) local name = getAccountName(account) if ( seat == 0 ) and ( id == 434 ) and ( elev < 1 ) and (name == Narutimmy) then outputChatBox ( "[sERVER]: Auto de Narutimmy", thePlayer, 255, 100, 100, false ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), naru ) nose si va a andar asi probalo igual lo probe pero no anda mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
Plate Posted February 12, 2013 Posted February 12, 2013 function naru ( thePlayer, seat, jacked ) local elev = tonumber ( getElementData ( thePlayer, "level" ) ) or 0 local id = getElementModel ( source ) local account = getAccountName(getPlayerAccount(thePlayer)) if ( seat == 0 ) and ( id == 434 ) and ( elev < 1 ) and (account == Narutimmy) then outputChatBox ( "[sERVER]: Auto de Narutimmy", thePlayer, 255, 100, 100, false ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), naru ) y asi? Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
FraN-724 Posted February 12, 2013 Posted February 12, 2013 Narutimmy en owner dejalo tal cual donde dice FraN-724 esa es la cuenta. Osea así Naru = createVehicle ( 411, 3904.248046875, -667.126953125, 59.951560974121, 0, 0, 0) setVehicleDamageProof ( Naru, true ) setVehicleColor ( Naru, 0, 187, 255, 187, 255, 0 ) setElementData(Naru, "owner", "Narutimmy") function onLockedVehicleEnter ( player, seat, jacked ) if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then outputChatBox ("Propiedad De "..tostring(getElementData(source, "owner" )), player, 255, 50, 0) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter )
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 function naru ( thePlayer, seat, jacked ) local elev = tonumber ( getElementData ( thePlayer, "level" ) ) or 0 local id = getElementModel ( source ) local account = getAccountName(getPlayerAccount(thePlayer)) if ( seat == 0 ) and ( id == 434 ) and ( elev < 1 ) and (account == Narutimmy) then outputChatBox ( "[sERVER]: Auto de Narutimmy", thePlayer, 255, 100, 100, false ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), naru ) y asi? no anda mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 Narutimmy en owner dejalo tal cual donde dice FraN-724 esa es la cuenta. Osea así Naru = createVehicle ( 411, 3904.248046875, -667.126953125, 59.951560974121, 0, 0, 0) setVehicleDamageProof ( Naru, true ) setVehicleColor ( Naru, 0, 187, 255, 187, 255, 0 ) setElementData(Naru, "owner", "Narutimmy") function onLockedVehicleEnter ( player, seat, jacked ) if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then outputChatBox ("Propiedad De "..tostring(getElementData(source, "owner" )), player, 255, 50, 0) cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) no me explico o no se si se puede, no quiero blokear un solo auto que el scrip cree, quiero blokear todos los autos de ese modelo mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
Plate Posted February 12, 2013 Posted February 12, 2013 Que error te dice en el debugscript con mi codigo Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 Que error te dice en el debugscript con mi codigo no me tira error, solo no funciona mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
JuanM27 Posted February 12, 2013 Posted February 12, 2013 es facil eso, creas una tabla con todos ID de los vehiculos a bloquear, y en el evento onVehicleStartEnter comprobas si al intentar entrar a ese vehiculo, si no es de tu cuenta que no pueda entrar con cancelEvent por ejemplo algo asi podria funcionar. local vehiculos = { [482] = true, [414] = true, [413] = true, [440] = true} addEventHandler( "onVehicleStartEnter", root, function( player, seat ) local account = getAccountName(getPlayerAccount(player)) if vehiculos[getElementModel ( source )] and (seat == 0) and (account ~= "TUCUENTA") then --TUCUENTA POR TU CUENTA outputChatBox ( "Este Vehiculo solo es para Cuentas autorizadas!!!", player,255,0,0) cancelEvent() end end )
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 es facil eso, creas una tabla con todos ID de los vehiculos a bloquear,y en el evento onVehicleStartEnter comprobas si al intentar entrar a ese vehiculo, si no es de tu cuenta que no pueda entrar con cancelEvent por ejemplo algo asi podria funcionar. local vehiculos = { [482] = true, [414] = true, [413] = true, [440] = true} addEventHandler( "onVehicleStartEnter", root, function( player, seat ) local account = getAccountName(getPlayerAccount(player)) if vehiculos[getElementModel ( source )] and (seat == 0) and (account ~= "TUCUENTA") then --TUCUENTA POR TU CUENTA outputChatBox ( "Este Vehiculo solo es para Cuentas autorizadas!!!", player,255,0,0) cancelEvent() end end ) *-* muchas gracias, ya habia probado de todo mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
Recommended Posts