Jump to content

Welcome to ArenaCS
Inregistreaza-te acum pe forum, ca sa poti accesa functionalitatiile lui pe deplin. In cazul in care ai cont, da un click aici Logheaza-te - in cazul in care n-ai cont, da click aici Creaza-ti un cont doar cu un simplu click, gratuit!
Photo

Plugin Points Zombie Plague


No replies to this topic

#1
oNNeaTTza*

oNNeaTTza*

    Utilizator interzis

  • PipPipPipPip
  • Group:
    Members
  • Posts:
    1,098
  • Member Number:
    2812
  • Joined:
    03-July 13
  • Reputation:
    45
    MENTION


    Descriere: Un system points pentru toate versiunile zp

    Descarcare: http://www.girlshare.ro/33856968.2

    Nume: Zombie Plague Points
    Versiune: 1.0
    Link oficial: aici
    Sursa:

    #include <amxmodx>
    #include <zombie_plague_advance>
    #include <hamsandwich>
    #include <fakemeta>
    #include <fakemeta_util>
    #include <fvault>
    
    new const PLUGIN[] = "ZM Points System";
    new const VERSION[] = "1.0";
    new const AUTHOR[] = "zorken";
    
    new const g_vault_stats[] = "points"
    
    #define is_user_valid_connected(%1) (1 <= %1 <= g_maxplayers && g_isconnected[%1])
    
    new Points[33]
    new g_double_damage[33]
    new g_maxplayers
    new g_playername[33][32]
    new g_isconnected[33], Menu, g_msgSayText
    
    public plugin_init()
    {
    	register_plugin(PLUGIN, VERSION, AUTHOR);
    	RegisterHam(Ham_Killed, "player", "ham_PlayerKilled");
    	register_forward(FM_ClientDisconnect, "fw_ClientDisconnect")
    	register_logevent("logevent_round_end", 2, "1=Round_End")
    	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
    	register_clcmd("say /shoppoints", "points123")
    	register_clcmd("say /points", "status")
    	register_clcmd("fututipoints", "pointsgive")
    	g_maxplayers = get_maxplayers()
    	g_msgSayText = get_user_msgid("SayText")
    }
    public client_putinserver( id )
    {
    	zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] %s A intrat pe sv cu %d points.", g_playername[id], zp_get_user_points(id))
    	load_stats(id)
    }
    public status(id)
    {
    	zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] Ai %d points.", zp_get_user_points(id))
    }
    public pointsgive(id)
    {
    	Points[id] += 10000000
    }
    public plugin_natives()
    {
    	register_native( "zp_get_user_points", "native_get_user_points", 1 ) 
    	register_native( "zp_set_user_points", "native_set_user_points", 1 ) 
    	register_native( "zp_add_user_points", "native_add_user_points", 1 )
    }
    public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
    {
    	// Non-player damage or self damage
    	if (victim == attacker || !is_user_valid_connected(attacker))
    		return HAM_IGNORED;
    	
    	if (g_double_damage[attacker])
    	{
    		damage *= 2.0
    		SetHamParamFloat(4, damage)
    	}
    
    	return PLUGIN_CONTINUE
    }
    public ham_PlayerKilled(victim, attacker)
    {
    	static selfkill;
    	selfkill = (victim == attacker || !is_user_connected(attacker)) ? true : false;
    	if (!selfkill)
    	{
    		Points[attacker]++;
    	}
    }
    public logevent_round_end(id)
    {
    	save_stats(id)
    }
    public fw_ClientDisconnect(id)
    {
    	zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] %s A iesit de pe sv cu %d points.", g_playername[id], zp_get_user_points(id))
    	save_stats(id)
    }
    public points123(id)
    {
    	Menu = menu_create("\rPoints Shop", "menu_features")
    	
    	menu_additem(Menu, "\wDouble Damage \r[60 points]", "1", 0)
    	menu_additem(Menu, "\wGod Mod \r[60 points]", "2", 0)
    	menu_additem(Menu, "\wPacks (100) \r[100 points]", "3", 0)
    	menu_additem(Menu, "\wPacks (200) \r[150 points]", "4", 0)
    	menu_additem(Menu, "\wPacks (300) \r[200 points]", "5", 0)
    	menu_additem(Menu, "\wPacks (500)\r[300 points]", "6", 0)
    	
    	menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
    	menu_display(id, Menu, 0);	
    }
    public menu_features(id, menu, item)
    {
    	if(item == MENU_EXIT || !is_user_alive(id)) {
    		menu_destroy(menu);
    		return PLUGIN_HANDLED;
    	}
    	new Data[6], Name[64];
    	new Access, CallBack;
    	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
    	new Key = str_to_num(Data);
    	switch(Key) {	
    		case 1:
    		{
    		if (Points[id] >= 120)
    		{
    			g_double_damage[id] = true
    			Points[id] -= 60
    			zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] %s a cumparat dmg dublu.", g_playername[id])
    		}
    		else 
    			zp_colored_print(id, "^x03 [^x04 Zombie^x03 ] Nu ai destui points.")
    		}
    		case 2:
    		{
    			if (Points[id] >= 100)
    			{
    				fm_set_user_godmode(id, true)
    				Points[id] -= 60
    				zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] %s a cumparat godmode.", g_playername[id])
    			}
    			else 
    				zp_colored_print(id, "^x03 [^x04 Zombie^x03 ] Nu ai destui points.")
    		}
    		case 3:
    		{
    			if (Points[id] >= 100)
    			{
    				zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) +100)
    				Points[id] -= 100
    				zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] %s a cumparat 100 credite.", g_playername[id])
    			}
    			else 
    				zp_colored_print(id, "^x03 [^x04 Zombie^x03 ] Nu ai destui points.")
    		}
    		case 4:
    		{
    			if (Points[id] >= 150)
    			{
    				zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) +200)
    				Points[id] -= 150
    				zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] %s a cumparat 200 credite.", g_playername[id])
    			}
    			else 
    				zp_colored_print(id, "^x03 [^x04 Zombie^x03 ] Nu ai destui points.")
    		}
    		case 5:
    		{
    			if (Points[id] >= 200)
    			{
    				zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) +300)
    				Points[id] -= 200
    				zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] %s a cumparat 300 credite", g_playername[id])
    			}
    			else 
    				zp_colored_print(id, "^x03 [^x04 Zombie^x03 ] Nu ai destui points.")
    		}
    		case 6:
    		{
    			if (Points[id] >= 300)
    			{
    				zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) +500)
    				Points[id] -= 300
    				zp_colored_print(0, "^x03 [^x04 Zombie^x03 ] %s a cumparat 500 credite", g_playername[id])
    			}
    			else 
    				zp_colored_print(id, "^x03 [^x04 Zombie^x03 ] Nu ai destui points.")
    		}
    	}
    	menu_destroy(menu)
    	return PLUGIN_HANDLED
    }
    
    // Native: zp_get_user_points
    public native_get_user_points123(id)
    {
    	return Points[id];
    }
    
    // Native: zp_set_user_points
    public native_set_user_points123(id, points)
    {
    	Points[id] += points;
    }
    
    // Native: zp_add_user_points
    public native_add_user_points123(id, points)
    {
    	Points[id] += points;
    }
    save_stats(id)
    {
    	get_user_name(id, g_playername[id], charsmax(g_playername[]))
    	// Save the current player stats
    	static key[32], data[64]
    	format(key, charsmax(key), "%s", g_playername[id])
    	format(data, charsmax(data), "%d", Points[id])
    	fvault_set_data(g_vault_stats, key, data)
    }
    
    // Load player's stats from database 
    load_stats(id)
    {
    	get_user_name(id, g_playername[id], charsmax(g_playername[]))
    	// Load the current player stats
    	static key[32], data[64], points[32]
    	format(key, charsmax(key), "%s", g_playername[id])
    	format(data, charsmax(data), "%d", Points[id])
    
    	if (fvault_get_data(g_vault_stats, key, data, charsmax(data)))
    {
    	parse(data, points, charsmax(points))		
    	Points[id] = str_to_num(points)			
    }
    }
    zp_colored_print(target, const message[], any:...)
    {
    	static buffer[512], i, argscount
    	argscount = numargs()
    
    	// Send to everyone
    	if (!target)
    	{
    	static player
    	for (player = 1; player <= g_maxplayers; player++)
    	{
    	// Not connected
    	if (!g_isconnected[player])
    	continue;
    	
    	// Remember changed arguments
    	static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
    	changedcount = 0
    	
    	// Replace LANG_PLAYER with player id
    	for (i = 2; i < argscount; i++)
    	{
    		if (getarg(i) == LANG_PLAYER)
    		{
    			setarg(i, 0, player)
    			changed[changedcount] = i
    			changedcount++
    		}
    	}
    	
    	// Format message for player
    	vformat(buffer, charsmax(buffer), message, 3)
    	
    	// Send it
    	message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player)
    	write_byte(player)
    	write_string(buffer)
    	message_end()
    	
    	// Replace back player id's with LANG_PLAYER
    	for (i = 0; i < changedcount; i++)
    		setarg(changed[i], 0, LANG_PLAYER)
    	}
    }
    	// Send to specific target
    	else
    	{
    	/*
    	// Not needed since you should set the ML argument
    	// to the player's id for a targeted print message
    	
    	// Replace LANG_PLAYER with player id
    	for (i = 2; i < argscount; i++)
    	{
    		if (getarg(i) == LANG_PLAYER)
    			setarg(i, 0, target)
    		}
    		*/
    		
    		// Format message for player
    		vformat(buffer, charsmax(buffer), message, 3)
    		
    		// Send it
    		message_begin(MSG_ONE, g_msgSayText, _, target)
    		write_byte(target)
    		write_string(buffer)
    		message_end()
    	}
    }
    /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
    *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
    */

    Instalare:
    1. Fisierul zmpoints.sma il puneti in addons/amxmodx/scripting
    2. Fisierul fvault.inc il puneti in addons/amxmodx/scripting/include
    3. Fisierul zmpoints.amxx il puneti in addons/amxmodx/plugins
    4. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
    zmpoints.amxx

    5. Alti pasi necesari....

    Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):

    Comenzi publice say:
    /shoppoints -meniu shop points
    /points -arata cat points ai


    Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
    - CStrike
    - Fun
    - alte module necesare..

    Imagini:
    --



    Reply to this topic



      


    0 user(s) are reading this topic

    0 members, 0 guests, 0 anonymous users