16.04.2009, 22:43
ive been thinking about this, would it be posible to heal a player if they are near or in a ambulance?
here is what i have so far
im not sure if im even close to be right atm anyone help?
here is what i have so far
Код:
if(strcmp(cmd, "/med", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1) // faction id 1 (medic)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /med [playerid]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new Float:HP;
GetPlayerHealth(playerid,HP);
if(HP < 100
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] That person is already healed");
return 1;
}
// something here
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You can't heal yourself"); return 1; }
format(string, sizeof(string), "[INFO:] Healed by %s.", GetPlayerNameEx(playerid));
SendClientMessage(giveplayerid, COLOR_LIGHTYELLOW2, string);
format(string, sizeof(string), "[INFO:] %s successfully Healed.", GetPlayerNameEx(giveplayerid));
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"has just Healed");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] That player is not near you!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Invalid ID.");
return 1;
}
}

