Raised This Month: $32 Target: $400
 8% 

zp donate mas de 10 ammos


  
 
 
Thread Tools Display Modes
Author Message
fcastro16
Member
Join Date: Mar 2009
Old 04-15-2013 , 21:01   zp donate mas de 10 ammos
#1

Como se le hace para que los jugadores tengas que donar minimo de 10 ammos?

Gracias.

edit. Creo que tambien se cae el server con este plugin, pero no estoy seguro.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <zombieplague>

#define    PLUGIN    "ammo donate"
#define    VERSION    "1.5"
#define    AUTHOR    "none"

new players_menuplayers[32], numi
new accessmenuiName[64], callback
new g_msgSayText
public plugin_init()
{    
register_plugin(PLUGINVERSIONAUTHOR
register_clcmd("say /donate""transfer_menu"ADMIN_ALL"")    //  Para abrir el menu

register_clcmd("transfer""transfer_ammo"ADMIN_ALL"")

g_msgSayText get_user_msgid("SayText")
}
public 
transfer_menu(id)
{   
get_players(playersnum"h")       
if (
num <= 1)  
{     
    
client_printcolor(id"/g[ZP Donar] /yNo hay jugadores")    
return 
PLUGIN_HANDLED    
}   
    
new 
tempname[32], info[10]  
  
players_menu menu_create("Jugadores""players_menu_handler")  
 
for(
0numi++) 
{       
if(
players[i] == id)           
continue  
             
get_user_name(players[i], tempname31)       
num_to_str(players[i], info9)       
menu_additem(players_menutempnameinfo0)    
}       
menu_setprop(players_menuMPROP_EXITMEXIT_ALL)  

menu_display(idplayers_menu0)   
return 
PLUGIN_CONTINUE
}

public 
players_menu_handler(idplayers_menuitem)

if(
item == MENU_EXIT)   
{       
menu_destroy(players_menu)       
return 
PLUGIN_HANDLED   
}    
   
new 
data[6]  
 
menu_item_getinfo(players_menuitemaccessmenudatacharsmax(data), iNamecharsmax(iName), callback

new 
player str_to_num(data)  
      
client_cmd(id"messagemode ^"transfer %i^""player)  

return 
PLUGIN_CONTINUE
}

public 
transfer_ammo(id)
{    
new 
param[6]    
read_argv(2paramcharsmax(param))

for (new 
xstrlen(param); x++)    
{       
if(!
isdigit(param[x]))       
 {            
client_printcolor(id"/g[ZP Donar] /yTiene que ser un numero")  
return 
0        
}    
}    
   
new 
amount str_to_num(param)   
    
new 
ammo zp_get_user_ammo_packs(id

if (
ammo amount)    
{             
client_printcolor(id"/g[ZP Donar] /yNo tienes ammos suficientes")        
return 
0    



      
read_argv(1paramcharsmax(param))   
new 
player str_to_num(param
      
new 
player_ammo zp_get_user_ammo_packs(player)

zp_set_user_ammo_packs(idammo amount)    
zp_set_user_ammo_packs(playerplayer_ammo amount)    
   
new 
names[2][32]        

get_user_name(idnames[0], 31)    
get_user_name(playernames[1], 31)        


set_hudmessage(2551010, -1.00.316.06.0)
show_hudmessage(id"%s le dio %i ammos packs a %s"names[0], amountnames[1])
      
return 
0
}

stock client_printcolor(id, const input[], any:...)
{
    new 
iCount 1iPlayers[32]
    
    static 
szMsg[191]
    
vformat(szMsgcharsmax(szMsg), input3)
    
    
replace_all(szMsg190"/g""^4"// green txt
    
replace_all(szMsg190"/y""^1"// orange txt
    
replace_all(szMsg190"/ctr""^3"// team txt
    
replace_all(szMsg190"/w""^0"// team txt
    
    
if(idiPlayers[0] = id
    
else get_players(iPlayersiCount"ch")
        
    for (new 
0iCounti++)
    {
        if (
is_user_connected(iPlayers[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_iPlayers[i])
            
write_byte(iPlayers[i])
            
write_string(szMsg)
            
message_end()
        }
    }


Last edited by fcastro16; 04-15-2013 at 22:01.
fcastro16 is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-16-2013 , 10:08   Re: zp donate mas de 10 ammos
#2

PHP Code:
new amount str_to_num(param)   

if (
amount 10)
{             
client_printcolor(id"/g[ZP Donar] /yTienes que donar minimo 10 ap")        
return 
0    
}

new 
ammo zp_get_user_ammo_packs(id

if (
ammo amount)    
{             
client_printcolor(id"/g[ZP Donar] /yNo tienes ammos suficientes")        
return 
0    


Last edited by baneado; 04-16-2013 at 10:11.
baneado is offline
fcastro16
Member
Join Date: Mar 2009
Old 04-16-2013 , 16:35   Re: zp donate mas de 10 ammos
#3

muchas gracias, baneado.
fcastro16 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode