SA-MP Forums Archive
How to make "if" or command in one script? - 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: How to make "if" or command in one script? (/showthread.php?tid=207741)



How to make "if" or command in one script? - Injector - 06.01.2011

I mean...

I want to make like that:

Код:
new color;
color = GetPlayerColor(playerid);
if (color != COLOR_GREEN)
{
SendClientMessage(playerid, COLOR_RED, "Error: You are not a medic.");
}
else
{
SetPlayerHealth(playerid, 100);
return 1;
}
Alright... I want it to be Color Green OR Color Yellow. What do I do?!

Thanks.


Re: How to make "if" or command in one script? - Kyle_Olsen - 06.01.2011

Код:
new color;
color = GetPlayerColor(playerid);
if (color != COLOR_GREEN || color != COLOR_YELLOW)
{
SendClientMessage(playerid, COLOR_RED, "Error: You are not a medic.");
}
else
{
SetPlayerHealth(playerid, 100);
return 1;
}
Should work


Re: How to make "if" or command in one script? - selten98 - 06.01.2011

or read the wiki


Re: How to make "if" or command in one script? - Injector - 06.01.2011

Thanks so much!!

It worked!