Command help..
#3

CMD:heal(playerid, params[])
{
foreach(Player,i)
{
new targetid, str[50], str2[50], id;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1 , "You cannot heal yourself");
if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFF,"Usage: /heal [Player id]");
if(playerid == id) return SendClientMessage(playerid, -1, "You cannot heal your self.");
if(!IsPlayerConnected(targetid)) return SendClientMessage (playerid, -1, "The id you're looking for seems not to be online");
SetPlayerHealth(targetid, 100);
format(str, sizeof(str), "Sniper has healed you");
SendClientMessage(targetid, -1, str);
format(str2, sizeof(str2), "You have healed he might be thankful to you now");
SendClientMessage(playerid, -1, str2);

}
return 1;
}


This one works, just add the if stuff to it, tested ig aswell.
Reply


Messages In This Thread
Please help me to fix those commands - by Strier - 03.02.2013, 23:34
Respuesta: Command help.. - by Strier - 04.02.2013, 00:43
Re: Command help.. - by lean1337 - 04.02.2013, 11:27

Forum Jump:


Users browsing this thread: 1 Guest(s)