Plate Posted June 10, 2012 Share 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 Link to comment
Alexs Posted June 10, 2012 Share Posted June 10, 2012 No te dare el script, pero si las funciones: setPlayerTeam getPlayerFromName addCommandHandler Link to comment
Castillo Posted June 10, 2012 Share Posted June 10, 2012 addCommandHandler isObjectInACLGroup getPlayerFromName setPlayerTeam Link to comment
Plate Posted June 10, 2012 Author Share Posted June 10, 2012 MUCHAS GRACIAS A LOS DOS Link to comment
Plate Posted June 11, 2012 Author Share 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) Link to comment
Plate Posted June 11, 2012 Author Share 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) Link to comment
Castillo Posted June 11, 2012 Share 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 ) Link to comment
Plate Posted June 11, 2012 Author Share Posted June 11, 2012 Gracias ahora solamente me faltaria hacer que lo saque Link to comment
Castillo Posted June 11, 2012 Share Posted June 11, 2012 En lugar de "teams" en setPlayerTeam, pones nil, deberia quitarlo del team. Link to comment
Plate Posted June 11, 2012 Author Share 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 Link to comment
Castillo Posted June 11, 2012 Share 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"? Link to comment
Plate Posted June 11, 2012 Author Share 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 Link to comment
Castillo Posted June 11, 2012 Share 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 ) Link to comment
Plate Posted June 11, 2012 Author Share Posted June 11, 2012 GRACIAS SOLID SOS EL MEJOR GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS GRACIAS Link to comment
Plate Posted June 11, 2012 Author Share 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 Link to comment
Castillo Posted June 11, 2012 Share Posted June 11, 2012 Exacto, tendrias que guardar el element data cuando se vayan del servidor. Link to comment
Plate Posted June 11, 2012 Author Share 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 ) Link to comment
Castillo Posted June 11, 2012 Share Posted June 11, 2012 Pues claro, si ahi estas usando el elemento 'source' que seria el que uso el comando. Link to comment
Plate Posted June 11, 2012 Author Share Posted June 11, 2012 tendria que usar player o thePlayer no? Link to comment
Castillo Posted June 11, 2012 Share Posted June 11, 2012 Tenes que agregar otro argumento y usar getPlayerFromName. Link to comment
Plate Posted June 11, 2012 Author Share 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 ) Link to comment
NodZen Posted June 11, 2012 Share 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) Link to comment
Recommended Posts