Name problem - 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: Name problem (
/showthread.php?tid=479681)
Name problem -
OnY - 06.12.2013
Hello...
I have a roleplay server with name : Lastname_Firstname..
But,when i type /me and /do or at any roleplay the name appear with "_"
Example :
((/me))
John_Koperfield extends his hand...
That _ i don`t want to appear at roleplay...
Look here :
See there ? I don`t want that underline appear there at /me and /do
Re: Name problem -
fordawinzz - 06.12.2013
pawn Код:
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof szName);
szName[strfind(szName, "_")] = ' ';
Re: Name problem -
OnY - 06.12.2013
Don`t working...I want to keep RP name but i don`t want to appear that underline at /me and /do
Re: Name problem -
Audi_Quattrix - 06.12.2013
Use it in your command i guess
Re: Name problem -
OnY - 06.12.2013
No...this underline it`s on all commands[RP commands]...
Re: Name problem -
xVIP3Rx - 06.12.2013
Post /me or /do command And I'll edit it for you..
Re: Name problem -
arakuta - 06.12.2013
It's simple, you can get player name and clean player name once, then just call it.
pawn Код:
new pName[MAX_PLAYERS][24];
new cName[MAX_PLAYERS][24];
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid,pName[playerid],24);
ClearName(playerid);
// Other shit
return 1;
}
stock ClearName(playerid)
{
cName[playerid] = pName[playerid];
new pos = strfind(pName[playerid],"_");
if(pos != -1)
cName[playerid][pos] = 32;
}
// Now you can use pName[playerid] to get a player name
// And you also can use cName[playerid] to get his name without underlines.
// example
CMD:example(playerid)
{
printf("Player Name: %s | Clean Name: %s",pName[playerid],cName[playerid]);
return 1;
}
Fast and easy, just have to get and clean name once, making your server a little faster ^^
@edit
Sorry, removed an unnecessary placeholder.
Re: Name problem -
Audi_Quattrix - 06.12.2013
pawn Код:
CMD:example(playerid)
{
printf("Player Name: %s | Clean Name: %s",pName[playerid],cName[playerid]); //Your example was wrong :D
return 1;
}