Hi guys,i want the players can buy a wep with a cost.Example,players use commands to buy weapons.Can anyone give me ?
player.Money -= cost;
if ( cmd "wep" )
{
if ( !text ) MessagePlayer( "use /wep wepid", player );
player.SetWeapon( text );
player.Cash -= 100;
}
Wrong Board... Btw zeeshan thats not going to work.
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;
}
}
MAN..... This is the wrong board... You shouldn't expect someone's help here.
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 );
}
}
}
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.
Quote from: Yankee on May 27, 2017, 06:55 PMQuote 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.
@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.