Welcome Soldier.



[APORTE] Rangos por Puntos.

Sky^^ Sin conexión
User
#1
Un aporte simple, tal vez a alguien le sirva.


Código:
Código PHP:
<?php 
#include <amxmodx>

new gRange[ 33 ], gPoints[ 33 ];

enum
_:REQUIREDRANGES
{
NAME[32],
PRICE
};

new const
RangesInfo[ ][ REQUIREDRANGES ] =
{
{
"Rango 1", 100 },
{
"Rango 2", 200 },
{
"Rango 3", 300 },
{
"Rango 4", 400 },
{
"Rango 5", 500 }
};

public
plugin_init( )
{
register_plugin( "RangesForPoints", "1.0", "Skylar and Kikizon" );

register_event( "DeathMsg", "event_Death", "a" );

register_clcmd( "say /rango", "CheckRange" );
register_clcmd( "say /puntos", "CheckPoints" );
}

public
event_Death( )
{
new
Attacker = read_data( 1 );
new
Victim = read_data( 2 );

if(
Victim == Attacker ) return;
if( !
is_user_alive( Attacker ) ) return;

UpdateRange( Attacker, 2 );
}

public
CheckRange( id )
{
client_print( id, print_chat, "Eres rango %s.", RangesInfo[ gRange[ id ] ][ NAME ] );
return
PLUGIN_HANDLED;
}
public
CheckPoints( id )
{
client_print( id, print_chat, "Tienes %d punto%s.", gPoints[ id ], gPoints[ id ] == 1 ? "" : "s" );
return
PLUGIN_HANDLED;
}

public
UpdateRange( id, points )
{
gPoints[ id ] += points;

new
Range = gRange[ id ];

while(
gPoints[ id ] >= RangesInfo[ gRange[ id ] ][ PRICE ] )
++
gRange[ id ];

if(
Range < gRange[ id ] )
client_print( id, print_chat, "Felicidades! Subiste al rango %s.", RangesInfo[ gRange[ id ] ][ NAME ] );
}


Salu2.
[Imagen: 76561198095047868.png]

Perfil de amxmodx-es: Skylar
[+] 7 users say Thank You to Sky^^ for this post
Responder

Snower Sin conexión
Ex Moderador & Developer.
#2
No entiendo nada de esto xd, pero a alguien le servirá. Gracias por tu aporte!
instagram.com/snowerg/
[+] 7 users say Thank You to Snower for this post
Responder

Sky^^ Sin conexión
User
#3
(08-26-2017, 02:16 AM)Snower escribió: No entiendo nada de esto xd, pero a alguien le servirá. Gracias por tu aporte!

Gracias  :approved:
[Imagen: 76561198095047868.png]

Perfil de amxmodx-es: Skylar
[+] 4 users say Thank You to Sky^^ for this post
Responder

!Test! LaLo Sin conexión
Yato
#4
Gracias esto se me hará útil.
Hola soy LaLo

Agregame a steam : Steam
[+] 3 users say Thank You to !Test! LaLo for this post
Responder





Usuarios navegando en este tema:
1 invitado(s)



Sobre M X E M E X I C O

Comunidad MxE © 2020 - La mejorar comunidad de Counter Strike 1.6 .