Zplague
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Zplague Entrar

Seu portal de Zombie Plague no Brasil


description[ZP] Doar Ammo Pack Menu Empty[ZP] Doar Ammo Pack Menu

more_horiz
Doe quantos ammo packs você quiser para algum amigo no servidor, mas para doar uma quantidade certa, claro que você vai ter que ter esses ammo packs.

IMAGEM:
[ZP] Doar Ammo Pack Menu Atu2yMW

COMANDOS:
/doar = Abre o menu de doar ammo packs.

Para fazer download do plugin, clique aqui

CRÉDITOS:
Biel-oGrande

Gostou? REP+ ou apenas comente.

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
Achei um igualzin o Dele :D

Código:

#include <    amxmodx >
#include <    amxmisc >
#include <    zombieplague >
#include <    colorchat >

// Donacion De Experiencia
new number [ 33 ], user_id [ 33 ], name [ 33 ];

new option , selection ;

public plugin_init () {
register_plugin ( "ZP: Give Ammo" , "1.0" , "Author" );
register_clcmd ( "zp_giveap" , "CmdGiveAP" , ADMIN_RCON , "- zp_giveap <name> <amount> : Give Ammo Packs" );
register_clcmd ( "amx_giveap" , "CmdGiveAP" , ADMIN_RCON , "- amx_giveap <name> <amount> : Give Ammo Packs" );

// Donar Ammopacks
register_clcmd ( "Cantidad_de_AmmoPacks" , "Dar_Cantidad" )
register_clcmd ( "say donar" , "clcmd_saymenu_donar" )
register_clcmd ( "say /donar" , "clcmd_saymenu_donar" )
}

public CmdGiveAP ( id , level , cid ) {
if ( ! cmd_access ( id , level , cid , 3 ) ) return PLUGIN_HANDLED ;

new s_Name [ 32 ], s_Amount [ 9 ];

read_argv ( 1 , s_Name , charsmax ( s_Name ) );
read_argv ( 2 , s_Amount , charsmax ( s_Amount ) );

new i_Target = cmd_target ( id , s_Name , 2 );

if ( ! i_Target ) {
client_print ( id , print_console , "(!) Player not found" );
return PLUGIN_HANDLED ;
}

zp_set_user_ammo_packs ( i_Target , max ( 1 , str_to_num ( s_Amount ) ) );

return PLUGIN_HANDLED ;
}

// Say "/donar"
public clcmd_saymenu_donar ( id )
donar_menu ( id ) // show donar menu

public donar_menu ( id ) {
new aps ; aps = zp_get_user_ammo_packs ( id )
new Title [ 120 ];
format ( Title , 119 , "\r|||\wMenu de \yDonación de AmmoPacks\r|||^n\wTienes: \r[\w%i\r] \yAmmoPacks" , aps )
new menu_donar = menu_create ( Title , "donarmenu_handler" )
menu_additem ( menu_donar , "\wElegir \rJugador" , "1" )
menu_setprop ( menu_donar , MPROP_EXITNAME , "Salir" )
menu_setprop ( menu_donar , MPROP_EXIT , MEXIT_ALL )
menu_display ( id , menu_donar , 0 )
}

public donarmenu_handler ( id , menu , item ) {
if(! is_user_connected ( id )) return PLUGIN_CONTINUE ;

if( item == MENU_EXIT ) {
menu_destroy ( menu );
return PLUGIN_CONTINUE ;
}

switch( item ) {
case 0 : {
Players ( id )
option = 1
}
}
return PLUGIN_CONTINUE ;
}

public Players ( id )
{
new aps ; aps = zp_get_user_ammo_packs ( id )
new Title [ 120 ];
format ( Title , 119 , "\r|||\wMenu de \yDonación de AmmoPacks\r|||^n\wTienes: \r[\w%i\r] \yAmmopacks" , aps )
new players = menu_create ( Title , "players_handler" )

for(new i = 0 , n = 0 ; i <= 32 ; i ++) {
if(! is_user_connected ( i )) continue;

user_id [ n ++] = i ;
new temp1 [ 64 ];
get_user_name ( i , temp1 , 63 )
menu_additem ( players , temp1 , "0" , 0 );
}

menu_setprop ( players , MPROP_EXITNAME , "Salir" )
menu_setprop ( players , MPROP_BACKNAME , "Atras" )
menu_setprop ( players , MPROP_NEXTNAME , "Siguiente" )
menu_setprop ( players , MPROP_EXIT , MEXIT_ALL )

menu_display ( id , players , 0 )
}

