Script for 0.4 VCMP

Started by Trei, May 18, 2017, 05:38 PM

Previous topic - Next topic

Trei

Hi guys,I need health script for my server.I want all players can heal themselves with $100 cost.Can anyone give me ?

KingOfVC

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 );
}
}
}

Thijn

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.

kennedyarz

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 );
    }
    }
}

NicusorN5

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.

KAKAN

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.
oh no

EK.IceFlake

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?

=RK=MarineForce

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 );
    }
    }
}
Try to UnderStand ME!