Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Need help for weapon wall

  1. #1
    ... connecting
    Join Date
    Jun 2014
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post

    Need help for weapon wall

    ( i'm not good for scripting )
    i see the weapon wall script but only for 1 weapons
    so i do this script , its wrong idk why please say me

    H
    E
    L
    P


    Code:
    main() { maps\mp\_load::main(); thread teleport(); thread buyweap();  thread buyweap1();  thread buyweap2();  thread buyweap3();  thread buyweap4();  thread buyweap5();  thread buyweap6();  thread buyweap7();  thread buyweap8();  thread buyweap9(); thread buyweap10(); }
    
    buyweap()
    {
    	buyweap = getent("buyweapon_kar98k", "targetname");
    	
    	while(1) 
    	{
    		buyweap waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "kar98k_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("kar98k_mp")); //checks if the player doesn't have kar98k
    
    		if(shopper.money >= 500 && wepcurrent == item && shopper.pers["team"] == "axis") //checks that it shopper has enough money and he already has kar98k and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=500; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo to kar98k
    		}
    		else if(shopper.pers["team"] != "axis") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Zombies^6=-"); 
    		}
    		else if(shopper.money < 500 && shopper.pers["team"] == "axis") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 500) //if player doesn't have kar98k and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=500; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("kar98k_mp"); //gives kar98k
    		}
    	}
    }
    
    buyweap1()
    {
    	buyweap1 = getent("buyweapon_MP5A4", "targetname");
    	
    	while(1) 
    	{
    		buyweap1 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "nsmp5a4_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("nsmp5a4_mp")); //checks if the player doesn't have kar98k
    
    		if(shopper.money >= 750 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has kar98k and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=750; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo to kar98k
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 750 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 750) //if player doesn't have kar98k and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=750; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("nsmp5a4_mp"); //gives kar98k
    		}
    	}
    }
    
    buyweap2()
    {
    	buyweap2 = getent("buyweapon_Dragunov", "targetname");
    	
    	while(1) 
    	{
    		buyweap2 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "nsdragunov_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("nsdragunov_mp")); //checks if the player doesn't have kar98k
    
    		if(shopper.money >= 750 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has kar98k and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=750; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo to kar98k
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 750 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 750) //if player doesn't have kar98k and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=750; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("nsdragunov_mp"); //gives kar98k
    		}
    	}
    }
    
    buyweap3()
    {
    	buyweap3 = getent("buyweapon_G36", "targetname");
    	
    	while(1) 
    	{
    		buyweap3 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "nsg36_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("nsg36_mp")); //checks if the player doesn't have kar98k
    
    		if(shopper.money >= 800 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has kar98k and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=800; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 800 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 800) //if player doesn't have the weapon and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=800; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("nsg36_mp");
    		}
    	}
    }
    
    buyweap4()
    {
    	buyweap4 = getent("buyweapon_Thompson", "targetname");
    	
    	while(1) 
    	{
    		buyweap4 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "thompson_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("thompson_mp")); //checks if the player doesn't have kar98k
    
    		if(shopper.money >= 250 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has the weapon and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=250; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 250 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 250) //if player doesn't have the weapon and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=250; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("thompson_mp");
    		}
    	}
    }
    
    buyweap5()
    {
    	buyweap5 = getent("buyweapon_MP40", "targetname");
    	
    	while(1) 
    	{
    		buyweap5 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "mp40_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("mp40_mp")); //checks if the player doesn't have the weapon
    
    		if(shopper.money >= 250 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has the weapon and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=250; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 250 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 250) //if player doesn't have the weapon and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=250; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("mp40_mp");
    		}
    	}
    }
    
    buyweap6()
    {
    	buyweap6 = getent("buyweapon_Winchester", "targetname");
    	
    	while(1) 
    	{
    		buyweap6 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "nswinchester_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("nswinchester_mp")); //checks if the player doesn't have the weapon
    
    		if(shopper.money >= 350 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has the weapon and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=350; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 350 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 350) //if player doesn't have the weapon and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=350; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("nswinchester_mp");
    		}
    	}
    }
    
    buyweap7()
    {
    	buyweap7 = getent("buyweapon_Winchester", "targetname");
    	
    	while(1) 
    	{
    		buyweap7 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "webley_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("webley_mp")); //checks if the player doesn't have the weapon
    
    		if(shopper.money >= 1000 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has the weapon and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=1000; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 1000 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 1000) //if player doesn't have the weapon and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=1000; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("webley_mp");
    		}
    	}
    }
    
    buyweap8()
    {
    	buyweap8 = getent("buyweapon_Bazooka", "targetname");
    	
    	while(1) 
    	{
    		buyweap8 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "panzerschrek_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("panzerschrek_mp")); //checks if the player doesn't have the weapon
    
    		if(shopper.money >= 350 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has the weapon and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=350; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 350 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 350) //if player doesn't have the weapon and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=350; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("panzerschrek_mp");
    		}
    	}
    }
    
    buyweap9()
    {
    	buyweap9 = getent("buyweapon_Bazooka", "targetname");
    	
    	while(1) 
    	{
    		buyweap9 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "panzerschrek_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("panzerschrek_mp")); //checks if the player doesn't have the weapon
    
    		if(shopper.money >= 350 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has the weapon and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=350; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4This Can Only Be Used By The Hunters^6=-"); 
    		}
    		else if(shopper.money < 350 && shopper.pers["team"] == "Allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 350) //if player doesn't have the weapon and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=350; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("panzerschrek_mp");
    		}
    	}
    }
    
    buyweap10()
    {
    	buyweap10 = getent("give_kark", "targetname");
    	
    	while(1) 
    	{
    		buyweap10 waittill("trigger", shopper); //wait till the player activates the trigger
    		
    		item = "kar98k_mp"; //the weapon player will buy
    
    		wepcurrent = shopper getcurrentweapon(); //checks the current weapon
    		weapon1 = shopper getweaponslotweapon("primary"); //checks the primary weapon
    		weapon2 = shopper getweaponslotweapon("primaryb"); //checks the primaryb weapon
    		notwep = !(shopper hasweapon("kar98k_mp")); //checks if the player doesn't have kar98k
    
    		if(shopper.money >= 0 && wepcurrent == item && shopper.pers["team"] == "allies") //checks that it shopper has enough money and he already has kar98k and he is a hunter 
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    				
    			wepammo = shopper getweaponslotammo(currentslot);
    				
    			shopper.money-=0; //takes the money
    			shopper givemaxammo(wepcurrent); //gives max ammo to kar98k
    		}
    		else if(shopper.pers["team"] != "allies") //if player is a zombie
    		{
    			shopper iprintlnbold("^6-=^4Only Hunter Spawn with Kar98k^6=-"); 
    		}
    		else if(shopper.money < 0 && shopper.pers["team"] == "allies") //if player is a hunter and he doesn't have enough money
    		{
    			shopper iprintln("-=^1LoL^7=-");
    		}
    		else if(notwep && shopper.pers["team"] == "allies" && shopper.money >= 0) //if player doesn't have kar98k and player is a hunter and has enough money
    		{
    			if(wepcurrent == weapon1)
    			{
    				currentslot = "primary";
    			}
    			else
    			{
    				currentslot = "primaryb";
    			}
    
    			shopper.money-=0; //take the money
    			shopper setweaponslotweapon(currentslot, item);
    			shopper SwitchToWeapon("kar98k_mp"); //gives kar98k
    		}
    	}
    }
    Last edited by Tally; 13th October 2014 at 11:24.

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    1. have you debugged it?
    2. try with [code] [php] tags
    3. this is not your own code right?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    ... connecting
    Join Date
    Jun 2014
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    I take the script of here : http://killtube.org/showthread.php?6...t=weapons+wall
    But i make modification

  4. #4
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    This is how i would make it.
    PHP Code:
    main() 

        
    maps\mp\_load::main(); 
        
    thread teleport();
        
    zommessage "^6-=^4This Can Only Be Used By The Zombies^6=-";
        
    huntermessage "^6-=^4This Can Only Be Used By The Hunters^6=-";
        
    thread buyweap("buyweapon_kar98k""kar98k_mp"500"axis"zommessage);
        
    thread buyweap("buyweapon_MP5A4""nsmp5a4_mp"750"allies"huntermessage);
    }

    buyweap(nameitempriceteamteammessage)
    {
        
    buyweap getent(name"targetname");
        
        while(
    1
        {
            
    buyweap waittill("trigger"shopper); //wait till the player activates the trigger
            
            
    if(shopper.pers["team"] != team//if player isn't the right team
            
    {
                
    shopper iprintlnbold(teammessage); 
                continue; 
            }

            
    //checks that it shopper has enough money and he already hasn't the item
            
    if(shopper.money >= price
            {
                
    wepcurrent shopper getcurrentweapon(); //checks the current weapon
                
    weapon1 shopper getweaponslotweapon("primary"); //checks the primary weapon
                
    notwep = !(shopper hasweapon(item)); //checks if the player doesn't have the item
                
    currentslot "primaryb";
                
                if(
    wepcurrent == weapon1)
                {
                    
    currentslot "primary";
                }

                
    shopper.money-=price//takes the money
                
                
    if(notwep)
                    
    shopper setweaponslotweapon(currentslotitem);
                    
                
    shopper givemaxammo(item); //gives max ammo to kar98k
                
    shopper SwitchToWeapon(item);
            }
            else if(
    shopper.money price//if he doesn't have enough money
            
    {
                
    shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
            }
        }

    Quote Originally Posted by A$D SkyZ View Post
    I take the script of here : http://killtube.org/showthread.php?6...t=weapons+wall
    But i make modification
    You mixed some 'axis' and 'allies' with hunters and zombies.

  5. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Maybe add a precache in there so its fool-proof, but otherwise i agree. What are you thinking copying the same code 8x?

    Also, why put that condition in your else(shopper.money < price)? Its already taken care of in the initial if.
    .

    Edit: concerning the script OP uses, it checks if team == "Allies" instead of "allies". Might be an issue which could be easily found by debugging.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. The Following User Says Thank You to IzNoGoD For This Useful Post:

    Mitch (13th October 2014)

  7. #6
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by IzNoGoD View Post
    Also, why put that condition in your else(shopper.money < price)? Its already taken care of in the initial if.
    True, it is better. I overlooked it when i was cleaning the code up.

  8. #7
    ... connecting
    Join Date
    Jun 2014
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    I only want to do 8 weapons and i don't know how to do =/

  9. #8
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by A$D SkyZ View Post
    I only want to do 8 weapons and i don't know how to do =/
    To increase from 2 weapons to 8, you create new threads to the buyweap() function:

    Code:
    thread buyweap( "buyweapon_kar98k", "kar98k_mp", 500, "axis", zommessage );
    thread buyweap( "buyweapon_MP5A4", "nsmp5a4_mp", 750, "allies", huntermessage );
    thread buyweap( "buyweapon_kar98k", "kar98k_mp", 500, "axis", zommessage );
    thread buyweap( "buyweapon_springfield", "springfield_mp", 600, "axis", zommessage );
    thread buyweap( "buyweapon_greasegun", "greasegun_mp", 700, "axis", zommessage );
    thread buyweap( "buyweapon_ppsh", "ppsh_mp", 800, "axis", zommessage );
    thread buyweap( "buyweapon_m1garand", "m1garand_mp", 900, "axis", zommessage );
    Change "axis" for "allies" and zommessage to hunter if you want allies/hunters to be able to buy them.

  10. #9
    ... connecting
    Join Date
    Jun 2014
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    thx guy you helped me

  11. The Following User Says Thank You to A$D SkyZ For This Useful Post:

    Mitch (13th October 2014)

  12. #10
    ... connecting
    Join Date
    Jun 2014
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    what's wrong here
    PHP Code:
    main() 

        
    maps\mp\_load::main(); 
        
    thread teleport();
        
    zommessage "^6-=^4This Can Only Be Used By The Zombies^6=-";
        
    huntermessage "^6-=^4This Can Only Be Used By The Hunters^6=-";
    thread buyweap"buyweapon_kar98k""kar98k_mp"500"axis"zommessage);
    thread buyweap"buyweapon_Thompson""thompson_mp"250"allies"huntermessage);
    thread buyweap"buyweapon_g36""nsg36_mp"650"allies"huntermessage);
    thread buyweap"buyweapon_Dragunov""nsdragunov_mp"650"allies"huntermessage );
    thread buyweap"buyweapon_mp40""mp40_mp"250"allies"huntermessage );
    thread buyweap"buyweapon_MP5A4""nsmp5a4_mp"575"allies"huntermessage );
    thread buyweap"buyweapon_Bazooka""panzerschrek_mp"500"allies"huntermessage );
    thread buyweap"buyweapon_Psycho""webley_mp"1000"allies"huntermessage );
    thread buyweap"buyweapon_Winchester""nswinchester_mp"500"allies"huntermessage );
    thread buyweap"give_kark""kar98k_mp"0"allies"huntermessage ));
    }

    buyweap(nameitempriceteamteammessage)
    {
        
    buyweap getent(name"targetname");
        
        while(
    1
        {
            
    buyweap waittill("trigger"shopper); //wait till the player activates the trigger
            
            
    if(shopper.pers["team"] != team//if player isn't the right team
            
    {
                
    shopper iprintlnbold(teammessage); 
                continue; 
            }

            
    //checks that it shopper has enough money and he already hasn't the item
            
    if(shopper.money >= price
            {
                
    wepcurrent shopper getcurrentweapon(); //checks the current weapon
                
    weapon1 shopper getweaponslotweapon("primary"); //checks the primary weapon
                
    notwep = !(shopper hasweapon(item)); //checks if the player doesn't have the item
                
    currentslot "primaryb";
                
                if(
    wepcurrent == weapon1)
                {
                    
    currentslot "primary";
                }

                
    shopper.money-=price//takes the money
                
                
    if(notwep)
                    
    shopper setweaponslotweapon(currentslotitem);
                    
                
    shopper givemaxammo(item); //gives max ammo to kar98k
                
    shopper SwitchToWeapon(item);
            }
            else if(
    shopper.money price//if he doesn't have enough money
            
    {
                
    shopper iprintln("-=^1You Do Not Have Enough Money To Purchase This Item^7=-");
            }
        }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •