Ajutor! plugin /donate packs

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
bloodrainzmo
Membru, skill 0
Membru, skill 0
Posts: 8
Joined: 23 Sep 2018, 13:15
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: 89.34.25.182:27015
Fond eXtream: 0
Contact:

23 Sep 2018, 13:31

Salut , am un plugin de donate packs , este bun ... dar cand sunt mai multi jucatori in loc de numele jucatorilor apare numele serverului..ma poate ajuta cineva va rog ?
| Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < zombie_plague_special >

#define NAME    "[ZP] Donate Ammo Packs"
#define VERSION    "0.1"
#define AUTHOR   "Shurik"

new gPlayersmenu, 
    gPlayers[ 32 ], 
    i,
    gAccessmenu, 
    gName[ 64 ], 
    gCallback ; 

public plugin_init( )
{    
	register_plugin( NAME, VERSION, AUTHOR ) 
	
	register_clcmd( "say /donate" , "DonateMenu" , ADMIN_ALL, "" )  
	
	register_clcmd( "Amount" , "DonateAmmo" , ADMIN_ALL, "" )
	
	register_dictionary("zp_donate.txt") 
}

 
public DonateMenu( pPlayer )
{ 
	if(!is_user_connected(pPlayer) || zp_get_user_ammo_packs(pPlayer) < 1)
		return PLUGIN_HANDLED
	
	static tempname[32], info[10]  , menu_title[64]
	
	formatex(menu_title, charsmax(menu_title), "\y%L", LANG_PLAYER, "CHANGE_PLAYERS");
	
	gPlayersmenu = menu_create(menu_title, "Menu_handler")  
	
	for(i = 0; i < 32; i++) 
	{	
		if(!is_user_connected(i) || i == pPlayer)
			continue
		
		get_user_name(gPlayers, tempname, 31)       
		num_to_str(gPlayers, info, 9)       
		menu_additem(gPlayersmenu, tempname, info, 0)    
	}  
	
	menu_setprop(gPlayersmenu, MPROP_EXIT, MEXIT_ALL)  
	
	menu_display(pPlayer, gPlayersmenu, 0)   
	return PLUGIN_HANDLED
}

public Menu_handler (pPlayer, gPlayersmenu, pItem)
{ 
	if(pItem == MENU_EXIT)   
	{       
		menu_destroy(gPlayersmenu)       
		return PLUGIN_HANDLED   
	}    
	
	static data[6]  
	
	menu_item_getinfo(gPlayersmenu, pItem, gAccessmenu, data, charsmax(data), gName, charsmax(gName), gCallback) 
	
	static g_player ; g_player = str_to_num(data)  
	
	client_cmd(pPlayer, "messagemode ^"Amount %i^"", g_player)  
	
	return PLUGIN_CONTINUE
}

public DonateAmmo(pPlayer)
{    
	if(!is_user_connected(pPlayer))
		return PLUGIN_HANDLED
	
	static g_param[6]    
	read_argv(2, g_param, charsmax(g_param))
	
	for (new p; p < strlen(g_param); p++)    
	{       
		if(!isdigit(g_param[p]))       
		{                    
			client_printcolor( pPlayer, "^x04[ZMO]^x01 %L" , LANG_PLAYER , "NOT_FOUND_PARAM" )  
			return 0        
		}    
	}    
	
	static g_Amount ; g_Amount = str_to_num(g_param)   
	
	static g_Ammo ; g_Ammo = zp_get_user_ammo_packs(pPlayer) 
	
	if (g_Ammo < g_Amount)    
	{                  
		client_printcolor( pPlayer, "^x04[ZMO]^x01 %L" , LANG_PLAYER , "NOT_AMMO" ) 
		return 0    
	} 
	
	read_argv(1, g_param, charsmax(g_param))   
	static g_Player ; g_Player = str_to_num(g_param) 
	
	static pAmmo; pAmmo = zp_get_user_ammo_packs(g_Player)
	
	zp_set_user_ammo_packs(pPlayer, g_Ammo - g_Amount)    
	zp_set_user_ammo_packs(g_Player, pAmmo + g_Amount)    
	
	static names[2][32]        
	
	get_user_name(pPlayer, names[0], 31)    
	get_user_name(g_Player, names[1], 31)        
	
	
	client_printcolor( pPlayer, "^x04[ZMO]^x01 %L" , LANG_PLAYER , "DONATE" , names[0] , g_Amount , names [1] )   
	return 0
}

