valstr - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: valstr (
/showthread.php?tid=607787)
valstr -
Rolyn - 23.05.2016
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
Re: valstr -
Jefff - 23.05.2016
Edit your post again and show what you want to convert because i dont understand where is the problem in this example
Re: valstr -
Rolyn - 23.05.2016
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
Re: valstr -
Jefff - 23.05.2016
and it should show Light: 0 or 1 ?
Re: valstr -
Rolyn - 23.05.2016
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
Re: valstr -
Jefff - 23.05.2016
pawn Код:
format(MsgString,sizeof(MsgString),"Light: %s",( (!Characters[playerid][Light]) ? ("unavaible") : ("avaible") ));
Re: valstr -
Rolyn - 23.05.2016
you rock man thanks, I appreciate that