Set serveral strings into a gametext... Help please =)
#1

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
Reply
#2

Код:
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
Reply
#3

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 =)
Reply
#4

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);
}
Reply
#5

Thanks really much :P <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)