SA-MP Forums Archive
Set serveral strings into a gametext... Help please =) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Set serveral strings into a gametext... Help please =) (/showthread.php?tid=92383)



Set serveral strings into a gametext... Help please =) - introzen - 19.08.2009

Hello =)

I want to set 3 strings into a GameTextForPlayer... I have no idea how to do it and I didn't know what to search on =/

Here is what I got:

pawn Код:
if(pickupid == GS-1)
    {
        new string[256],string2[256],string3[256],owner[MAX_STRING];
        owner = dini_Get("CLRP/Businesses/GS-1","Owner");
        new price = dini_Int("CLRP/Businesses/GS-1","Sellprice");
        new sale = dini_Int("CLRP/Businesses/GS-1","Sale");
        new entrance = dini_Int("CLRP/Businesses/GS-1","Entrance");
        format(string,256,"%s",owner);
        format(string2,256,"%d",entrance);
        format(string3,256,"%d",price);
        GameTextForPlayer(playerid,"",6000,1);
    }
I want it to look like this:

gunshop
owner: (owner)
entrance: (entrance fee)
price: (if sale = 1, this text shall be green, if sale = 0, red...)


How to do that? =/

Thanks xD


Re: Set serveral strings into a gametext... Help please =) - MatrixBoY - 19.08.2009

Код:
if(pickupid == GS-1)
{
  new string[256],owner[MAX_STRING];
  owner = dini_Get("CLRP/Businesses/GS-1","Owner");
  new price = dini_Int("CLRP/Businesses/GS-1","Sellprice");
  new sale = dini_Int("CLRP/Businesses/GS-1","Sale");
  new entrance = dini_Int("CLRP/Businesses/GS-1","Entrance");
  format(string,256,"%s\n %d\n %d",owner, entrance, price);
  GameTextForPlayer(playerid,string,6000,1);
}
there


Re: Set serveral strings into a gametext... Help please =) - introzen - 19.08.2009

Quote:
Originally Posted by MatrixBoY
Код:
if(pickupid == GS-1)
{
  new string[256],owner[MAX_STRING];
  owner = dini_Get("CLRP/Businesses/GS-1","Owner");
  new price = dini_Int("CLRP/Businesses/GS-1","Sellprice");
  new sale = dini_Int("CLRP/Businesses/GS-1","Sale");
  new entrance = dini_Int("CLRP/Businesses/GS-1","Entrance");
  format(string,256,"%s\n %d\n %d",owner, entrance, price);
  GameTextForPlayer(playerid,string,6000,1);
}
there
Doesn't answer all questions... =/

I want the Price value to be green if sale = 1 and red if sale = 0...


Thanks anyway =)


Re: Set serveral strings into a gametext... Help please =) - Amit_B - 19.08.2009

Try this:
pawn Код:
if(pickupid == GS-1)
{
  new string[128];
  format(string,sizeof(string),"~w~gunshop~n~owner: %s~n~entrance: %d~n~price: ~%c~%d",dini_Get("CLRP/Businesses/GS-1","Owner"),dini_Int("CLRP/Businesses/GS-1","Entrance"),dini_Int("CLRP/Businesses/GS-1","Sale") ? 'g' : 'r',dini_Int("CLRP/Businesses/GS-1","Sellprice"));
  GameTextForPlayer(playerid,string,6000,1);
}



Re: Set serveral strings into a gametext... Help please =) - introzen - 19.08.2009

Thanks really much :P <3