How to remove the "_" from all the server messages - 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)
+--- Thread: How to remove the "_" from all the server messages (
/showthread.php?tid=453417)
How to remove the "_" from all the server messages -
alanhutch - 24.07.2013
Hello to all! I wanted to know how I could remove all the '_' in the names of the server! Doing it manually raising all 'SenderName' and so it would be impossible for me, since I have a gamemode that has more than 150 thousand lines. I already tried with a GetPlayerRPName, but I do not work. How can I do? Sorry my bad English.
Here's the GetPlayerRPName...
pawn Код:
stock GetPlayerRPName( playerid, name[ ], len )
{
GetPlayerName( playerid, name, len );
for(new i = 0; i < len; i++ )
{
if ( name[ i ] == '_' )
name[ i ] = ' ';
}
}
Thanks.
Re : How to remove the "_" from all the server messages -
Matnix - 24.07.2013
try :
pawn Код:
stock space (string[], find, space)
{
for(new i=0; string[i]; i++)
{
if(string[i] == find)
{
string[i] = space;
}
}
}
// on player text
new name[24];
GetPlayerName(playerid, name, sizeof(name));
space(name, '_', ' ');
Re: Re : How to remove the "_" from all the server messages -
alanhutch - 24.07.2013
Quote:
Originally Posted by Matnix
try :
pawn Код:
stock space (string[], find, space) { for(new i=0; string[i]; i++) { if(string[i] == find) { string[i] = space; } } }
// on player text new name[24]; GetPlayerName(playerid, name, sizeof(name)); space(name, '_', ' ');
|
However I have to do everything manually!
Re: How to remove the "_" from all the server messages -
Boolean - 24.07.2013
pawn Код:
stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
// EXAMPLE
COMMAND:name(playerid, params[])
{
new
player, pMessage[100];
if(sscanf(params, "u", player)) return SendClientMessage(playerid, -1, "Parameters: /name (playerid)");
format(pMessage, sizeof(pMessage), "playername: %s", GetName(player));
SendClientMessage(playerid, -1, pMessage);
format(pMessage, sizeof(pMessage), "%s just checked your name.", GetName(playerid));
SendClientMessage(player, -1, pMessage);
return true;
}
Re: How to remove the "_" from all the server messages -
alanhutch - 24.07.2013
Quote:
Originally Posted by Boolean
pawn Код:
stock GetName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); for(new i = 0; i < MAX_PLAYER_NAME; i++) { if(name[i] == '_') name[i] = ' '; } return name; }
// EXAMPLE
COMMAND:name(playerid, params[]) { new player, pMessage[100]; if(sscanf(params, "u", player)) return SendClientMessage(playerid, -1, "Parameters: /name (playerid)"); format(pMessage, sizeof(pMessage), "playername: %s", GetName(player)); SendClientMessage(playerid, -1, pMessage); format(pMessage, sizeof(pMessage), "%s just checked your name.", GetName(playerid)); SendClientMessage(player, -1, pMessage); return true; }
|
So I have to manually change all the "SenderName" and "giveplayername" and it's very long! How do I replace them maybe changing the GetPlayerName in GetPlayerRPName and I substitute the name only from GetPlayerName to GetPlayerRPName?
Re: How to remove the "_" from all the server messages -
alanhutch - 24.07.2013
Resolved... Close please!
)