Question? - 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: Question? (
/showthread.php?tid=261761)
Question? -
GeonMake - 14.06.2011
_ hidden in as chat?
Re: Question? -
jot16 - 14.06.2011
what's your question?
Re: Question? -
Scenario - 15.06.2011
You should rephrase your question because it doesn't make sense buddy.
Re: Question? -
GeonMake - 15.06.2011
I made my server but I want to be just firstname_lastname I write in chat does not appear to occur only _ no _ LastName Firstname
sorry for my bad english
i ussing ****** translate
Re: Question? -
Scenario - 15.06.2011
Okay, so you need a function which removes the underscore from a role play name properly? That's easy...
pawn Код:
stock GetNameEx(playerid)
{
new str[24], String[128];
GetPlayerName(playerid, String, 24);
strmid(str, String, 0, strlen(String), 24);
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if (str[i] == '_') str[i] = ' ';
}
return str;
}
Re: Question? -
GeonMake - 15.06.2011
I added this but will not erase _ in chat: (
Re: Question? -
Scenario - 15.06.2011
Quote:
Originally Posted by GeonMake
I added this but will not erase _ in chat: (
|
Adding this does absolutely nothing. Adding it and using the function will remove the underscore (i.e. you can't use "SendPlayerMessage" because it doesn't know you want to remove the underscore).
Re: Question? -
GeonMake - 15.06.2011
So that adds functionality to the end and after the gamemode should add?
Re: Question? -
Sasino97 - 15.06.2011
Put that at the end:
pawn Код:
stock GetNameEx(playerid)
{
new str[24], String[128];
GetPlayerName(playerid, String, 24);
strmid(str, String, 0, strlen(String), 24);
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if (str[i] == '_') str[i] = ' ';
}
return str;
}
and that under OnPlayerText
pawn Код:
new name[24];
name = GetNameEx(playerid);
new string[128];
format(string,sizeof(string),"%s: {FFFFFF}%s", name, text);
return SendClientMessageToAll(GetPlayerColor(playerid), string), 0;
Re: Question? -
GeonMake - 15.06.2011
Quote:
Originally Posted by [GF]Sasino97
Put that at the end:
pawn Код:
stock GetNameEx(playerid) { new str[24], String[128]; GetPlayerName(playerid, String, 24); strmid(str, String, 0, strlen(String), 24); for(new i = 0; i < MAX_PLAYER_NAME; i++) { if (str[i] == '_') str[i] = ' '; } return str; }
and that under OnPlayerText
pawn Код:
new name[24]; name = GetNameEx(playerid); new string[128]; format(string,sizeof(string),"%s: {FFFFFF}%s", name, text); return SendClientMessageToAll(GetPlayerColor(playerid), string), 0;
|
Thanks goes