SA-MP Forums Archive
[HELP] Medic Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Medic Command (/showthread.php?tid=177673)



[HELP] Medic Command - Camacorn - 18.09.2010

Solved, Thanks!


Re: [HELP] Medic Command - mrmuffins - 19.09.2010

Find if the player is close enough to the one you want to /heal.
Check if his health is low enough. Get the players health and add 50 to it.

Example:
Код:
COMMAND:heal(playerid, params[]) {
	new Float:health, user, Float:x, Float:y, Float:z;
	if (sscanf(params, "i", user)) return SendClientMessage(playerid, COLOR_RED, "Usge: /heal <playerid>");
	GetPlayerPos(user, x, y, z); GetPlayerHealth(user, health);
	if (!IsPlayerInRangeOfPoint(playerid, 5, x, y, z)) return SendClientMessage(playerid, COLOR_RED, "Your not close enough");
	if (health > 50) return SendClientMessage(playerid, COLOR_RED, "Player doesn't need this now");
	SendClientMessage(playerid, COLOR_GREEN, "You have just been healed!");
	SetPlayerHealth(playerid, health + 50);
	return 1;
}



Re: [HELP] Medic Command - zack3021 - 19.09.2010

For this command you will need zcmd include, click here to download it.

I suggest you read and learn about Zcmd. Click here and here

When you download it, put it int your include folder which is located in your pawno folder (pawno>include)

Then you can download your Heal command.

Heal.pwn

Heal.amx

Then open your server.cfg file and add Healzcmd in to it


Re: [HELP] Medic Command - Camacorn - 19.09.2010

Quote:
Originally Posted by zack3021
Посмотреть сообщение
For this command you will need zcmd include, click here to download it.

I suggest you read and learn about Zcmd. Click here and here

When you download it, put it int your include folder which is located in your pawno folder (pawno>include)

Then you can download your Heal command.

Heal.pwn

Heal.amx

Then open your server.cfg file and add Healzcmd in to it
I Already Know And Use ZCMD For Everything, And Thanks By The Way, Will Check It Out If Muffins Idea Doesnt Work



Quote:
Originally Posted by mrmuffins
Посмотреть сообщение
Find if the player is close enough to the one you want to /heal.
Check if his health is low enough. Get the players health and add 50 to it.
Thanks Man, Will Test It Now!


Re: [HELP] Medic Command - Camacorn - 19.09.2010

Thanks mrmuffin, it worked, though i added about 4 extra lines to it, so it worked for a certain class


Re: [HELP] Medic Command - zack3021 - 19.09.2010

Can i see what you added cuz when i remade it it dont work for me.

I only added lines for class then it dont work but ill try to fix it. Please let me see what u added.


Re: [HELP] Medic Command - Camacorn - 19.09.2010

Note: This wont work for you, as we use a special Team setup, which i integrated into this code, but here ya go:

Код:
COMMAND:heal(playerid, params[])
{
	if(Class[playerid] == 4)
	{
	new Float:health, user, Float:x, Float:y, Float:z;
	if (sscanf(params, "i", user)) return SendClientMessage(playerid, COLOR_SERVER, "[USAGE]: /heal [playerid]");
	GetPlayerPos(user, x, y, z); GetPlayerHealth(user, health);
	if (!IsPlayerInRangeOfPoint(playerid, 5, x, y, z)) return SendClientMessage(playerid, COLOR_SERVER, "You Are Not Close Enough To The Player!");
	if (health > 50) return SendClientMessage(playerid, COLOR_SERVER, "Player's Health Is Above 50, And Cannot Be Healed!");
	SendClientMessage(playerid, COLOR_ORANGE, "You have just been healed!");
	SetPlayerHealth(playerid, health + 50);
	}
	else return SendClientMessage(playerid,COLOR_SERVER_WARNING,"You Are Not An Medic!");
	return 1;
}
By The way, i can help if you give me the error messages etc..


Re: [HELP] Medic Command - zack3021 - 19.09.2010

lol the reason mine did not work was because i had a /heal command for playerid so this one wont work because of the one i had loaded

Thanks but i try to fix errors on my own (No offence) but i think fixing errors is a great way to learn, and the errors tell you exactly what to do to fix them.