03.12.2010, 20:52
(
Последний раз редактировалось [Aka]Dragonu; 03.12.2010 в 21:04.
)
This one edited by me works . But it only works if i tipe : /heal 0 asd or some keywords .And i want to remove that . Can you remove that for me please ? And one more thing i want to remove the : You have been succesfully healed message please !
pawn Код:
if(strcmp(cmd, "/aheal", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /aheal [playerid/PartOfName]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /aheal [playerid/PartOfName]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 101)
{
new Float:tempheal;
GetPlayerHealth(giveplayerid,tempheal);
if(tempheal >= 100.0)
{
SendClientMessage(playerid, COLOR_GRAD1," You healed that player succesfully !");
return 1;
}
SetPlayerHealth(giveplayerid, 100);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(giveplayerid, COLOR_YELLOW, " You have been fully healed.");
{
format(string, sizeof(string), "Server : %s Has been healed by admin %s.", PlayerName[giveplayerid], PlayerName[playerid]);
SendClientMessageToAll(COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
return 1;
}
}
}
else
{
format(string, sizeof(string), " That player is offline or you mistyped its name!", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}