¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.


Todo sobre AO
 
ÍndiceÚltimas imágenesBuscarRegistrarseConectarse

 

 Proteger usuario en consulta

Ir abajo 
AutorMensaje
Agus
Admin



Mensajes : 69
Fecha de inscripción : 01/07/2008

Proteger usuario en consulta Empty
MensajeTema: Proteger usuario en consulta   Proteger usuario en consulta EmptyLun Ago 25, 2008 2:07 am

TODO EN EL SERVIDOR.
Objetivo del Code: Proteger al usuario cuando estando en consulta , el usuario protegido no puede atacar, y si otro usuario lo ataca, automaticamente se lo manda a la carcel por 2 minutos(pueden cambiar el valor)
Buscamos:
Citación :

Type UserFlags
Abajo ponemos:
Citación :

Protegido As Byte 'Matute
TCP:
Buscamos:
Citación :

If UCase$(Left$(rdata, 5)) = "/IRA " Then
Antes del log ponemos:
Citación :

Call SendData(SendTarget.ToAll, 0, 0, "||El usuario " & UserList(tIndex).Name & " esta siendo protegido por el GM. Todo aquel que lo ataque sera encarcelado" & FONTTYPE_SERVER)
UserList(UserIndex).flags.Protegido = 1
Buscamos:
Citación :

If UCase$(rdata) = "/MASSKILL" Then
Arriba ingresamos:
Citación :

If Left$(UCase$(rdata), 5) = "/PRO " Then
rdata = Right$(rdata, Len(rdata) - 5)
tIndex = NameIndex(rdata)
If tIndex > 0 Then
If UserList(tIndex).flags.Privilegios > 1 Then Exit Sub
If UserList(tIndex).flags.Protegido = 1 Then
UserList(tIndex).flags.Protegido = 0
Call SendData(SendTarget.ToIndex, UserIndex, 0, "||Desprotegiste a " & UserList(tIndex).Name & "." & FONTTYPE_SERVER)
Call SendData(SendTarget.ToIndex, tIndex, 0, "||" & UserList(UserIndex).Name & " te desprotegi?." & FONTTYPE_SERVER)
Else
UserList(tIndex).flags.Protegido = 1
Call SendData(SendTarget.ToIndex, UserIndex, 0, "||Protegiste a " & UserList(tIndex).Name & "." & FONTTYPE_SERVER)
Call SendData(SendTarget.ToIndex, tIndex, 0, "||" & UserList(UserIndex).Name & " te protegio. No puedes atacar ni ser atacado." & FONTTYPE_SERVER
End If
End If
End If
HECHIZOS:
Buscamos:
Citación :

Sub HechizoPropUsuario(ByVal UserIndex As Integer, ByRef B As Boolean)
Despues de:
Citación :

tempChr = UserList(UserIndex).flags.TargetUser
Ingresamos:
Citación :

If UserList(tempChr).flags.Protegido = 1 Then
Call Encarcelar(UserIndex, 2, UserList(UserIndex).Name)
Call SendData(SendTarget.ToIndex, UserIndex, 0, "||Motivo: Atacar a un usuario estando protegido por el GM" & FONTTYPE_INFO)
Exit Sub
End If
Buscamos:
Citación :

Sub HechizoEstadoUsuario(ByVal UserIndex As Integer, ByRef B As Boolean)
Despues de:
Citación :

TU = UserList(UserIndex).flags.TargetUser
Ingresamos:
Citación :

If UserList(TU).flags.Protegido = 1 Then
Call Encarcelar(UserIndex, 2, UserList(UserIndex).Name)
Call SendData(SendTarget.ToIndex, UserIndex, 0, "||Motivo: Atacar a un usuario estando protegido por el GM" & FONTTYPE_INFO)
Exit Sub
End If
Buscamos:
Citación :

Sub LanzarHechizo(Index As Integer, UserIndex As Integer)
Despues de:
Citación :

uh = UserList(UserIndex).Stats.UserHechizos(Index)
Ponemos:
Citación :

If UserList(UserIndex).flags.Protegido = 1 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "||No pod?s tirar hechizos mientras est?s siendo protegido por un GM." & FONTTYPE_INFO)
Exit Sub
End If
SISTEMACOMBATE:
Buscamos:
Citación :

Public Sub UsuarioAtaca(ByVal UserIndex As Integer)
Abajo ingresamos:
Citación :

If UserList(UserIndex).flags.Protegido = 1 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "||No puedes atacar mientras estas siendo protegido por un GM." & FONTTYPE_INFO)
Exit Sub
End If
Buscamos:
[quote]
Public Function PuedeAtacar(ByVal AttackerIndex As Integer, ByVal VictimIndex As Integer) As Boolean
[quote]/
Despues de:
Citación :

If (Not Criminal(VictimIndex)) And (UserList(AttackerIndex).Faccion.ArmadaReal = 1) Then
Call SendData(SendTarget.ToIndex, AttackerIndex, 0, "||Los soldados del Ejercito Real tienen prohibido atacar ciudadanos." & FONTTYPE_WARNING)
PuedeAtacar = False
Exit Function
End If
Ingresamos:
Citación :

If UserList(VictimIndex).flags.Protegido = 1 Then
Call SendData(SendTarget.ToIndex, AttackerIndex, 0, "||El usuario esta siendo protegido por un GM." & FONTTYPE_INFO)
Call Encarcelar(AttackerIndex, 2, "El usuario estaba protegido")
Call SendData(SendTarget.ToIndex, AttackerIndex, 0, "||Motivo: Atacar a un usuario estando protegido por el GM" & FONTTYPE_INFO)
Exit Function
End If
'If UserList(AttackerIndex).flags.Protegido = 1 Then
Call SendData(SendTarget.ToIndex, AttackerIndex, 0, "||No podes atacar mientras estas siendo protegido por un GM." & FONTTYPE_INFO)
Call Encarcelar(AttackerIndex, 2, "El usuario estaba protegido")
Call SendData(SendTarget.ToIndex, AttackerIndex, 0, "||Motivo: Intentar atacar estando protegido por el GM" & FONTTYPE_INFO)
Exit Function
'End If
Para que este funcione, deben borrar el IF de "UsuarioAtaca".
Para evitar BUGS:
DECLARACIONES. buscan
Citación :

type UserFlags
Poner:
Citación :

TimeProtected As Integer
EN GENERAL:
ANTES DE:
Citación :

'ANTIEMPOLLOS
Ponemos:
Citación :

ElseIf UserList(i).flags.Protegido = 1 Then
UserList(i).flags.TimeProtected = UserList(i).flags.TimeProtected + 1
If UserList(i).flags.TimeProtected = 180
Call SendData(ToIndex, i, 0, "||Has sido desprotegido automAticamente por el servidor." & FONTTYPE_INFO)
UserList(i).flags.Protegido = 0
UserList(i).flags.TimeProtected = 0
Exit Sub
End If

Con esto el usuario sera desprotegido automaticamente en 3 minutos.

COMANDO: /PRO NICK para proteger al usuario.-

Aclaracion: No lo testie muy bien, porque estoy ocupado, si surge error diganlo
Volver arriba Ir abajo
https://recompilacionao.forosactivos.com
 
Proteger usuario en consulta
Volver arriba 
Página 1 de 1.
 Temas similares
-
» El usuario o npc dice si falla arriba de ellos

Permisos de este foro:No puedes responder a temas en este foro.
 :: Argentum Online :: jijijijijiij-
Cambiar a: