Hi guys,I need health script for my server.I want all players can heal themselves with $100 cost.Can anyone give me ?
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 );
}
}
}
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.
Quote from: Thijn on May 19, 2017, 06:33 AMQuote 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 );
}
}
}
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.
Quote from: NicusorN5 on May 19, 2017, 11:52 AMQuote 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.
Quote from: NicusorN5 on May 19, 2017, 11:52 AMQuote 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?
Quote from: kennedyarz on May 19, 2017, 10:15 AMQuote from: Thijn on May 19, 2017, 06:33 AMQuote 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 );
}
}
}