SA-MP Forums Archive
SendClientMessageToAll?! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SendClientMessageToAll?! (/showthread.php?tid=273645)



SendClientMessageToAll?! - ServerRestart - 02.08.2011

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?


Re: SendClientMessageToAll?! - Calgon - 02.08.2011

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



Re: SendClientMessageToAll?! - ServerRestart - 02.08.2011

Thank you.


Re: SendClientMessageToAll?! - ServerRestart - 02.08.2011

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


AW: SendClientMessageToAll?! - samtey - 02.08.2011

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!


Re: SendClientMessageToAll?! - Calgon - 02.08.2011

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.


Re: SendClientMessageToAll?! - Zh3r0 - 02.08.2011

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



Re: SendClientMessageToAll?! - ServerRestart - 02.08.2011

Ok thanks for the help calg00ne. fixed it