valstr
#1

I want to convert some of my integer value to string. I know its easy with switch but, I'm using it in a msgbox and I don't know how to define it. Here is my code:
pawn Код:
case 3:
{
       format(MsgString,sizeof(MsgString),"Light: %s",light);
       ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Items",MsgString,"Close","");
}
Characters[playerid][Light] = 1 : available
Characters[playerid][Light] = 0 : unavaible
Reply
#2

Edit your post again and show what you want to convert because i dont understand where is the problem in this example
Reply
#3

I want to convert Characters[playerid][Light] = 0 to Light: %s
When its 0 %s will be unavailable
When its 1 %s part will be available
i mean
Reply
#4

and it should show Light: 0 or 1 ?
Reply
#5

Msgbox should show if its available or not, its defined with integer in my mod but i want to show it as a text, not a value
Reply
#6

pawn Код:
format(MsgString,sizeof(MsgString),"Light: %s",( (!Characters[playerid][Light]) ? ("unavaible") : ("avaible") ));
Reply
#7

you rock man thanks, I appreciate that
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)