1
Snippet Showroom / Healing in 5 secs :D
« on: November 11, 2012, 11:53:35 pm »
Moderator note: This code does not work with players who have an ID other than 0.
See post: http://forum.vicecitymultiplayer.com/index.php?topic=5276.msg32006#msg32006
Hello guys, and i want to share with you by my little script "Healing in 5 secs" xD
It's very easy:
Command:
[pawn]}
else if ( strcmp( cmd, "!heal", true ) == 0 )
{
new Float:Health; GetPlayerHealth( playerid, Health );
if ( Health >= 100 ) SendClientMessage( playerid, COLOR_YELLOW, ">> Error: You are healthy." );
else
{
TogglePlayerControllable(playerid,0);
SetTimer("Healing",5000,0);
GameTextForPlayer(playerid, "Healing");
}
return 1;
}
return 1;
}[/pawn]
Timer:
[pawn]}
public Healing(playerid)
{
TogglePlayerControllable(playerid, 1);
SetPlayerHealth( playerid, 100.0 );
SendClientMessage( playerid, COLOR_YELLOW, ">> You have been healed!" );
}[/pawn]
Have fun!
See post: http://forum.vicecitymultiplayer.com/index.php?topic=5276.msg32006#msg32006
Hello guys, and i want to share with you by my little script "Healing in 5 secs" xD
It's very easy:
Command:
[pawn]}
else if ( strcmp( cmd, "!heal", true ) == 0 )
{
new Float:Health; GetPlayerHealth( playerid, Health );
if ( Health >= 100 ) SendClientMessage( playerid, COLOR_YELLOW, ">> Error: You are healthy." );
else
{
TogglePlayerControllable(playerid,0);
SetTimer("Healing",5000,0);
GameTextForPlayer(playerid, "Healing");
}
return 1;
}
return 1;
}[/pawn]
Timer:
[pawn]}
public Healing(playerid)
{
TogglePlayerControllable(playerid, 1);
SetPlayerHealth( playerid, 100.0 );
SendClientMessage( playerid, COLOR_YELLOW, ">> You have been healed!" );
}[/pawn]
Have fun!