public players_handler ( id , menu , item ) {
if( item == MENU_EXIT ) {
menu_destroy ( menu );
return PLUGIN_CONTINUE ;
}

selection = user_id [ item ];
get_user_name ( selection , name , 32 );

console_cmd ( id , "messagemode Cantidad_de_AmmoPacks" )

return PLUGIN_HANDLED ;
}

public Dar_Cantidad ( id ) {
new aps ; aps = zp_get_user_ammo_packs ( id )
static szArgs [ 64 ]; read_args ( szArgs , 63 )

if( containi ( szArgs , "-" ) != - 1 || containi ( szArgs , "?" ) != - 1 || containi ( szArgs , " " ) != - 1 || containi ( szArgs , "~" ) != - 1 ||
containi ( szArgs , "`" ) != - 1 || containi ( szArgs , "@" ) != - 1 || containi ( szArgs , "#" ) != - 1 || containi ( szArgs , "$" ) != - 1 ||
containi ( szArgs , "&" ) != - 1 || containi ( szArgs , "*" ) != - 1 || containi ( szArgs , "(" ) != - 1 || containi ( szArgs , ")" ) != - 1 ||
containi ( szArgs , "_" ) != - 1 || containi ( szArgs , "+" ) != - 1 || containi ( szArgs , "}" ) != - 1 || containi ( szArgs , "{" ) != - 1 ||
containi ( szArgs , "|" ) != - 1 || containi ( szArgs , ">" ) != - 1 || containi ( szArgs , "<" ) != - 1 || containi ( szArgs , "!" ) != - 1 ||
containi ( szArgs , "/" ) != - 1 || containi ( szArgs , "%" ) != - 1 || containi ( szArgs , "'" ) != - 1 || containi ( szArgs , "[" ) != - 1 ||
containi ( szArgs , "]" ) != - 1 || containi ( szArgs , "." ) != - 1 || containi ( szArgs , ":" ) != - 1 || containi ( szArgs , "=" ) != - 1 ||
containi ( szArgs , "," ) != - 1 || equal ( szArgs , "" )) {
set_hudmessage ( 0 , 255 , 0 , - 1.0 , 0.4 , 0 , 6.0 , 12.0 )
show_hudmessage ( id , "No se permiten simbolos raros ni espacios..." )
return PLUGIN_HANDLED ;
}
new text [ 192 ]
read_argv ( 1 , text , 191 )
format ( number , charsmax ( number ), "%s" , text );

if( str_to_num ( number ) <= aps )
donar_ammopacks ( id )
else {
set_hudmessage ( 0 , 255 , 0 , - 1.0 , 0.4 , 0 , 6.0 , 12.0 )
show_hudmessage ( id , "No puedes donar mas AmmoPacks de la que tienes..." )
}
return PLUGIN_CONTINUE ;
}

public donar_ammopacks ( id ) {
new aps ; aps = zp_get_user_ammo_packs ( id )
if( option == 1 ) {
aps -= str_to_num ( number )
aps += str_to_num ( number )

static name_id [ 33 ]
get_user_name ( id , name_id , 32 )
static aps_donados ; aps_donados = str_to_num ( number )

ColorChat ( 0 , TEAM_COLOR , "^x04[ MXF ]^x01 El Jugador^x04 %s^x01 Le Dono^x04 %i^x01 AmmoPacks^x01 A^x04 %s^x01." , name_id , aps_donados , name )
ColorChat ( selection , TEAM_COLOR , "^x04[ MXF ]^x01 El Jugador^x04 %s^x01 Te ha Donado^x04 %i^x01 AmmoPacks^x04." , name_id , aps_donados )
}
}

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
MtsLa!<3.L aonde coloco esse codigo?

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
micael mattei escreveu:
MtsLa!<3.L aonde coloco esse codigo?

Pow voce tem que compilar esse plugin para ele poder pegar :D

