SpikeL Comunidad
Hola, bienvenido a SpikeL Foro.

Si eres nuevo, deves registrarte.

Si ya tienes una cuenta, deves ingresar.

¡Muchas gracias!

PD: Si te has registrado pero no puedes logear tienes que activar tu cuenta desde tu e-mail.


Unirse al foro, es rápido y fácil

SpikeL Comunidad
Hola, bienvenido a SpikeL Foro.

Si eres nuevo, deves registrarte.

Si ya tienes una cuenta, deves ingresar.

¡Muchas gracias!

PD: Si te has registrado pero no puedes logear tienes que activar tu cuenta desde tu e-mail.
SpikeL Comunidad
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

Sistema de global

Ir abajo

Sistema de global Empty Sistema de global

Mensaje por santi55 Lun Dic 20, 2010 3:48 pm

1º Buscar:



If UCase$(Left$(rdata, 11)) = "/SILENCIAR " Then



2º Arriba ponemos:




If UCase$(Left$(rdata, 10)) = "/NOGLOBAL " Then
rdata = Right$(rdata, Len(rdata) - 10)
Dim UserGlobal As String
Dim MinutosGlobal As Integer
UserGlobal = ReadField(1, rdata, Asc("@"))
MinutosGlobal = ReadField(2, rdata, Asc("@"))
If UserGlobal = "" Then Exit Sub

tIndex = NameIndex(UserGlobal)
If tIndex <= 0 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "||Usuario offline." & FONTTYPE_INFO)
Exit Sub
End If
UserList(tIndex).flags.GPuede = 1
UserList(tIndex).flags.GMinutos = val(MinutosGlobal)
UserList(tIndex).flags.GMinutosP = val(MinutosGlobal)
UserList(tIndex).flags.GSegundos = 0
Call SendData(SendTarget.ToIndex, tIndex, 0, "|| Has sido silenciado. Durante: " & MinutosGlobal & " minutos, no podras utilizar el global." & FONTTYPE_INFO)
Call SendData(SendTarget.ToIndex, tIndex, 0, "|| Has silenciado al usuario." & FONTTYPE_INFO)
Exit Sub
End If




3º Ahora buscamos :


If UCase$(Left$(rdata, 6)) = "/GMSG " And UserList(UserIndex).flags.Privilegios > 0 Then



4º Y arriba ponemos:




Select Case UCase$(Left$(rdata, 9))
Case "/CONSOLA "
rdata = Right$(rdata, Len(rdata) - 9)
' Si no es nivel 10 que no lo pueda usar
If UserList(UserIndex).Stats.ELV < 10 Then
Call SendData(ToIndex, UserIndex, 0, "|| Debes ser nivel 10 o superior para usar el global!!!." & FONTTYPE_INFO)
Exit Sub
End If
' Si no tiene el global activado le avisa
If UserList(UserIndex).flags.GGlobal = 0 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "|| No tienes el global activado!!!, para activarlo escribe /GLOBAL" & FONTTYPE_INFO)
Exit Sub
End If
' Si los administradores le prohibieron el habla le avisa
If UserList(UserIndex).flags.GPuede = 1 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "|| Por tu mal comportamiento, no podras volver a hablar en: " & UserList(UserIndex).flags.GMinutos & " minutos." & FONTTYPE_WARNING)
Exit Sub
End If
For i = 1 To LastUser
' Se lo enviamos solamente a los que tienen el global activado.
If UserList(UserIndex).flags.GGlobal = 0 Then Exit Sub
Call SendData(SendTarget.ToIndex, i, 0, "|| " & UserList(UserIndex).Name & " dice: " & rdata & FONTTYPE_GLOBAL)

Next i
Exit Sub
End Select

Select Case UCase$(Left$(rdata, 7))
Case "/GLOBAL"
If UserList(USERINDEx).flags.GGlobal = 0 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "|| Global Activado." & FONTTYPE_INFO)
UserList(USERINDEx).flags.GGlobal = 1
Else
Call SendData(SendTarget.ToIndex, UserIndex, 0, "|| Global desactivado." & FONTTYPE_INFO)
UserList(USERINDEx).flags.GGlobal = 0
End If
Exit Sub
End Select



5º Ahora buscamos:



Public Const FONTTYPE_GUILD = "~255~255~255~1~0"



6º Y debajo ponemos:




Public Const FONTTYPE_GLOBAL = "~255~154~38~1~0"




7º Ahora buscamos:



Type UserFlags



8º Debajo ponemos:




GGlobal As Byte
GPuede As Byte
GMinutos As Integer
GMinutosP As Integer
GSegundos As Integer




9º En el Sub PasarSegundo debajo de:



For i = 1 To LastUser



10º Ponemos:




If UserList(i).flags.GPuede = 1 Then
UserList(i).flags.GSegundos = UserList(i).flags.GSegundos + 1
If UserList(i).flags.GSegundos >= 60 Then
UserList(i).flags.GMinutos = UserList(i).flags.GMinutos + 1
If UserList(i).flags.GMinutos >= UserList(i).flags.GMinutosP Then
UserList(i).flags.GMinutos = 0
UserList(i).flags.GSegundos = 0
UserList(i).flags.GPuede = 0
UserList(i).flags.GMinutosP = 0
Call SendData(SendTarget.ToIndex, i, 0, "|| Ya puedes usar el global nuevamente." & FONTTYPE_INFO)
End If
End If
End If




11º En el sub LoadUserInit debajo de :


UserList(UserIndex).flags.Desnudo = val(GetVar(UserFile, "FLAGS", "Desnudo"))



12º Ponemos:




UserList(UserIndex).flags.GGlobal = val(GetVar(UserFile, "GLOBAL", "Activado"))
UserList(UserIndex).flags.GPuede = val(GetVar(UserFile, "GLOBAL", "PuedeUsar"))
UserList(UserIndex).flags.GMinutos = val(GetVar(UserFile, "GLOBAL", "MinutosPasados"))
UserList(UserIndex).flags.GMinutosP = val(GetVar(UserFile, "GLOBAL", "MinutosFaltantes"))




13º y por ultimo en el Sub SaveUser debajo de:



Call WriteVar(UserFile, "GUILD", "GuildPts", str(UserList(UserIndex).GuildInfo.GuildPoints))



14º Ponemos:



Call WriteVar(UserFile, "GLOBAL", "Activado", UserList(UserIndex).flags.GGlobal)
Call WriteVar(UserFile, "GLOBAL", "PuedeUsar", UserList(UserIndex).flags.GPuede)
Call WriteVar(UserFile, "GLOBAL", "MinutosPasados", UserList(UserIndex).flags.GMinutos)
Call WriteVar(UserFile, "GLOBAL", "MinutosFaltantes", UserList(UserIndex).flags.GMinutosP)





Listo!
santi55
santi55
Nivel 12
Nivel 12

Medallas
Sistema de global Prensa1

Advertencias Advertencias : 1
Mensajes Mensajes : 156
Puntos Puntos : 49387
Reputación Reputación : 1
Fecha de inscripción Fecha de inscripción : 19/12/2010
País País : Argentina


Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.