help - 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: help (
/showthread.php?tid=224427)
help -
[M.A]Angel[M.A] - 11.02.2011
I need when someone join my server to get his name with colorname so
*** //GetPlayerColour %s has joined the server
I know how to put colors btw i need how to get Player color so if player colour is green like that when join:
*** %s has joined the server
If red
*** %s has joined the server
---------------
*** Boom[xXx] has joined the server
Ban(playerid);
hahaha
---------------
Thanks !
Re: help -
Stigg - 11.02.2011
Hear you go.
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has joined the server", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
Peace...
Re: help -
[M.A]Angel[M.A] - 11.02.2011
Quote:
Originally Posted by Stigg
Hear you go.
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has joined the server", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
Peace...
|
Thanks , btw i need to "GetPlayerColour" not name only so if green say {GREEN}%s
Re: help -
admantis - 11.02.2011
Quote:
Originally Posted by Stigg
Hear you go.
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has joined the server", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
Peace...
|
Learn to read
Re: help -
Ash. - 11.02.2011
Im not too sure how you would do this, because ive never tried, but from experiences with format(..) i would try;
pawn Код:
public OnPlayerConnect(playerid)
{
//Remeber you need to do SetPlayerColour before GetPlayerColour can be used.
new string[128], pName[24], colour[30];
format(colour, sizeof(colour), "%x", GetPlayerColor(playerid));
strdel(colour, 4, strlen(colour));
GetPlayerName(playerid, pName, 24);
format(string, sizeof(string), "{%x}%s {FFFFFF} has joined SERVER NAME", colour, pName);
SendClientMessageToAll(0xFFFFFFFF, string);
return 1;
}
Just give it a try, to be honest i doubt it will work because ive never tried passing hexadecimal in a string before.
Re: help -
[M.A]Angel[M.A] - 12.02.2011
Quote:
Originally Posted by funky1234
Im not too sure how you would do this, because ive never tried, but from experiences with format(..) i would try;
pawn Код:
public OnPlayerConnect(playerid) { //Remeber you need to do SetPlayerColour before GetPlayerColour can be used. new string[128], pName[24], colour[30]; format(colour, sizeof(colour), "%x", GetPlayerColor(playerid)); strdel(colour, 4, strlen(colour)); GetPlayerName(playerid, pName, 24); format(string, sizeof(string), "{%x}%s {FFFFFF} has joined SERVER NAME", colour, pName); SendClientMessageToAll(0xFFFFFFFF, string); return 1; }
Just give it a try, to be honest i doubt it will work because ive never tried passing hexadecimal in a string before.
|
Thanks for help , but i keeping failed
i dont know if there are script colors i only know when someone teleport to:
"
Boom[xXx] has gone to [ /AA ]"
"
Example has gone to [/AA]"