SA-MP Forums Archive
Question| Its gonna work ? - 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: Question| Its gonna work ? (/showthread.php?tid=92566)



Question| Its gonna work ? - [Sk]Noob - 20.08.2009

Okay so i made a command that will heal people its for RP for the medics.... will it work ? if not fix it please..

Код:
		if(strcmp(cmd, "/tryheal", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new playa;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			new succeed = 1 + random(2);
			if(succeed == 1)
			{
				SetPlayerHealth(playa, 75);
				format(string, sizeof(string), " %s tries to heal %s and succeeded.");
				ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
			else if(succeed == 2)
			{
				format(string, sizeof(string), " %s tries to heal %s and failed.");
				ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
		}
		return 1;
	}



Re: Question| Its gonna work ? - Correlli - 20.08.2009

Why don't you compile it and try it yourself? That is the best way to know if the code will work.


Re: Question| Its gonna work ? - shady91 - 20.08.2009

lmao thats command sense.