Plate Posted June 10, 2012 Posted June 10, 2012 Como se podria hacer para que con un comando uno user x del acl x agregue el player a un team instantaneamente y lo saque instantaneamente con ese comando Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Alexs Posted June 10, 2012 Posted June 10, 2012 No te dare el script, pero si las funciones: setPlayerTeam getPlayerFromName addCommandHandler Developer @ MYVAL
Castillo Posted June 10, 2012 Posted June 10, 2012 addCommandHandler isObjectInACLGroup getPlayerFromName setPlayerTeam San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 10, 2012 Author Posted June 10, 2012 MUCHAS GRACIAS A LOS DOS Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 solid hasta hay va bien no??? (despues ago los detalles) function team ( source ) local team = getTeamFromName( 'Umbrella') if ( team ) then setPlayerTeam( source, team ) outputChatBox("Umbrella ",source,255,255,0) end end addCommandHandler("umbrella", team) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 Si. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 sigue bien ?( a medida que agregue cosas preguntare) function teams ( source, thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "LiderUmbrella" ) ) then local teams = getTeamFromName( 'Umbrella') if ( teams ) then setPlayerTeam( source, teams ) outputChatBox("Umbrella ",source,255,255,0) end end end addCommandHandler("Umbrella", teams) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 function teams ( source ) local accName = getAccountName ( getPlayerAccount ( source ) ) -- Porque pusiste 'thePlayer' si tu argumento es 'source'? if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "LiderUmbrella" ) ) then local teams = getTeamFromName ( 'Umbrella') if ( teams ) then setPlayerTeam ( source, teams ) outputChatBox ( "Umbrella ", source, 255, 255, 0 ) end end end addCommandHandler ( "Umbrella", teams ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 Gracias ahora solamente me faltaria hacer que lo saque Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 En lugar de "teams" en setPlayerTeam, pones nil, deberia quitarlo del team. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 exelente solid muchas gracias pero tengo otro problema auto = createVehicle ( 433, -2270, 2300.8999023438, 5.4000000953674, 0, 0, 270 ) function autos(thePlayer, seat) if seat ~= 0 and source == auto then local accountname = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "guest" ) ) then return end cancelEvent() outputChatBox ( "solamente umbrella puede usar estos vehiculos", thePlayer, 255, 0, 0, true ) end end addEventHandler ( "onVehicleStartEnter", root, autos ) no me funciona Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 auto = createVehicle ( 433, -2270, 2300.8999023438, 5.4000000953674, 0, 0, 270 ) function autos ( thePlayer, seat ) if ( seat ~= 0 and source == auto ) then local accountName = getAccountName ( getPlayerAccount ( thePlayer ) ) if ( not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "guest" ) ) ) then cancelEvent ( ) outputChatBox ( "solamente umbrella puede usar estos vehiculos", thePlayer, 255, 0, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", root, autos ) Tu ACL de Umbrella se llama "guest"? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 emm eso espera auto = createVehicle ( 433, -2270, 2300.8999023438, 5.4000000953674, 0, 0, 270 ) function autos(thePlayer, seat) if seat ~= 0 and source == auto then local accountname = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Umbrella" ) ) then return end cancelEvent() outputChatBox ( "solamente umbrella puede usar estos vehiculos", thePlayer, 255, 0, 0, true ) end end addEventHandler ( "onVehicleStartEnter", root, autos ) pero igual no funciona u.u Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 auto = createVehicle ( 433, -2270, 2300.8999023438, 5.4000000953674, 0, 0, 270 ) function autos ( thePlayer, seat ) if ( seat == 0 and source == auto ) then -- Aca tenias que checkear si el asiento era "0", no si no era "0". local accountName = getAccountName ( getPlayerAccount ( thePlayer ) ) if ( not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Umbrella" ) ) ) then cancelEvent ( ) outputChatBox ( "solamente umbrella puede usar estos vehiculos", thePlayer, 255, 0, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", root, autos ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 GRACIAS SOLID SOS EL MEJOR GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 Solid con el systema de reset tengo un problema cuando se desconnectan los players los pierden deve ser por que no le puse un getAccountData y un setAccountData Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 Exacto, tendrias que guardar el element data cuando se vayan del servidor. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 solid otro problema mas y no te jodo hasta como 1 semana (un milagro) esto tiene un problema por que yo pongo /quitarUmbrella EL_X y me saca a mi y pongo /agregarUmbrella EL_X y me agrega a mi function teams ( source ) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "LiderUmbrella" ) ) then local teams = getTeamFromName ( 'Umbrella') if ( teams ) then setPlayerTeam ( source, teams ) end end end addCommandHandler ( "agregarUmbrella", teams ) function teams ( source ) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "LiderUmbrella" ) ) then local teams = getTeamFromName ( 'Umbrella') if ( teams ) then setPlayerTeam ( source, nil ) end end end addCommandHandler ( "quitarUmbrella", teams ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 Pues claro, si ahi estas usando el elemento 'source' que seria el que uso el comando. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 tendria que usar player o thePlayer no? Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted June 11, 2012 Posted June 11, 2012 Tenes que agregar otro argumento y usar getPlayerFromName. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted June 11, 2012 Author Posted June 11, 2012 hay va bien? function teams ( sourcePlayer ) local accName = getAccountName ( getPlayerAccount ( sourcePlayer ) ) if isObjectInACLGroup ("user.".. accName, aclGetGroup ( "LiderUmbrella" ) ) then local pname = getPlayerFromName ( sourcePlayer ) if (pname) then local teams = getTeamFromName ( 'Umbrella') if ( teams ) then setPlayerTeam ( sourcePlayer, teams ) end end end end addCommandHandler ( "agregarUmbrella", teams ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
NodZen Posted June 11, 2012 Posted June 11, 2012 No seria mas facil bloquear los autos , segun el ID del skin del team? umbrellaVehicles = { [490]=true,[497]=true,[597]=true,[599]=true } umbrellaSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[285]=true,[286]=true } function enterVehicle ( player, seat, jacked ) if ( umbrellaVehicles[getElementModel(source)] ) and ( not umbrellaSkins[getElementModel(player)] ) then cancelEvent() outputChatBox ( "Solo los miembros Umbrella pueden conducir estos vehiculos" 255 , 0 ,0 , true ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Es mas facil (para Mi) ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
Recommended Posts