Basic Wep System With Cost

Started by Yankee, May 28, 2017, 07:32 AM

Previous topic - Next topic

Yankee

Hi guys,i tried all systems and they not work properly.I want players can take a weapon with cost,for example player can take a minigun with $5000 and other can take a M4 with $2500.Thanks from now.

Anik

Quote from: Yankee on May 28, 2017, 07:32 AMHi guys,i tried all systems and they not work properly.
So you are trying to say that all those systems are bugged?

Zone_Killer

simple:

if(WEP_M4) return "2500";
else if(WEP_MINIGUN) return "5000";
;D
Bohemia Is God Of Punjabi Rap
Yo Yo Honey Singh tou chutiya hai

Yankee

#3
Quote from: Doom_Kill3R on May 28, 2017, 08:07 AM:edit: If you are not trying yourself to do anything then get aware of one thing, nobody got time to sit here and code stuff for you. Do your stuff yourself, ask for help if your code doesn't work which you made yourself

Hey man,i did my stuff already,I'm working on this system for three days.Here is my script:[spoiler]
else if ( cmd == "silah" )
{
if ( !text ) MessagePlayer( " /weapon id", player );
else
  {
local wep = text;
   switch(wep)
  {
     case "motor":
     if (player.Cash < 1000) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(11,1);
     player.Money      -=1000;
  }
   
     case "bomba":
     if (player.Cash < 500) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(12,10);
     player.Money      -=500;
  }
   
     case "gaz":
     if (player.Cash < 600) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(14,10);
     player.Money      -=600;
  }
   
     case "molotof":
     if (player.Cash < 1200) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(15,15);
     player.Money      -=1200;
  }
   
     case "roketatar":
     if (player.Cash < 5000) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(102,25);
     player.Money      -=5000;
  }
   
     case "tabanca":
     if (player.Cash < 400) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(17,200);
     player.Money      -=400;
  }
   
     case "spaz":
     if (player.Cash < 2500) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(20,100);
     player.Money      -=2500;
  }
   
     case "stubby":
     if (player.Cash < 1500) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(21,100);
     player.Money      -=1500;
  }
   
     case "tec9":
     if (player.Cash < 1400) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(22,200);
     player.Money      -=1400;
  }
   
     case "uzi":
     if (player.Cash < 1600) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(23,200);
     player.Money      -=1600;
  }
   
     case "mac10":
     if (player.Cash < 1300) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(24,600);
     player.Money      -=1300;
  }
   
     case "mp5":
     if (player.Cash < 2000) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(104,1000);
     player.Money      -=2000;
  }
   
     case "minigun":
     if (player.Cash < 10000) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(33,500);
     player.Money      -=10000;
  }
   
     case "m4":
     if (player.Cash < 2600) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(100,29);
     player.Money      -=2600;
  }
   
     case "ak47":
     if (player.Cash < 2750) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(103,29);
     player.Money      -=2750;
  }
   
     case "m249":
     if (player.Cash < 3500) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(105,29);
     player.Money      -=3500;
  }
   
     case "barret":
     if (player.Cash < 4000) MessagePlayer("Yetersiz para!", player)
     else {
     player.SetWeapon(101,29);
     player.Money      -=4000;
  }
     break;
default:
MessagePlayer( "Invalid id", player );
break;
}
}
}
 [/spoiler]

But PlayerMessage's which said to players Yetersiz Para (not enough money) is sended 17 times.Because i make a script fail.I want all messages to players(Yetersiz para-not enough money)weapon by weapon.I can't describe it is hard but i believe anyone come and fix my problem.



Shadow

You need a break; after each case ends. Not sure that the script above reflects the intended behaviour though.
QuotePS:is trash is ur home language??

EK.IceFlake

Stop substituting [code] tags with [spoiler] tags.