03.12.2010, 20:40
try this
I'm not sure it will work but if you can script little bit you can fix it.
Код:
if(strcmp(cmd, "/heal", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /heal [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /heal [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; }