stock client_printcolor(const pPlayer, const input[], any:...) 
{
	static szMsg[191]
	vformat(szMsg, charsmax(szMsg), input, 3)
	
	if(pPlayer)
	{
		message_begin(MSG_ONE_UNRELIABLE, 76, _, pPlayer) 
		write_byte(pPlayer) 
		write_string(szMsg) 
		message_end()
	}
	else
	{
		static player
		for (player = 1; player <= 32; player++)
		{
			if (!is_user_connected(player))
				continue;
			
			message_begin(MSG_ONE_UNRELIABLE, 76, _, player) 
			write_byte(player) 
			write_string(szMsg) 
			message_end()
		}
	}
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/



Asa apare cand suntem mai multi :
Image
Last edited by j a h k 0- on 24 Sep 2018, 15:47, edited 1 time in total.
Reason: Edit: Am adaugat [Sursa=]
RoyalServer
bloodrainzmo
Membru, skill 0
Membru, skill 0
Posts: 8
Joined: 23 Sep 2018, 13:15
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: 89.34.25.182:27015
Fond eXtream: 0
Contact:

24 Sep 2018, 10:45

Up !
User avatar
PorcusorulMagic
Membru, skill +1
Membru, skill +1
Posts: 289
Joined: 12 Sep 2017, 17:41
Detinator Steam: Da
CS Status: Groh
Detinator server CS: ARENA.USP.RO
SteamID: STEAM_0:0:102123053
Fond eXtream: 0
Location: Piatra Neamt
Has thanked: 4 times
Contact:

24 Sep 2018, 13:54

Tu nu vezi ca scrie clar mare COUNTER STRIKE GLOBAL OFFENSIVE? Mai dai si up... un moderator sa mute topicul asta in sectiunea potrivita
User avatar
j a h k 0-
Membru, skill +4
Membru, skill +4
Posts: 1536
Joined: 26 Jan 2016, 10:24
Detinator Steam: Da
CS Status: segmentation fault
SteamID: /ID/jkhalibu
Reputatie: Utilizator neserios
Restrictie moderator [permanent]
Membru Club eXtreamCS (3 luni)
Nume anterior: Jah#
Fond eXtream: 0
Location: Chişinău, Republic Of Moldova
Has thanked: 69 times
Been thanked: 13 times
Contact:

24 Sep 2018, 15:46

Incearca acesta
zp_donate_ap.sma
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>

#define PLUGIN "[ZP] Donate Ammo Packs"
#define VERSION "1.0"
#define AUTHOR "r1laX , PomanoB"

new g_UserTotalAmmo[33]
new g_CvarAllowDonate
new SayText


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    g_CvarAllowDonate = register_cvar("zp_stats_allow_donate", "1")
    
    register_clcmd("say", "handleSay")
    register_clcmd("say_team", "handleSay")
    
    set_task(363.4, "FUNC_PRINT_CHAT", _, _, _, "b", 0)

    SayText = get_user_msgid("SayText")
}

public FUNC_PRINT_CHAT()
        client_printcolor(0, "!g[ZP] !yType !t/donate !g<name> <packs> !yto donate ammo packs!")      

public handleSay(id)
{
    new args[64]
    
    read_args(args, charsmax(args))
    remove_quotes(args)
    
    new arg1[16]
    new arg2[32]
    
    strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
    if (get_pcvar_num(g_CvarAllowDonate) && equal(arg1,"/donate", 7))
        donate(id, arg2)
		
    strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
    if (get_pcvar_num(g_CvarAllowDonate) && equal(arg1,"donate", 7))
        donate(id, arg2)
    
}

