how to use IF
#1

How to use IF like that
PHP Code:
if(and and 0)
{
 
// my code
}
else if 
!= 0 sendclientmessage(playerid,-1,"x is not 0");
else if 
!= 0 sendclientmessage(playerid,-1,"y is not 0");
else if 
!= 0 sendclientmessage(playerid,-1,"z is not 0"); 
how to put that AND? I need in this IF to all 3 variables to be on 0
Reply
#2

Instead of and use &&
Reply
#3

new a = 1;
new b = 0;

OnMyFunction()
{
if(a == b)
{
SendClientMessage(playerid, -1, "A and B is Same");
}
else if(a != b) //or you can use else
{
SendClientMessage(playerid, -1, "A and B is Different");
}
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)