Posts: 186
Threads: 50
Joined: Jul 2011
Reputation:
0
Hello i have made a taxi script and i need to know how to do this, = Just after a player has taxi'd somewere i want it to say Player (players name here) Has taken a taxi to (location here) I forgot the function what includes the players name, help please?
Posts: 6,129
Threads: 36
Joined: Jan 2009
GetPlayerName gets the name of a player and SendClientMessageToAll sends a message string to all players on the server.
pawn Код:
new szPlayerName[MAX_PLAYER_NAME], szMessage[74];
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "%s has taken a taxi to location [insert location].", szPlayerName);
SendClientMessageToAll(0, szMessage); // Replace 0 with the colour
Posts: 186
Threads: 50
Joined: Jul 2011
Reputation:
0
What about if i want the player's color to show up? were the %s is?
Posts: 6,129
Threads: 36
Joined: Jan 2009
Use
GetPlayerColor and convert the colour to a 6-digit hex. (find a way to remove '0x' and 'FF' from '0x8A2CD7FF')
Quote:
Originally Posted by samtey
pawn Код:
format(szMessage, sizeof(szMessage), " "COLOR,%s" has taken a taxi to location [insert location].", szPlayerName);
Somehow like this, I think! Check also your SetPlayerColor!
|
That code is incorrect. You should avoid from posting if you have no idea of what you're talking about.
Posts: 186
Threads: 50
Joined: Jul 2011
Reputation:
0
Ok thanks for the help calg00ne. fixed it