messages -
sk1llz - 07.02.2009
default server messages are:
sk1llz: bla bla bla bla
but i need this:
sk1llz[ID
?]: bla bla bla bla
Re: messages -
Marcel - 07.02.2009
http://forum.sa-mp.com/index.php?topic=86712
Re: messages -
sk1llz - 07.02.2009
Quote:
Originally Posted by Marcel
|
message looks like:
sk1llz: (0) bla bla bla bla
i need like this:
sk1llz[ID: 0]: bla bla bla bla
Re: messages -
ICECOLDKILLAK8 - 07.02.2009
Then change the string round lol
Re: messages -
sk1llz - 07.02.2009
Quote:
Originally Posted by JeNkStAX
Then change the string round lol
|
i don't understand you :P
my english is bad :P
Re: messages -
ICECOLDKILLAK8 - 07.02.2009
Post your code
Re: messages -
sk1llz - 07.02.2009
Quote:
Originally Posted by JeNkStAX
Post your code
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
Re: messages -
ICECOLDKILLAK8 - 07.02.2009
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s [ID:%d]: %s",playername,playerid,text);
SendClientMessageToAll(COLOR_w/e, string);
return 0;
}
Re: messages -
brett7 - 07.02.2009
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[256];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s (ID:%d): %s",playername,playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
this works i think
edit: jenkstar got there first
Re: messages -
ICECOLDKILLAK8 - 07.02.2009
Quote:
Originally Posted by brett7
pawn Код:
public OnPlayerText(playerid, text[]) { new string[256]; new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string), "%s (ID:%d): %s",playername,playerid,text); SendPlayerMessageToAll(playerid,string); return 0; }
this works i think
|
Did you look at his code, He had
pawn Код:
SendPlayerMessageToAll(playerid, string);
which is wrong, Also you only need
not
Use my code not this
Re: messages -
pspleo - 07.02.2009
Quote:
Originally Posted by sk1llz
Quote:
Originally Posted by JeNkStAX
Post your code
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128], pName[24];
GetPlayerName(playerid, pName, 24); //gets player name
format(string, sizeof(string), "%s [ID: %d]",pName, playerid); //formats name ("Leopard [ID: 0]")
SetPlayerName(playerid, string);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid, pName); //sets player name back to original
return 0;
}
brett7's and Jenksta's code will output: "Leopard: Leopard(ID: 0) <text>"
Mine will probably do what you want.
Re: messages -
ICECOLDKILLAK8 - 07.02.2009
Quote:
Originally Posted by [K4L
Leopard ]
Quote:
Originally Posted by sk1llz
Quote:
Originally Posted by JeNkStAX
Post your code
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128], pName[24];
GetPlayerName(playerid, pName, 24); //gets player name
format(string, sizeof(string), "%s [ID: %d]",pName, playerid); //formats name ("Leopard [ID: 0]")
SetPlayerName(playerid, string);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid, pName); //sets player name back to original
return 0;
}
brett7's and Jenksta's code will output: "Leopard: Leopard(ID: 0) <text>"
Mine will probably do what you want.
|
No it wont lol, If you return 0; then it will cancel out everything automaticlly, Use my code, It will work
Re: messages -
brett7 - 07.02.2009
actually jenksta the code i put is copied from a post you made in another thread so actually you got it wrong twice
Re: messages -
pspleo - 07.02.2009
Quote:
Originally Posted by JeNkStAX
Quote:
Originally Posted by [K4L
Leopard ]
Quote:
Originally Posted by sk1llz
Quote:
Originally Posted by JeNkStAX
Post your code
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128], pName[24];
GetPlayerName(playerid, pName, 24); //gets player name
format(string, sizeof(string), "%s [ID: %d]",pName, playerid); //formats name ("Leopard [ID: 0]")
SetPlayerName(playerid, string);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid, pName); //sets player name back to original
return 0;
}
brett7's and Jenksta's code will output: "Leopard: Leopard(ID: 0) <text>"
Mine will probably do what you want.
|
No it wont lol, If you return 0; then it will cancel out everything automaticlly, Use my code, It will work
|
Well, no it won't, afaik. It will only cancel the original text output (the text showing by sa-mp core) but it won't stop SendPlayerMessageToAll.
Re: messages -
Nimphious - 07.02.2009
Quote:
Originally Posted by [K4L
Leopard ]
Quote:
Originally Posted by sk1llz
Quote:
Originally Posted by JeNkStAX
Post your code
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128], pName[24];
GetPlayerName(playerid, pName, 24); //gets player name
format(string, sizeof(string), "%s [ID: %d]",pName, playerid); //formats name ("Leopard [ID: 0]")
SetPlayerName(playerid, string);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid, pName); //sets player name back to original
return 0;
}
brett7's and Jenksta's code will output: "Leopard: Leopard(ID: 0) <text>"
Mine will probably do what you want.
|
Yours won't work.
Re: messages -
pspleo - 07.02.2009
Quote:
Originally Posted by (FF)TeddyBear
Quote:
Originally Posted by [K4L
Leopard ]
Quote:
Originally Posted by sk1llz
Quote:
Originally Posted by JeNkStAX
Post your code
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128], pName[24];
GetPlayerName(playerid, pName, 24); //gets player name
format(string, sizeof(string), "%s [ID: %d]",pName, playerid); //formats name ("Leopard [ID: 0]")
SetPlayerName(playerid, string);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid, pName); //sets player name back to original
return 0;
}
brett7's and Jenksta's code will output: "Leopard: Leopard(ID: 0) <text>"
Mine will probably do what you want.
|
Yours won't work.
|
Why? give reasons why it won't work. I'm pretty sure it will.
Also he said
Quote:
Originally Posted by sk1llz
default server messages are:
sk1llz: bla bla bla bla
but i need this:
sk1llz[ID:??]: bla bla bla bla
|
Notice he want the id BEFORE the colons (:)
Re: messages -
Nimphious - 07.02.2009
Quote:
Originally Posted by [K4L
Leopard ]
Quote:
Originally Posted by (FF)TeddyBear
Quote:
Originally Posted by [K4L
Leopard ]
Quote:
Originally Posted by sk1llz
Quote:
Originally Posted by JeNkStAX
Post your code
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
|
Код:
public OnPlayerText(playerid, text[])
{
new string[128], pName[24];
GetPlayerName(playerid, pName, 24); //gets player name
format(string, sizeof(string), "%s [ID: %d]",pName, playerid); //formats name ("Leopard [ID: 0]")
SetPlayerName(playerid, string);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid, pName); //sets player name back to original
return 0;
}
brett7's and Jenksta's code will output: "Leopard: Leopard(ID: 0) <text>"
Mine will probably do what you want.
|
Yours won't work.
|
Why? give reasons why it won't work. I'm pretty sure it will.
Also he said
Quote:
Originally Posted by sk1llz
default server messages are:
sk1llz: bla bla bla bla
but i need this:
sk1llz[ID ?]: bla bla bla bla
|
Notice he want the id BEFORE the colons (
|
Well I gave your one a try cuz im bored, and the output would be like so,
[FF]TeddyBear: ahem
[FF]TeddyBear: ahem
Comes out twice, no id in the name.
Also jenksta's or whoevers comes out like so,
[FF]TeddyBear: Ahem
[FF]TeddyBear:[0] Ahem
Does the id this time but repeats the sentence twice in the chat.
Re: messages -
sk1llz - 07.02.2009
jenkstax,
SendClientMessageToAll(COLOR_w/e, string);
COLOR_w/e what is this ?=)
Re: messages -
brett7 - 07.02.2009
Quote:
Originally Posted by sk1llz
jenkstax,
SendClientMessageToAll(COLOR_w/e, string);
COLOR_w/e what is this ?=)
|
he means what ever colour you like
Re: messages -
ICECOLDKILLAK8 - 07.02.2009
Replace that with your color lol,
BTW, My code outputs: