UWAGA
W związku z upgrade'em Forum Wiaderko do vB 4.x ewentualne błędy i nieprawidłowości proszę zgłaszać w tym temacie
Serwery Counter Strike 1.6 wiaderko.com

HashJama [TP] 193.33.176.148:27015 status serwera HashJama [TP] połącz

HashJama [FFA] 193.33.176.188:27015status serwera HashJama [FFA] połącz

HashJama [DM] 193.33.176.53:27015status serwera HashJama [DM] połącz

HashJama [Aim Hs] 193.33.176.15:27015status serwera HashJama [Aim Hs] połącz

HashJama [Flags] 193.33.176.111:27015status serwera HashJama  [Flags] połącz

HashJama [AWP/HG DM] 193.33.176.50:27015status serwera HashJama [AWP/HG DM] 193.33.176.50:27015 połącz

HashJama [TP #2] 193.33.176.54:27015status serwera HashJama [TP #2] 193.33.176.54:27015 połącz

wiaderko.com [Ventrilo] v1.svoice.pl:6416status serwera wiaderko.com [Ventrilo]

SPONSOR:
pukawka.pl

Wątek: Menu z podmiana modeli

Pokaż wyniki od 1 do 3 z 3
  1. #1 Menu z podmiana modeli 
    Spamer
    Dołączył
    Jan 2008
    Posty
    100
    Szukam pluginu dzięki któremu po wpisaniu w say np. "/model" pojawi się menu w którym będę mógł wybrać model do podmiany (modele oczywiście mam). Może idzie przerobić ten plugin?(polega on na tym iż "nakłada" modele na głowę standardowo czapki, lecz potrzebuje pluginu który całkowicie zmieni model:
    Kod:
    #include <amxmodx>
    #include <amxmisc>
    #include <fakemeta>
    
    new g_bwEnt[33]
    
    #define PLUG_NAME "HATS"
    #define PLUG_AUTH "SgtBane"
    #define PLUG_VERS "0.2"
    #define PLUG_TAG "HATS"
    
    #define menusize 	220
    
    new HatFile[64]
    new MenuPages, TotalHats
    new CurrentMenu[33]
    
    #define MAX_HATS 64
    new HATMDL[MAX_HATS][41]
    new HATNAME[MAX_HATS][41]
    
    public plugin_init()
    {
    	register_plugin(PLUG_NAME, PLUG_VERS, PLUG_AUTH)
    	register_concmd("amx_givehat", "Give_Hat", ADMIN_RCON, "<nick> <mdl #>")
    	register_concmd("amx_removehats", "Remove_Hat", ADMIN_RCON, " - Removes hats from everyone.")
    	register_menucmd(register_menuid("\yHat Menu: [Page"),(1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9),"MenuCommand")
    	register_clcmd("say /hats",		"ShowMenu", -1, "Shows Knife menu")
    }
    
    public ShowMenu(id)
    {
    	CurrentMenu[id] = 1
    	ShowHats(id)
    	return PLUGIN_HANDLED
    }
    
    public ShowHats(id)
    {
    	new keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
    	
    	new szMenuBody[menusize + 1], WpnID
    	new nLen = format(szMenuBody, menusize, "\yHat Menu: [Page %i/%i]^n",CurrentMenu[id],MenuPages)
    	
    	// Get Hat Names And Add Them To The List
    	for (new hatid=0; hatid < 8; hatid++) {
    		WpnID = ((CurrentMenu[id] * 8) + hatid - 8)
    		if (WpnID < TotalHats) {
    			nLen += format(szMenuBody[nLen], menusize-nLen, "^n\w %i. %s",hatid + 1,HATNAME[WpnID])
    		}
    	}
    	
    	// Next Page And Previous/Close
    	if (CurrentMenu[id] == MenuPages) {
    		nLen += format(szMenuBody[nLen], menusize-nLen, "^n^n\d9. Next Page")
    	} else {
    		nLen += format(szMenuBody[nLen], menusize-nLen, "^n^n\w9. Next Page")
    	}
    	
    	if (CurrentMenu[id] > 1) {
    		nLen += format(szMenuBody[nLen], menusize-nLen, "^n\w0. Previous Page")
    	} else {
    		nLen += format(szMenuBody[nLen], menusize-nLen, "^n\w0. Close")
    	}
    	show_menu(id, keys, szMenuBody, -1)
    	return PLUGIN_HANDLED
    }
    public MenuCommand(id, key) 
    {
    	switch(key)
    	{
    		case 8:		//9 - [Next Page]
    		{
    			if (CurrentMenu[id] < MenuPages) CurrentMenu[id]++
    			ShowHats(id)
    			return PLUGIN_HANDLED
    		}
    		case 9:		//0 - [Close]
    		{
    			CurrentMenu[id]--
    			if (CurrentMenu[id] > 0) ShowHats(id)
    			return PLUGIN_HANDLED
    		}
    		default:
    		{
    			new HatID = ((CurrentMenu[id] * 8) + key - 8)
    			if (HatID < TotalHats) {
    				Set_Hat(id,HatID,id)
    			}
    		}
    	}
    	return PLUGIN_HANDLED
    }
    
    public plugin_precache()
    {
    	new cfgDir[32]
    	get_configsdir(cfgDir,31)
    	formatex(HatFile,63,"%s/HatList.ini",cfgDir)
    	command_load()
    	
    	for (new i = 1; i < TotalHats; ++i) {
    		if (file_exists (HATMDL[i])) {
    			precache_model(HATMDL[i])
    			server_print("[%s] Precached %s",PLUG_TAG,HATMDL[i])
    		} else {
    			server_print("[%s] Failed to precache %s",PLUG_TAG,HATMDL[i])
    		}
    	}
    }
    
    public client_connect(id)
    {
    	if(g_bwEnt[id] > 0) engfunc(EngFunc_RemoveEntity,g_bwEnt[id])
    	g_bwEnt[id] = 0
    }
    
    public client_disconnect(id)
    {
    	if(g_bwEnt[id] > 0) engfunc(EngFunc_RemoveEntity,g_bwEnt[id])
    	g_bwEnt[id] = 0
    }
    
    public Give_Hat(id)
    {
    	new smodelnum[5], name[32]
    	read_argv(1,name,31)
    	read_argv(2,smodelnum,4)
    	
    	new player = cmd_target(id,name,2)
    	if (!player) {
    		client_print(id,print_chat,"[%s] Player With That Name Does Not Exist.",PLUG_TAG)
    		return PLUGIN_HANDLED
    	}
    	
    	new imodelnum = (str_to_num(smodelnum))
    	if (imodelnum > MAX_HATS) return PLUGIN_HANDLED
    	
    	Set_Hat(player,imodelnum,id)
    
    	return PLUGIN_CONTINUE
    }
    
    public Remove_Hat(id)
    {
    	for (new i = 0; i < get_maxplayers(); ++i) {
    		if (is_user_connected(i) && g_bwEnt[i] > 0) {
    			engfunc(EngFunc_RemoveEntity,g_bwEnt[i])
    			g_bwEnt[i] = 0
    		}
    	}
    	client_print(id,print_chat,"[%s] Removed hats from everyone.",PLUG_TAG)
    	return PLUGIN_CONTINUE
    }
    
    public Set_Hat(player,imodelnum,targeter)
    {
    	new name[32]
    	get_user_name(player, name, 31)
    	if (imodelnum == 0) {
    		if(g_bwEnt[player] > 0) engfunc(EngFunc_RemoveEntity,g_bwEnt[player])
    		g_bwEnt[player] = 0
    		client_print(targeter, print_chat, "[%s] Removed hat from %s",PLUG_TAG,name)
    	} else if (file_exists(HATMDL[imodelnum])) {
    		if(g_bwEnt[player] < 1) {
    			g_bwEnt[player] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
    			if(g_bwEnt[player] > 0) 
    			{
    				set_pev(g_bwEnt[player], pev_movetype, MOVETYPE_FOLLOW)
    				set_pev(g_bwEnt[player], pev_aiment, player)
    				set_pev(g_bwEnt[player], pev_rendermode, kRenderNormal)
    				set_pev(g_bwEnt[player], pev_renderamt, 0.0)
    				engfunc(EngFunc_SetModel, g_bwEnt[player], HATMDL[imodelnum])
    			}
    		} else {
    			engfunc(EngFunc_SetModel, g_bwEnt[player], HATMDL[imodelnum])
    		}
    		client_print(targeter, print_chat, "[%s] Set %s on %s",PLUG_TAG,HATNAME[imodelnum],name)
    	}
    }
    
    public command_load()
    {
    	if(file_exists(HatFile)) {
    		HATMDL[0] = ""
    		HATNAME[0] = "None"
    		TotalHats = 1
    		new sfLineData[128]
    		new file = fopen(HatFile,"rt")
    		while(file && !feof(file)) {
    			fgets(file,sfLineData,127)
    			
    			// Skip Comment and Empty Lines
    			if (containi(sfLineData,";") > -1) continue
    			
    			// BREAK IT UP!
    			parse(sfLineData, HATMDL[TotalHats],40,HATNAME[TotalHats],40)
    			
    			TotalHats += 1
    			if(TotalHats >= MAX_HATS) {
    				server_print("[%s] Reached hat limit",PLUG_TAG)
    				break
    			}
    		}
    		if(file) fclose(file)
    	}
    	MenuPages = floatround((TotalHats / 8.0), floatround_ceil)
    	server_print("[%s] Loaded %i hats, Generated %i pages)",PLUG_TAG,TotalHats,MenuPages)
    }
     

  2. #2  
    Spamer z doświadczeniem
    Dołączył
    Dec 2007
    Posty
    421
    proste, trzymaj:

    Kod:
    #include <amxmodx>
    #include <cstrike>
    
    #define MODEL1 "jakis_model1"
    #define MODEL2 "jakis_model2"
    #define MODEL3 "jakis_model3"
    #define MODEL4 "jakis_model4"
    #define MODEL5 "jakis_model5"
    
    
    public plugin_init()
    {
      register_clcmd("say /model", "model_open")
    }
    
    public plugin_precache()
    {
      precache_model("models/player/jakis_model1/jakis_model1.mdl")
      precache_model("models/player/jakis_model2/jakis_model2.mdl")
      precache_model("models/player/jakis_model3/jakis_model3.mdl")
      precache_model("models/player/jakis_model4/jakis_model4.mdl")
      precache_model("models/player/jakis_model5/jakis_model5.mdl")
    }
    
    public model_open(id)
    {
            if( !is_user_alive(id) )
             {
              client_print(id, print_chat, "Mozesz zmienic model jedynie gdy zyjesz!")
              return PLUGIN_HANDLED
             }
    	new menu = menu_create("Menu Modeli:", "model_handler")
    	menu_additem(menu, "Model pierwszy", "1", 0)
    	menu_additem(menu, "Model drugi", "2", 0)
    	menu_additem(menu, "Model trzeci", "3", 0)
    	menu_additem(menu, "Model czwarty", "4", 0)
    	menu_additem(menu, "Model piaty", "5", 0)
    	menu_additem(menu, "Wyczysc model", "6", 0)
    	menu_display(id, menu, 0)
            return PLUGIN_CONTINUE
    }
    
    public model_handler(id, menu, item)
    {
            if (item == 0)
            {
                    set_task(0.2, "models1", id)
            }
            if (item == 1)
            {
                    set_task(0.2, "models2", id)
            }
            if (item == 2)
            {
                    set_task(0.2, "models3", id)
            }
            if (item == 3)
            {
                    set_task(0.2, "models4", id)
            }
            if (item == 4)
            {
                    set_task(0.2, "models5", id)
            }
            if (item == 5)
            {
                    set_task(0.2, "models6", id)
            }
    	return PLUGIN_CONTINUE
    }
    
    public models1(id)
    {
        cs_reset_user_model(id)
        cs_set_user_model(id, MODEL1)
    }
    
    public models2(id)
    {
        cs_reset_user_model(id)
        cs_set_user_model(id, MODEL2)
    }
    
    public models3(id)
    {
        cs_reset_user_model(id)
        cs_set_user_model(id, MODEL3)
    }
    
    public models4(id)
    {
        cs_reset_user_model(id)
        cs_set_user_model(id, MODEL4)
    }
    
    public models5(id)
    {
        cs_reset_user_model(id)
        cs_set_user_model(id, MODEL5)
    }
    
    public models6(id)
    {
        cs_reset_user_model(id)
    }
     

  3. #3  
    Spamer
    Dołączył
    Jan 2008
    Posty
    100
    dzieki za pomoc "+" 4you
     

Podobne wątki

  1. [Steam & Non Steam] Podmiana modeli, problem ;/
    By ddd3 in forum Problemy z CS 1.6
    Odpowiedzi: 1
    Ostatni post / autor: 02-07-2010, 17:13
  2. [Steam] Podmiana zdjęc modeli
    By dawidus1449 in forum Problemy z CS 1.6
    Odpowiedzi: 2
    Ostatni post / autor: 10-03-2010, 17:22
  3. Podmiana modeli T
    By black24 in forum Pisanie pluginów AMXX
    Odpowiedzi: 5
    Ostatni post / autor: 18-08-2009, 02:54
  4. Podmiana Modeli Rak Zombie Plague
    By Falloutboy in forum Problem z pluginem AMX/AMXX
    Odpowiedzi: 2
    Ostatni post / autor: 27-07-2009, 14:12
  5. Podmiana modeli + zmiana modeli przy wyborze postaci w menu
    By surfnsnow in forum Problemy z CS 1.6
    Odpowiedzi: 4
    Ostatni post / autor: 25-06-2009, 23:07
  6. zp / klasy zombie, podmiana modeli
    By infomaster in forum Problem z pluginem AMX/AMXX
    Odpowiedzi: 0
    Ostatni post / autor: 28-04-2009, 16:11
  7. Ciemność na mapie oraz podmiana modeli
    By tosiek in forum Szukam pluginu AMX/AMXX
    Odpowiedzi: 3
    Ostatni post / autor: 04-05-2008, 21:34
  8. podmiana broni,modeli....itp?
    By Norayaki in forum Problemy z CS 1.6
    Odpowiedzi: 5
    Ostatni post / autor: 29-10-2007, 17:38

Odwiedzający znaleźli tę stronę szukając:

Nikt jeszcze nie odwiedził tej strony poprzez wyszukiwarki
Uprawnienia umieszczania postów
  • Nie możesz zakładać nowych tematów
  • Nie możesz pisać wiadomości
  • Nie możesz dodawać załączników
  • Nie możesz edytować swoich postów
  •