for begin
[pawn]new Medic[MAX_PLAYERS];[/pawn]
cmd
[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, false);
DecPlayerHandCash(playerid,200);
GameTextForPlayer(playerid, "Healing");
Medic[playerid] = 1;
}
return 1;
}[/pawn]
timer stock workable
[pawn]public healing() {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(Medic == 1) {
TogglePlayerControllable(i, 1);
SetPlayerHealth( i, 100.0 );
SendClientMessage( i, COLOR_YELLOW, ">> You have been healed!" );
}
}
}
}[/pawn]