Difference between else and else if
#9

Quote:
Originally Posted by Nin9r
Посмотреть сообщение
So, the script will return when the if value is true?
new var = 2;
if(var == 1)
{
}
else if(var == 2)
{
}
else if(var == 3)
{
}
. The script will be returned at if var == 2 no ?

if
{
}
if
{
}
will be used just if you want to check different values in any script.

I understand now. Thank you.
FOR EXAMPLE:
Код:
if(GetPlayerWeapon(playerid) == 4) // if player has a Knife it will Send player a message " This is a Knife"
{
 SendClientMessage(playerid, -1, "This Is A Knife.");
}
else if(GetPlayerWeapon(playerid) == 5) // but if player has a Baseball Bat it will Send player a message " This is a BaseBall bat."
{
 SendClientMessage(playerid, -1, "This is A BaseBall Bat.");
}
Reply


Messages In This Thread
Difference between else and else if - by Nin9r - 24.05.2016, 09:55
Re: Difference between else and else if - by ratxrat - 24.05.2016, 10:28
Re: Difference between else and else if - by Dayrion - 24.05.2016, 10:28
Re: Difference between else and else if - by Nin9r - 19.06.2016, 12:36
Re: Difference between else and else if - by Konstantinos - 19.06.2016, 12:39
Re: Difference between else and else if - by Vince - 19.06.2016, 12:59
Re: Difference between else and else if - by Nin9r - 19.06.2016, 17:45
Re: Difference between else and else if - by Luicy. - 19.06.2016, 17:49
Re: Difference between else and else if - by FuNkYTheGreat - 19.06.2016, 17:56

Forum Jump:


Users browsing this thread: 1 Guest(s)