public donate(id, arg[])
{
    new to[32], count[10]
    strbreak(arg, to, 31, count, 9)
    
    if (!to[0] || !count[0])
    {
        client_printcolor(id, "!g[ZP] !yType !t/donate !g<name> <packs> !yto donate ammo packs!")
        return
    }
    new ammo_sender = zp_get_user_ammo_packs(id)
    new ammo
    if (equal(count, "all"))
        ammo = ammo_sender
    else
        ammo = str_to_num(count)
    if (ammo <= 0)
    {
        client_printcolor(id, "!g[ZP] !yWrong ammo quantity!")
        return
    }
    ammo_sender -= ammo
    if (ammo_sender < 0)
    {
        ammo+=ammo_sender
        ammo_sender = 0
        
    }
    new reciever = cmd_target(id, to, (CMDTARGET_ALLOW_SELF))
    if (!reciever || reciever == id)
    {
        client_printcolor(id, "!g[ZP] !yPlayer !g%s !yhas not been found on the server!", to)
        return
    }
    
    zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + ammo)
    g_UserTotalAmmo[reciever] += ammo
    zp_set_user_ammo_packs(id, ammo_sender)
    new aName[32], vName[32]
    
    get_user_name(id, aName, 31)
    get_user_name(reciever, vName, 31)
    
    client_printcolor(0, "!g[ZP] !t%s !ygave !g%d Packs !yto !t%s", aName, ammo, vName)
    
}

stock client_printcolor(const id, const input[], any:...)
{
    new count = 1, players[32]
    static msg[191]
    vformat(msg, 190, input, 3)
    
    replace_all(msg, 190, "!g", "^4") // Green Color
    replace_all(msg, 190, "!y", "^1") // Default Color
    replace_all(msg, 190, "!t", "^3") // Team Color
    
    if (id) players[0] = id; else get_players(players, count, "ch") 
    {
        for ( new i = 0; i < count; i++ )
        {
            if ( is_user_connected(players) )
            {
                message_begin(MSG_ONE_UNRELIABLE, SayText, _, players)
                write_byte(players);
                write_string(msg);
                message_end();
            }
        }
    }
}


Mutat in categoria , Board index » eXtream - Counter-Strike 1.6 » Discutii generale » Pluginuri » Cereri
Tranzactii efectuate cu succes.
| Afiseaza codul
anunturi/vand-cont-rockstar-gta-15euro- ... 49363.html
anunturi/vand-cont-rockstar-gta-euro-paypal-t349373.html
anunturi/cumpar-tema-ipb-t349335.html
anunturi/recomandare-utilizatori-pentru-tranzactii-t323814-60.html
anunturi/recomandare-utilizatori-pentru-tranzactii-t323814-72.html
post2692853.html#p2692853
anunturi/addons-furien-classic-cyby-t348802.html
Image
| Afiseaza codul
Image
Image
bloodrainzmo
Membru, skill 0
Membru, skill 0
Posts: 8
Joined: 23 Sep 2018, 13:15
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: 89.34.25.182:27015
Fond eXtream: 0
Contact:

24 Sep 2018, 17:01

Pluginul de mai sus este super bun dar se poate adauga si acel meniu va rog ? ;D
User avatar
j a h k 0-
Membru, skill +4
Membru, skill +4
Posts: 1536
Joined: 26 Jan 2016, 10:24
Detinator Steam: Da
CS Status: segmentation fault
SteamID: /ID/jkhalibu
Reputatie: Utilizator neserios
Restrictie moderator [permanent]
Membru Club eXtreamCS (3 luni)
Nume anterior: Jah#
Fond eXtream: 0
Location: Chişinău, Republic Of Moldova
Has thanked: 69 times
Been thanked: 13 times
Contact:

24 Sep 2018, 18:06

bloodrainzmo wrote:Pluginul de mai sus este super bun dar se poate adauga si acel meniu va rog ? ;D
Nu iti recomand cu menu :), mai simplu si mai frumos e din chat, acum toti folosesc pluginul acesta, nu are erori sau bugu-ri.
Tranzactii efectuate cu succes.
| Afiseaza codul
anunturi/vand-cont-rockstar-gta-15euro- ... 49363.html
anunturi/vand-cont-rockstar-gta-euro-paypal-t349373.html
anunturi/cumpar-tema-ipb-t349335.html
anunturi/recomandare-utilizatori-pentru-tranzactii-t323814-60.html
anunturi/recomandare-utilizatori-pentru-tranzactii-t323814-72.html
post2692853.html#p2692853
anunturi/addons-furien-classic-cyby-t348802.html
Image
| Afiseaza codul
Image
Image
Post Reply

Return to “Cereri”

  • Information