#1

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

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

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

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

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

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]"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)