[Tutorial] Deleting the '_' in RP names.
#3

So i think then the command could be like this:

pawn Код:
if(strcmp(cmdtext, "/showmyname", true) == 0)
{
    new name[MAX_PLAYER_NAME, str[64];
    GetPlayerName(playerid, name, sizeof(name));
    if(strfind(name,"_",true) == -1)return SendClientMessage(playerid,0xFF0000FF,"Your name must include an underscore for this command to work. Ex Ihsan_Cingisiz");
    name[strfind(name,"_")] = ' ';
    format(str, sizeof(str), "Your name is: %s", name);
    SendClientMessage(playerid, 0xFFFFFFFF, str);
    return 1;
}
I am not good at strfind, i only used it twice in my server for restricting players to deposit or withdraw negative cash from bank.

Not tested.
Reply


Messages In This Thread
Deleting the '_' in RP names. - by Ihsan-Cingisiz - 30.01.2011, 20:18
Re: Deleting the '_' in RP names. - by Vince - 30.01.2011, 22:28
Re: Deleting the '_' in RP names. - by Tee - 30.01.2011, 22:39
Re: Deleting the '_' in RP names. - by Ihsan-Cingisiz - 31.01.2011, 06:14
Re: Deleting the '_' in RP names. - by Ihsan-Cingisiz - 31.01.2011, 06:15
Re: Deleting the '_' in RP names. - by leong124 - 31.01.2011, 07:23
Re: Deleting the '_' in RP names. - by bartje01 - 31.01.2011, 18:51
Re: Deleting the '_' in RP names. - by Vince - 31.01.2011, 20:30
Re: Deleting the '_' in RP names. - by Tee - 01.02.2011, 00:31
Respuesta: Deleting the '_' in RP names. - by ipsBruno - 01.02.2011, 14:29
Re: Deleting the '_' in RP names. - by Sergei - 01.02.2011, 18:14
Re: Deleting the '_' in RP names. - by Derezzed - 03.02.2011, 15:58
Re: Deleting the '_' in RP names. - by Shadow_ - 09.02.2011, 19:47
Re: Deleting the '_' in RP names. - by Krx17 - 10.02.2011, 02:16

Forum Jump:


Users browsing this thread: 1 Guest(s)