A little problem with 'switch'.
#2

https://sampwiki.blast.hk/wiki/Control_Structures#.3F:

pawn Код:
new guide = dini_Int(file, "HasGuide");

format(string2, sizeof(string2), "Guide: [%s] Driving License: [%s] Sailing License: [%s] Flying License: [%s] Weapon License: [%s]", (guide == 1) ? ("Yes") : ("No"), dlic);
I think that works, I barely use it, but that's how.

pawn Код:
(guide == 1) ? ("Yes") : ("No")
Means

pawn Код:
if(guide == 1)
{
"yes"
}
else
{
"no"
}
Ofcourse that there won't work, but format needs a string to be fed to '%s' and you can always use:

pawn Код:
format(str, sizeof(str), "%s", "Hello! :D");
It does not need a varible/array or anything.
Reply


Messages In This Thread
A little problem with 'switch'. - by Ihsan_Cingisiz - 23.06.2010, 17:02
Re: A little problem with 'switch'. - by Joe_ - 23.06.2010, 17:05
Re: A little problem with 'switch'. - by Hiddos - 23.06.2010, 17:07
Re: A little problem with 'switch'. - by Joe_ - 23.06.2010, 17:10

Forum Jump:


Users browsing this thread: 1 Guest(s)