[HELP] /aheal command !
#4

try this
Код:
	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;
	}
I'm not sure it will work but if you can script little bit you can fix it.
Reply


Messages In This Thread
[HELP] /aheal command ! - by [Aka]Dragonu - 03.12.2010, 20:21
Re: [HELP] /aheal command ! - by gychem - 03.12.2010, 20:23
Re: [HELP] /aheal command ! - by [Aka]Dragonu - 03.12.2010, 20:27
Re: [HELP] /aheal command ! - by gychem - 03.12.2010, 20:40
Re: [HELP] /aheal command ! - by [Aka]Dragonu - 03.12.2010, 20:52
Re: [HELP] /aheal command ! - by [Aka]Dragonu - 04.12.2010, 07:02
Re: [HELP] /aheal command ! - by Ash. - 04.12.2010, 07:08
Re: [HELP] /aheal command ! - by [Aka]Dragonu - 04.12.2010, 07:46
Re: [HELP] /aheal command ! - by fangoth1 - 04.12.2010, 10:12
Re: [HELP] /aheal command ! - by fangoth1 - 04.12.2010, 10:25

Forum Jump:


Users browsing this thread: 1 Guest(s)