Skin Zombie Models [ZM]

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
Rainq
Moderator
Moderator
Posts: 2649
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 1 time
Been thanked: 17 times
Contact:

05 Aug 2019, 01:04

Descriere: Poti cumpara skinuri cu ammo.


Descarcare: LINK RESURSE!

Code: Select all

#pragma tabsize 0

#include <amxmodx>
#include <fvault>
#include <hamsandwich>
#include <zombieplague>

//modelele se pun in /models/player/nume_model/nume_model.mdl
new const Models[][] = {//numele la modele
	"Spiderman",
	"Halo",
	"Redor",

	"Batman",
	"Death"
}

new model1[33],model2[33],model3[33],model4[33], model5[33]


#define NUME_SKIN_1 "Spiderman"
#define PRET_SKIN_1 750

#define NUME_SKIN_2 "Halo"
#define PRET_SKIN_2 2050

#define NUME_SKIN_3 "Redor"
#define PRET_SKIN_3 630


#define NUME_SKIN_4 "Batman"
#define PRET_SKIN_4 450


#define NUME_SKIN_5 "Death"
#define PRET_SKIN_5 24500



new const g_vault_name[] = "SkinShop";
new authid[33],data[128];


public plugin_init() {
          register_plugin("skin_zombie", "1.0", "Rainq & Levin")
	//register_clcmd("say","SayFC")
	//register_clcmd("say_team","SayFC")
	
	register_clcmd("say /skin","SkinSHOP")
	register_clcmd("say_team /skin","SkinSHOP")

	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost") 
}

public plugin_precache()
{
	new szBuffer[ 128 ]
	for( new i; i < sizeof Models; i++ )
	{
		formatex( szBuffer, charsmax( szBuffer ), "models/player/%s/%s.mdl", Models[ i ], Models[ i ] )
		precache_model( szBuffer )
		
		// Support modelT.mdl files
		//V1
		replace(szBuffer, charsmax(szBuffer), ".mdl", "T.mdl")
		if(file_exists(szBuffer))	precache_model(szBuffer)
		
		//V2
		/*formatex(szBuffer, charsmax(szBuffer), "models/player/%s/%sT.mdl", Models[ i ], Models[ i ])
		if (file_exists(szBuffer)) precache_model(szBuffer)*/
	}
}

public client_putinserver(plr)	if( !is_user_hltv(plr) || !is_user_bot(plr) )	LoadExp(plr);

public fwHamPlayerSpawnPost(id)	set_task(1.0,"SM",id)

public SM(id)
{
	if(is_user_alive(id)&&!zp_get_user_zombie(id))
	{
		if(model1[id]==1&&model2[id]==1&&model3[id]==1&&
		model4[id]==1 && model5[id]==1)	zp_override_user_model( id, Models[ random_num( 0, charsmax( Models ) ) ] )
			
		/*else if(model1[id]==1&&model2[id]==1)	zp_override_user_model( id, Models[ random_num( 0, 1 ) ] )
		else if(model2[id]==1&&model3[id]==1)	zp_override_user_model( id, Models[ random_num( 1, 2 ) ] )
		else if(model1[id]==1&&model3[id]==1)	zp_override_user_model( id, Models[ 0 ],1 )*/
		else if(model1[id]==1)	zp_override_user_model( id, Models[ 0 ] )
		else if(model2[id]==1)	zp_override_user_model( id, Models[ 1 ] )
		else if(model3[id]==1)	zp_override_user_model( id, Models[ 2 ] )
			
		else if(model4[id]==1)	zp_override_user_model( id, Models[ 3 ] )
		else if(model5[id]==1)	zp_override_user_model( id, Models[ 4 ] )
	}
}

public client_disconnect(plr)
{
        SaveExp(plr);
        
        model1[plr] = 0;
        model2[plr] = 0;
        model3[plr] = 0;
		
	model4[plr] = 0;
	model5[plr] = 0;
}

public zp_user_humanized_post(id, survivor)	SM(id)

public SayFC(id)
{
	new args[ 192 ]
	read_args( args, charsmax( args ) )
	remove_quotes( args )
	
	if( contain( args, "skin" ) != -1 )	client_print( id, print_chat, "Vrei sa ai propriu skin? Scrie /skin si poti cumpara propriu skin cu ammo!" )
}

public SkinSHOP(id)
{
	if(get_user_team(id)!=ZP_TEAM_HUMAN||zp_get_user_zombie(id))
	{
		//client_print(id,print_chat,"Trebuie sa fii om pentru a avea acces la Skinuri.")
		return PLUGIN_HANDLED
	}

	new form[512]
	new gMenu = menu_create( "Glorius # Skin", "thisContent" );
	
	if(model1[id]!=1)	formatex(form,charsmax(form),"\r%s -\y %d\r ammo [NU DETII]",NUME_SKIN_1,PRET_SKIN_1)
	else	formatex(form,charsmax(form),"\r%s -\y [INVENTAR]",NUME_SKIN_1)
	menu_additem( gMenu, form, "1");
	
	if(model2[id]!=1)	formatex(form,charsmax(form),"\r%s -\y %d\r ammo [NU DETII]",NUME_SKIN_2,PRET_SKIN_2)
	else	formatex(form,charsmax(form),"\r%s -\y [INVENTAR]",NUME_SKIN_2)
	menu_additem( gMenu, form, "2");
	
	if(model3[id]!=1)	formatex(form,charsmax(form),"\r%s -\y %d\r ammo [NU DETII]",NUME_SKIN_3,PRET_SKIN_3)
	else	formatex(form,charsmax(form),"\r%s -\y [INVENTAR]",NUME_SKIN_3)
	menu_additem( gMenu, form, "3");
	
	
	if(model4[id]!=1)	formatex(form,charsmax(form),"\r%s -\y %d\r ammo [NU DETII]",NUME_SKIN_4,PRET_SKIN_4)
	else	formatex(form,charsmax(form),"\r%s -\y [INVENTAR]",NUME_SKIN_4)
	menu_additem( gMenu, form, "4");
	
	
	if(model5[id]!=1)	formatex(form,charsmax(form),"\r%s -\y %d\r ammo [NU DETII]",NUME_SKIN_5,PRET_SKIN_5)
	else	formatex(form,charsmax(form),"\r%s -\y [INVENTAR]",NUME_SKIN_5)
	menu_additem( gMenu, form, "5");
	
	
	//menu_setprop( gMenu, MPROP_EXIT, MEXIT_ALL );
	menu_display( id, gMenu );
	
	return PLUGIN_CONTINUE
}