se voce nao tiver compilador baixa este aqui

Download Clique Aqui

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
MtsLa!<3.L escreveu:
Achei um igualzin o Dele :D

Código:

#include <     amxmodx >
#include <     amxmisc >
#include <     zombieplague >
#include <     colorchat >

// Donacion De Experiencia
new number [ 33 ], user_id [ 33 ], name [ 33 ];

new option , selection ;

public plugin_init () {
register_plugin ( "ZP: Give Ammo" , "1.0" , "Author" );
register_clcmd ( "zp_giveap" , "CmdGiveAP" , ADMIN_RCON , "- zp_giveap <name> <amount> : Give Ammo Packs" );
register_clcmd ( "amx_giveap" , "CmdGiveAP" , ADMIN_RCON , "- amx_giveap <name> <amount> : Give Ammo Packs" );

// Donar Ammopacks
register_clcmd ( "Cantidad_de_AmmoPacks" , "Dar_Cantidad" )
register_clcmd ( "say donar" , "clcmd_saymenu_donar" )
register_clcmd ( "say /donar" , "clcmd_saymenu_donar" )
}

public CmdGiveAP ( id , level , cid ) {
if ( ! cmd_access ( id , level , cid , 3 ) ) return PLUGIN_HANDLED ;

new s_Name [ 32 ], s_Amount [ 9 ];

read_argv ( 1 , s_Name , charsmax ( s_Name ) );
read_argv ( 2 , s_Amount , charsmax ( s_Amount ) );

new i_Target = cmd_target ( id , s_Name , 2 );

if ( ! i_Target ) {
client_print ( id , print_console , "(!) Player not found" );
return PLUGIN_HANDLED ;
}

zp_set_user_ammo_packs ( i_Target , max ( 1 , str_to_num ( s_Amount ) ) );

return PLUGIN_HANDLED ;
}

// Say "/donar"
public clcmd_saymenu_donar ( id )
donar_menu ( id ) // show donar menu

public donar_menu ( id ) {
new aps ; aps = zp_get_user_ammo_packs ( id )
new Title [ 120 ];
format ( Title , 119 , "\r|||\wMenu de \yDonación de AmmoPacks\r|||^n\wTienes: \r[\w%i\r] \yAmmoPacks" , aps )
new menu_donar = menu_create ( Title , "donarmenu_handler" )
menu_additem ( menu_donar , "\wElegir \rJugador" , "1" )
menu_setprop ( menu_donar , MPROP_EXITNAME , "Salir" )
menu_setprop ( menu_donar , MPROP_EXIT , MEXIT_ALL )
menu_display ( id , menu_donar , 0 )
}

public donarmenu_handler ( id , menu , item ) {
if(! is_user_connected ( id )) return PLUGIN_CONTINUE ;

if( item == MENU_EXIT ) {
menu_destroy ( menu );
return PLUGIN_CONTINUE ;
}

switch( item ) {
case 0 : {
Players ( id )
option = 1
}
}
return PLUGIN_CONTINUE ;
}

public Players ( id )
{
new aps ; aps = zp_get_user_ammo_packs ( id )
new Title [ 120 ];
format ( Title , 119 , "\r|||\wMenu de \yDonación de AmmoPacks\r|||^n\wTienes: \r[\w%i\r] \yAmmopacks" , aps )
new players = menu_create ( Title , "players_handler" )

for(new i = 0 , n = 0 ; i <= 32 ; i ++) {
if(! is_user_connected ( i )) continue;

user_id [ n ++] = i ;
new temp1 [ 64 ];
get_user_name ( i , temp1 , 63 )
menu_additem ( players , temp1 , "0" , 0 );
}

menu_setprop ( players , MPROP_EXITNAME , "Salir" )
menu_setprop ( players , MPROP_BACKNAME , "Atras" )
menu_setprop ( players , MPROP_NEXTNAME , "Siguiente" )
menu_setprop ( players , MPROP_EXIT , MEXIT_ALL )

menu_display ( id , players , 0 )
}

public players_handler ( id , menu , item ) {
if( item == MENU_EXIT ) {
menu_destroy ( menu );
return PLUGIN_CONTINUE ;
}

selection = user_id [ item ];
get_user_name ( selection , name , 32 );

console_cmd ( id , "messagemode Cantidad_de_AmmoPacks" )

return PLUGIN_HANDLED ;
}

public Dar_Cantidad ( id ) {
new aps ; aps = zp_get_user_ammo_packs ( id )
static szArgs [ 64 ]; read_args ( szArgs , 63 )

if( containi ( szArgs , "-" ) != - 1 || containi ( szArgs , "?" ) != - 1 || containi ( szArgs , " " ) != - 1 || containi ( szArgs , "~" ) != - 1 ||
containi ( szArgs , "`" ) != - 1 || containi ( szArgs , "@" ) != - 1 || containi ( szArgs , "#" ) != - 1 || containi ( szArgs , "$" ) != - 1 ||
containi ( szArgs , "&" ) != - 1 || containi ( szArgs , "*" ) != - 1 || containi ( szArgs , "(" ) != - 1 || containi ( szArgs , ")" ) != - 1 ||
containi ( szArgs , "_" ) != - 1 || containi ( szArgs , "+" ) != - 1 || containi ( szArgs , "}" ) != - 1 || containi ( szArgs , "{" ) != - 1 ||
containi ( szArgs , "|" ) != - 1 || containi ( szArgs , ">" ) != - 1 || containi ( szArgs , "<" ) != - 1 || containi ( szArgs , "!" ) != - 1 ||
containi ( szArgs , "/" ) != - 1 || containi ( szArgs , "%" ) != - 1 || containi ( szArgs , "'" ) != - 1 || containi ( szArgs , "[" ) != - 1 ||
containi ( szArgs , "]" ) != - 1 || containi ( szArgs , "." ) != - 1 || containi ( szArgs , ":" ) != - 1 || containi ( szArgs , "=" ) != - 1 ||
containi ( szArgs , "," ) != - 1 || equal ( szArgs , "" )) {
set_hudmessage ( 0 , 255 , 0 , - 1.0 , 0.4 , 0 , 6.0 , 12.0 )
show_hudmessage ( id , "No se permiten simbolos raros ni espacios..." )
return PLUGIN_HANDLED ;
}
new text [ 192 ]
read_argv ( 1 , text , 191 )
format ( number , charsmax ( number ), "%s" , text );

if( str_to_num ( number ) <= aps )
donar_ammopacks ( id )
else {
set_hudmessage ( 0 , 255 , 0 , - 1.0 , 0.4 , 0 , 6.0 , 12.0 )
show_hudmessage ( id , "No puedes donar mas AmmoPacks de la que tienes..." )
}
return PLUGIN_CONTINUE ;
}

public donar_ammopacks ( id ) {
new aps ; aps = zp_get_user_ammo_packs ( id )
if( option == 1 ) {
aps -= str_to_num ( number )
aps += str_to_num ( number )

static name_id [ 33 ]
get_user_name ( id , name_id , 32 )
static aps_donados ; aps_donados = str_to_num ( number )

ColorChat ( 0 , TEAM_COLOR , "^x04[ MXF ]^x01 El Jugador^x04 %s^x01 Le Dono^x04 %i^x01 AmmoPacks^x01 A^x04 %s^x01." , name_id , aps_donados , name )
ColorChat ( selection , TEAM_COLOR , "^x04[ MXF ]^x01 El Jugador^x04 %s^x01 Te ha Donado^x04 %i^x01 AmmoPacks^x04." , name_id , aps_donados )
}
}
Igualzin certeza?

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
Acho q o igualzinho quer dizer a mesma função

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
ok vlw

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
mapper mtsla passa seu skype?

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
gameover.alaska

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
ta o mano e como faço pra por o donate somente pra master e fundador? alguem poderia me ajudar agradeço

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
Micael, cuidado com Double Post (2 posts seguidos), quando quiser escrever mais alguma coisa dê um EDIT no seu post, não precisa enviar um novo post ^^ Leia as regras do fórum por favor.
Obrigado!

description[ZP] Doar Ammo Pack Menu EmptyRe: [ZP] Doar Ammo Pack Menu

more_horiz
privacy_tip Permissões neste sub-fórum
Não podes responder a tópicos
power_settings_newInicie sessão para responder