"&&" question
#5

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
Yes, that is possible.

|| = OR
&& = AND
: = ELSE
? = THEN

for example:
pawn Код:
CMD:kill(playerid, params[]) return if(GetPlayerWantedLevel(playerid, >= 1)) ? SendClientMessage(playerid, -1, "Can't use kill when wanted") : SetPlayerHealth(playerid, 0);
That's possible too.

Example is from JaTochNietDan.
What the hell is this
pawn Код:
if(GetPlayerWantedLevel(playerid, >= 1)) ?
You dont use "?" after an if clause.
and why is >= 1 in the function?
Valid examples:
pawn Код:
return (GetPlayerWantedLevel(playerid) >= 0) SendClientMessage(playerid,RED," You are wanted!") : SendClientMessage(playerid,GREEN," OK!");
and
pawn Код:
if(GetPlayerWantedLevel(playerid) >= 0)
return SendClientMessage(playerid,RED," You are wanted!")
else
return SendClientMessage(playerid,GREEN," OK!");
Reply


Messages In This Thread
"&&" question - by SomebodyAndMe - 23.11.2011, 16:49
Re: "&&" question - by juraska - 23.11.2011, 16:52
Re: "&&" question - by wups - 23.11.2011, 16:55
Re: "&&" question - by Max_Coldheart - 23.11.2011, 16:58
Re: "&&" question - by wups - 23.11.2011, 17:20
Re: "&&" question - by Michael_P - 24.11.2011, 03:12
Re: "&&" question - by Wesley221 - 24.11.2011, 06:48
Re: "&&" question - by [MG]Dimi - 24.11.2011, 06:56
Re: "&&" question - by Wesley221 - 24.11.2011, 07:13
Respuesta: Re: "&&" question - by Donuts - 24.11.2011, 07:32

Forum Jump:


Users browsing this thread: 1 Guest(s)