SA-MP Forums Archive
string - 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: string (/showthread.php?tid=474297)



string - Ananisiki - 07.11.2013

^^^^^^^^


Re: string - Konstantinos - 07.11.2013

If PlayerName returns the name, then:
pawn Код:
format(string, sizeof (string), "%s (%d)", PlayerName(playerid), playerid);
It'll be: "Ananisiki (0)"

* The ID is 0 into parenteses.


Re: string - SAMProductions - 07.11.2013

Try This :-

pawn Код:
format(string, sizeof(string), "%s (ID: %d)", PlayerName(playerid), playerid;
TextDrawSetString(Textdraw1, string);
EDIT :-
Konstantino is more Faster than me


Re: string - Ananisiki - 07.11.2013

^^^^^^^^


Re: string - SAMProductions - 07.11.2013

You mean GameTextForPlayer ?

Shows the Message at the Middle,

If yes;

Try This:
pawn Код:
new gstrings[128];
        format(gstrings, sizeof(gstrings), "~r~%s ~w~(ID: ~r~%d~w~)", PlayerName(playerid), playerid);
        GameTextForPlayer(playerid, gstrings, 5000, 5);
or This:
pawn Код:
new gstrings[128];
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(gstrings, sizeof(gstrings), "~r~%s ~w~(ID: ~r~%d~w~)", pName, playerid);
        GameTextForPlayer(playerid, gstrings, 5000, 5);