Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: :P on Oct 15, 2015, 07:50 PM

Title: decash
Post by: :P on Oct 15, 2015, 07:50 PM
here a code its have a bit prob if player press alt key  to he gone a message you dont have money and nitro i want dont give nitro if he dont have money if he have money give him
function onKeyDown( player, key )
{
if ( key == left_alt )
{
if ( player.Cash >= 1000 ) player.Cash -= 1000;
else MessagePlayer("You dont have $1000 on your hand", player )
}
}
Title: Re: decash
Post by: EK.IceFlake on Oct 16, 2015, 03:26 AM
BindKey whatever --- where?
Title: Re: decash
Post by: Thijn on Oct 16, 2015, 05:51 AM
Like so?
function onKeyDown( player, key )
{
if ( key == left_alt )
{
if ( player.Cash < 1000 ) MessagePlayer("You dont have $1000 on your hand", player );
else {
player.Cash -= 1000;
//Do your nitro stuff here.
}
}
}
Title: Re: decash
Post by: :P on Oct 16, 2015, 12:17 PM
Thanks TOPIC LOCKED