public thisContent( id, Menu, Item )
{
	if( Item < 0 )	return 0;
	
	if( !is_user_alive( id ) )
	{
		//client_print( id, print_chat, "Trebuie sa fii in viata pentru a-ti seta un Skin!" )
		return 0
	}
	
	new Key[ 3 ];
	new Access, CallBack;
	menu_item_getinfo( Menu, Item, Access, Key, 2, _, _, CallBack );
	new isKey = str_to_num( Key );
	switch( isKey )
	{
		case 1:
		{
			if(model1[id]==1)
			{
				//client_print( id, print_chat, "Felicitari! Ti-ai setat %s.", NUME_SKIN_1 )
			
				zp_override_user_model(id,Models[ 0 ],1)
			
				return PLUGIN_HANDLED
			}
			
			if( zp_get_user_ammo_packs( id ) < PRET_SKIN_1 )
			{
				//client_print( id, print_chat, "Nu ai suficient ammo." )
				return PLUGIN_HANDLED
			}
			
			zp_set_user_ammo_packs( id, zp_get_user_ammo_packs( id ) - PRET_SKIN_1 )
			//client_print( id, print_chat, "Felicitari! Ai achizitionat %s pentru %d pachete ammo", NUME_SKIN_1, PRET_SKIN_1 )
			
			zp_override_user_model(id,Models[ 0 ],1)
			
			model1[ id ] = 1
		}
		case 2:
		{
			if(model2[id]==1)
			{
				//client_print( id, print_chat, "Felicitari! Ti-ai setat %s.", NUME_SKIN_2 )
			
				zp_override_user_model(id,Models[ 1 ],1)
			
				return PLUGIN_HANDLED
			}
			
			if( zp_get_user_ammo_packs( id ) < PRET_SKIN_2 )
			{
				//client_print( id, print_chat, "Nu ai suficient ammo." )
				return PLUGIN_HANDLED
			}
			
			zp_set_user_ammo_packs( id, zp_get_user_ammo_packs( id ) - PRET_SKIN_2 )
			//client_print( id, print_chat, "Felicitari! Ai achizitionat %s pentru %d pachete ammo", NUME_SKIN_2, PRET_SKIN_2 )
			
			zp_override_user_model(id,Models[ 1 ],1)
			
			model2[ id ] = 1
		}
		case 3:
		{
			if(model3[id]==1)
			{
				//client_print( id, print_chat, "Felicitari! Ti-ai setat %s.", NUME_SKIN_3 )
			
				zp_override_user_model(id,Models[ 2 ],1)
			
				return PLUGIN_HANDLED
			}
			
			if( zp_get_user_ammo_packs( id ) < PRET_SKIN_3 )
			{
				//client_print( id, print_chat, "Nu ai suficient ammo." )
				return PLUGIN_HANDLED
			}
			
			zp_set_user_ammo_packs( id, zp_get_user_ammo_packs( id ) - PRET_SKIN_3 )
			//client_print( id, print_chat, "Felicitari! Ai achizitionat %s pentru %d pachete ammo", NUME_SKIN_3, PRET_SKIN_3 )
			
			zp_override_user_model(id,Models[ 2 ],1)
			
			model3[ id ] = 1
		}
		
		case 4:
		{
			if(model4[id]==1)
			{
				//client_print( id, print_chat, "Felicitari! Ti-ai setat %s.", NUME_SKIN_4 )
			
				zp_override_user_model(id,Models[ 3 ],1)
			
				return PLUGIN_HANDLED
			}
			
			if( zp_get_user_ammo_packs( id ) < PRET_SKIN_4 )
			{
				//client_print( id, print_chat, "Nu ai suficient ammo." )
				return PLUGIN_HANDLED
			}
			
			zp_set_user_ammo_packs( id, zp_get_user_ammo_packs( id ) - PRET_SKIN_4 )
			//client_print( id, print_chat, "Felicitari! Ai achizitionat %s pentru %d pachete ammo", NUME_SKIN_4, PRET_SKIN_4 )
			
			zp_override_user_model(id,Models[ 3 ],1)
			
			model4[ id ] = 1
		}
		
		case 5:
		{
			if(model5[id]==1)
			{
				//client_print( id, print_chat, "Felicitari! Ti-ai setat %s.", NUME_SKIN_5 )
			
				zp_override_user_model(id,Models[ 4 ],1)
			
				return PLUGIN_HANDLED
			}
			
			if( zp_get_user_ammo_packs( id ) < PRET_SKIN_5 )
			{
				//client_print( id, print_chat, "Nu ai suficient ammo." )
				return PLUGIN_HANDLED
			}
			
			zp_set_user_ammo_packs( id, zp_get_user_ammo_packs( id ) - PRET_SKIN_5 )
			//client_print( id, print_chat, "Felicitari! Ai achizitionat %s pentru %d pachete ammo", NUME_SKIN_5, PRET_SKIN_5 )
			
			zp_override_user_model(id,Models[ 4 ],1)
			
			model5[ id ] = 1
		}
		
	}
	
	return 1;
}

LoadExp(plr)
{
    get_user_name(plr, authid, sizeof(authid) - 1);
    
    new szModel1[5],szModel2[5],szModel3[5], szModel4[5], szModel5[5]
    if( fvault_get_data(g_vault_name, authid, data, sizeof(data) - 1) )
    {
		parse(data,szModel1,charsmax(szModel1),szModel2,charsmax(szModel2),szModel3,charsmax(szModel3) ,szModel4,charsmax(szModel4),szModel5,charsmax(szModel5))
    
		model1[plr] = str_to_num(szModel1);
		model2[plr] = str_to_num(szModel2);
		model3[plr] = str_to_num(szModel3);
		
		model4[plr] = str_to_num(szModel4);
		model5[plr] = str_to_num(szModel5);
    }
    else
    {
		model1[plr] = 0;
		model2[plr] = 0;
		model3[plr] = 0;
		
		model4[plr] = 0;
		model5[plr] = 0;
    }
}
SaveExp(plr)
{
    get_user_name(plr, authid, sizeof(authid) - 1);
    
    formatex( data, sizeof( data ) - 1, "%d %d %d %d %d", model1[plr],model2[plr],model3[plr] ,model4[plr],model5[plr]);
    
    fvault_set_data(g_vault_name, authid, data);
}
Nume: Skin Zombie
Versiune: 1.0
Link oficial: click
Parola: www.glorius.ro/forum


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

Code: Select all

skin_zombie.amxx
4. Alti pasi necesari....

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


ImaginiImageImage
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests