How i can remove the "_"
#1

Hello,

So I am currently editing LARP and i want to remove "_" from all the chats and whereever the names are used.
How could i remove the "_" (If you don't understand what i mean this is an example:
James_Cool says ,without "_" it should be James Cool says: )
Reply
#2

I think LA-RP gamemode has an PlayerNameEx function which cuts the _ from player's name.
Reply
#3

LARP doesn't have PlayerNameEx...
Reply
#4

pawn Код:
stock GetPlayerNameEx(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  new str[MAX_PLAYER_NAME];
  strmid(str, name, 0, strlen(name), MAX_PLAYER_NAME);
  for(new i = 0; i < MAX_PLAYER_NAME; i++)
  {
    if (str[i] == '_') str[i] = ' ';
  }
  return str;
}
I found it somewhere on this forum and just copy pasted it.
Reply
#5

Quote:
Originally Posted by SpiderPork
pawn Код:
stock GetPlayerNameEx(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  new str[MAX_PLAYER_NAME];
  strmid(str, name, 0, strlen(name), MAX_PLAYER_NAME);
  for(new i = 0; i < MAX_PLAYER_NAME; i++)
  {
    if (str[i] == '_') str[i] = ' ';
  }
  return str;
}
I found it somewhere on this forum and just copy pasted it.
Thank you very much,it works .
Nice only one problem:

C:\Documents and Settings\Owner\Desktop\arp.pwn(20332) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Owner\Desktop\arp.pwn(20332) : warning 202: number of arguments does not match definition

Line 20332: GetPlayerNameEx(playerid, sendername, sizeof(sendername));
Reply
#6

You shouldn't use GetPlayerNameEx like GetPlayerName function. Just use it like GetPlayerNameEx(playerid), ..
Reply
#7

Thank you guys
Reply
#8

Quote:
Originally Posted by Don Correlli
You shouldn't use GetPlayerNameEx like GetPlayerName function. Just use it like GetPlayerNameEx(playerid), ..
I used the GetPlayerNameEx(playerid); and then i tryed and it was like:

[ID:0] says: (Not Name_Name [ID:0] says
Reply
#9

Bring
My
Post
Up
Reply
#10

B
U
M
P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)