Narutimmy Posted February 12, 2013 Share 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 ) Link to comment
FraN-724 Posted February 12, 2013 Share Posted February 12, 2013 Usa getPlayerAccount getAccountName Link to comment
Narutimmy Posted February 12, 2013 Author Share 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 Link to comment
FraN-724 Posted February 12, 2013 Share 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 ) Link to comment
Plate Posted February 12, 2013 Share 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 Link to comment
Narutimmy Posted February 12, 2013 Author Share 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 ) Link to comment
Narutimmy Posted February 12, 2013 Author Share 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 Link to comment
Plate Posted February 12, 2013 Share 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? Link to comment
FraN-724 Posted February 12, 2013 Share 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 ) Link to comment
Narutimmy Posted February 12, 2013 Author Share 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 Link to comment
Narutimmy Posted February 12, 2013 Author Share 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 Link to comment
Plate Posted February 12, 2013 Share Posted February 12, 2013 Que error te dice en el debugscript con mi codigo Link to comment
Narutimmy Posted February 12, 2013 Author Share Posted February 12, 2013 Que error te dice en el debugscript con mi codigo no me tira error, solo no funciona Link to comment
JuanM27 Posted February 12, 2013 Share 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 ) Link to comment
Narutimmy Posted February 12, 2013 Author Share 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 Link to comment
Recommended Posts