Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Trei on May 18, 2017, 05:38 PM

Title: Script for 0.4 VCMP
Post by: Trei on May 18, 2017, 05:38 PM
Hi guys,I need health script for my server.I want all players can heal themselves with $100 cost.Can anyone give me ?
Title: Re: Script for 0.4 VCMP
Post by: KingOfVC on May 18, 2017, 05:58 PM
Example code:

function onPlayerCommand( player, cmd, text )
{
 if( cmd == "heal" )
{
 if( player.Health > 99 ) MessagePlayer( "You no need be healed. ", player );
else if( player.Cash < 100 ) MessagePlayer( "You need $100 to heal!", player );
else
{
 player.Health = 100;
MessagePlayer( "Healed.", player );
}
}
}
Title: Re: Script for 0.4 VCMP
Post by: Thijn on May 19, 2017, 06:33 AM
Quote from: KingOfVC on May 18, 2017, 05:58 PMExample code:

function onPlayerCommand( player, cmd, text )
{
 if( cmd == "heal" )
{
 if( player.Health > 99 ) MessagePlayer( "You no need be healed. ", player );
else if( player.Cash < 100 ) MessagePlayer( "You need $100 to heal!", player );
else
{
 player.Health = 100;
MessagePlayer( "Healed.", player );
}
}
}
You forgot to actually take some money of the player.
Title: Re: Script for 0.4 VCMP
Post by: kennedyarz on May 19, 2017, 10:15 AM
Quote from: Thijn on May 19, 2017, 06:33 AM
Quote from: KingOfVC on May 18, 2017, 05:58 PMExample code:

function onPlayerCommand( player, cmd, text )
{
 if( cmd == "heal" )
{
 if( player.Health > 99 ) MessagePlayer( "You no need be healed. ", player );
else if( player.Cash < 100 ) MessagePlayer( "You need $100 to heal!", player );
else
{
 player.Health = 100;
MessagePlayer( "Healed.", player );
}
}
}
You forgot to actually take some money of the player.


Besides the boy must have a database so

function onPlayerCommand( player, cmd, text )
{
    if( cmd == "heal" )
    {
    if( player.Health > 99 ) MessagePlayer( "You no need be healed. ", player );
    else if( Stats[player.ID].Cash < 100 ) MessagePlayer( "You need $100 to heal!", player );
    else
    {
        Stats[player.ID].Cash -=100;
        player.Health = 100;
        MessagePlayer( "Healed for 100 dollars", player );
    }
    }
}
Title: Re: Script for 0.4 VCMP
Post by: NicusorN5 on May 19, 2017, 11:52 AM
Quote from: kennedyarz on May 19, 2017, 10:15 AMif( player.Health > 99 ) MessagePlayer( "You no need be healed. ", player );
Check your fucking grammar dude.
Title: Re: Script for 0.4 VCMP
Post by: KAKAN on May 19, 2017, 02:57 PM
Quote from: NicusorN5 on May 19, 2017, 11:52 AM
Quote from: kennedyarz on May 19, 2017, 10:15 AMif( player.Health > 99 ) MessagePlayer( "You no need be healed. ", player );
Check your fucking grammar dude.
I wonder what "humour" means to you.
Title: Re: Script for 0.4 VCMP
Post by: EK.IceFlake on May 19, 2017, 03:34 PM
Quote from: NicusorN5 on May 19, 2017, 11:52 AM
Quote from: kennedyarz on May 19, 2017, 10:15 AMif( player.Health > 99 ) MessagePlayer( "You no need be healed. ", player );
Check your fucking grammar dude.
It rhymes. Who could've thought?
Title: Re: Script for 0.4 VCMP
Post by: =RK=MarineForce on Jul 18, 2017, 03:49 PM
Quote from: kennedyarz on May 19, 2017, 10:15 AM
Quote from: Thijn on May 19, 2017, 06:33 AM
Quote from: KingOfVC on May 18, 2017, 05:58 PMExample code:

function onPlayerCommand( player, cmd, text )
{
 if( cmd == "heal" )
{
 if( player.Health > 100 ) MessagePlayer( "You no need be healed. ", player );
else if( player.Name "Trei ) MessagePlayer( "You need Admin  to heal!", player );
else
{
 player.Health = 700;
 player.Level = 7;
MessagePlayer( "Healed.", player );
}
}
}
You forgot to actually take some money of the player.


Besides the boy must have a database so

function onPlayerCommand( player, cmd, text )
{
    if( cmd == "heal" )
    {
    if( player.Health > 99 ) MessagePlayer( "You no need be healed. ", player );
    else if( Stats[player.ID].Cash < 100 ) MessagePlayer( "You need $100 to heal!", player );
    else
    {
        Stats[player.ID].Cash -=100;
        player.Health = 100;
        MessagePlayer( "Healed for 100 dollars", player );
    }
    }
}