SendClientMessageToAll?!
#1

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

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

Thank you.
Reply
#4

What about if i want the player's color to show up? were the %s is?
Reply
#5

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!
Reply
#6

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

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
Use GetPlayerColor and convert the colour to a 6-digit hex. (find a way to remove '0x' and 'FF' from '0x8A2CD7FF')



That code is incorrect. You should avoid from posting if you have no idea of what you're talking about.
It was something like this
pawn Код:
GetPlayerColor(playerid) <<< 8
Reply
#8

Ok thanks for the help calg00ne. fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)