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=206778)
SendClientMessageToAll -
ZaaRawwR - 04.01.2011
Ok, so when someone logs in, I want to send a message to everyone saying that person logged in. Do I use SendClientMessageToAll? How do I do it?
By the way.. I'm making my first GM, so don't call me a noob : D
Re: SendClientMessageToAll -
MrDeath537 - 04.01.2011
pawn Код:
new
szDest[128];
GetPlayerName(playerid, szDest, sizeof (szDest));
format(szDest, sizeof (szDest), "** %s logged in", szDest);
SendClientMessageToAll(0x00FF00FF, szDest);
Re: SendClientMessageToAll -
Kwarde - 04.01.2011
SendClientMessageToAll(color, message[]);
EDIT:
Too late
Re: SendClientMessageToAll -
ZaaRawwR - 04.01.2011
Quote:
Originally Posted by MrDeath
pawn Код:
new szDest[128]; GetPlayerName(playerid, szDest, sizeof (szDest)); format(szDest, sizeof (szDest), "** %s logged in", szDest); SendClientMessageToAll(0x00FF00FF, szDest);
|
In which section do I put this is? OnPlayerConnect?
Re: SendClientMessageToAll -
Sway - 04.01.2011
https://sampwiki.blast.hk/wiki/Creating_...Leave_Messages
Re: SendClientMessageToAll -
Kwarde - 04.01.2011
Quote:
Originally Posted by ZaaRawwR
In which section do I put this is? OnPlayerConnect?
|
On the part where the player login
Re: SendClientMessageToAll -
Sascha - 04.01.2011
in your case at OnPlayerConnect, as I doubt you already have a login system
Re: SendClientMessageToAll -
ZaaRawwR - 05.01.2011
Quote:
Originally Posted by Sascha
in your case at OnPlayerConnect, as I doubt you already have a login system
|
What if I do already have one?
Re: SendClientMessageToAll -
John_F - 05.01.2011
Put it under OnPlayerConnect then try it out, it should work fine.
Also, you can use a similar code for OnPlayerDisconnect, just edit the string.
If you want to say when someone has LOGGED IN, as in, they have entered their password, put the same code, but in the place where the other things happen when a player logs in (in other words, depends on the type of login system you are using and such)
Re: SendClientMessageToAll -
[BFT]eagles22 - 05.01.2011
pawn Код:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "**%s connected**", name);
SendClientMessageToAll(0x00FF00FF, string);
return 1;
}
that should work, just edit the string to say what you want it to say, just remember the %s is the player's name.