Weps With Money

Started by Yankee, May 27, 2017, 11:21 AM

Previous topic - Next topic

Yankee

Hi guys,i want the players can buy a wep with a cost.Example,players use commands to buy weapons.Can anyone give me ?

EK.IceFlake


SAzEe21

if ( cmd "wep" )
{
if ( !text ) MessagePlayer( "use /wep wepid", player );
player.SetWeapon( text );
player.Cash -= 100;
}

Anik

Wrong Board... Btw zeeshan  thats not going to work.

Yankee

Is this script work ?
if ( cmd "weapon" )
{
if ( !text ) MessagePlayer( " /weapon id", player );
else
  {
   switch(text)
   {
    case "34":
     player.Weapon(0,29);
     player.Cost -=50;
    case "28":
     player.Weapon(0,7);
     player.Cost -=50;
    case "26":
     player.Weapon(0,9);
     player.Cost -=50;
}
}

Anik

MAN..... This is the wrong board... You shouldn't expect someone's help here.

SAzEe21

#6
You are in wrong board nobody can help you here but next time post your request in here: http://forum.vc-mp.org/?board=37.0

if ( cmd "weapon" )
{
if ( !text ) MessagePlayer( " /weapon id", player );
else
  {
local wep = GetWeaponID(text);
   switch(wep)
   {
    case 34:
     player.Weapon(0,29);
     player.Cost -=50;
     break;

    case 28:
     player.Weapon(0,7);
     player.Cost -=50;
     break;

    case 26:
     player.Weapon(0,9);
     player.Cost -=50;
     break;
default:
MessagePlayer( "Invalid id", player );
}
}
}

Yankee

Quote from: Zeeshan.Bhatti on May 27, 2017, 03:22 PMYou are in wrong board nobody can help you here but next time post your request in here: http://forum.vc-mp.org/?board=37.0

if ( cmd "weapon" )
{
if ( !text ) MessagePlayer( " /weapon id", player );
else
  {
local wep = GetWeaponID(text);
   switch(wep)
   {
    case "34":
     player.Weapon(0,29);
     player.Cost -=50;
     break;

    case "28":
     player.Weapon(0,7);
     player.Cost -=50;
     break;

    case "26":
     player.Weapon(0,9);
     player.Cost -=50;
     break;
default:
MessagePlayer( "Invalid id", player );
}
}
}

Oh thank you man you are pro.

Yankee

Quote from: Yankee on May 27, 2017, 06:55 PM
Quote from: Zeeshan.Bhatti on May 27, 2017, 03:22 PMYou are in wrong board nobody can help you here but next time post your request in here: http://forum.vc-mp.org/?board=37.0

if ( cmd "weapon" )
{
if ( !text ) MessagePlayer( " /weapon id", player );
else
  {
local wep = GetWeaponID(text);
   switch(wep)
   {
    case "34":
     player.Weapon(0,29);
     player.Cost -=50;
     break;

    case "28":
     player.Weapon(0,7);
     player.Cost -=50;
     break;

    case "26":
     player.Weapon(0,9);
     player.Cost -=50;
     break;
default:
MessagePlayer( "Invalid id", player );
}
}
}

Oh thank you man you are pro.
Hey it not works man,game take my cash but not give me the weapon.Anyone know basic command for this.I want players can take a weapon with cost.

SAzEe21

#9
@Yankee command will work properly when you give player a weapon when they buy.

use this one:

if ( cmd "weapon" )
{
if ( !text ) MessagePlayer( " /weapon id", player );
else
  {
local wep = GetWeaponID(text);
   switch(wep)
   {
    case 21:
     player.SetWeapon(21,999);
     player.Cost -=50;
     break;

    case 26:
     player.SetWeapon(26,999);
     player.Cost -=50;
     break;

    case 32:
     player.SetWeapon(32,999);
     player.Cost -=50;
     break;
default:
MessagePlayer( "Invalid id", player );
}
}
}

You can add more weapons like this way.