Percent sign
#1

Is it possible to send the percent sign (%) ingame? As I want to say something is '25% complete'
Reply
#2

Doesn't work in client messages at all. I know it works with textdraws, though. Not sure about gametext or dialogs. Take note that if you want to insert a literal percent sign with the format function you need to use '%%', e.g.

pawn Код:
format(countstr, sizeof(countstr), "%d%%", percent);
Reply
#3

I did some testing. It works in client messages.
pawn Код:
SendClientMessage(playerid, -1, "The script is 40%% complete.");
// Shows in-game as: The script is 40% complete.
Reply
#4

Код:
public OnPlayerText(playerid, text[])
{
  new perstring[128], PlayerNM[MAX_PLAYER_NAME];
  GetPlayerName(playerid, PlayerNM, sizeof(PlayerNM));
  for(new percentsign; percentsign < 256; percentsign++)
  {
    if(text[percentsign] == '%') text[percentsign] = '%%';
  }
  format(perstring, sizeof(perstring), "%s: %s", PlayerNM, text);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)