SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 13/03/2020, 12:57 AM   #1
Saik
Big Clucker
 
Join Date: Sep 2018
Posts: 89
Reputation: 6
Default Remover "_" do nick.

Opa, estou quebrando a cabeça mas não consigo pensar em um modo de remover "_" que tiverem no nick do jogador tanto no chat como acima da cabeça, alguém poderia me dar uma luz?
__________________
Saik is offline   Reply With Quote
Old 13/03/2020, 01:27 AM   #2
Khivory
Huge Clucker
 
Khivory's Avatar
 
Join Date: Feb 2020
Posts: 221
Reputation: 16
Default Re: Remover "_" do nick.

PHP Code:
new stringPos strfind(Nick"_");
strdel(NickstringPosstringPos 1); 
Khivory is offline   Reply With Quote
Old 13/03/2020, 11:52 AM   #3
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,532
Reputation: 328
Default Re: Remover "_" do nick.

pawn Code:
stock RemoveUnderScore(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;
}

stock GetPlayerFirstName(playerid)
{
    new name[MAX_PLAYER_NAME], find, length, shortname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    find = strfind(name,"_",false);
    length = strlen(name);
    format(shortname,sizeof(shortname),"%s",strdel(name,find,length));
    return shortname;
}

stock GetPlayerLastName(playerid)
{
    new name[MAX_PLAYER_NAME], find, shortname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    find = strfind(name,"_",false);
    format(shortname,sizeof(shortname),"%s",strdel(name,0,find));
    return shortname;
}

Nome = "Luan_Argolo";
RemoveUnderScore = "Luan Argolo";
GetPlayerFirstName = "Luan";
GetPlayerLastName = "Argolo";

Há vários jeitos de fazer isso...
__________________
Precisando de algum sistema? Me contate.
ipsLuan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Remover "_" e cor do nick ao digitar. rolex Português/Portuguese 7 10/05/2017 03:52 PM
[Ajuda] "Remover" radios nativas do GTA kreison Português/Portuguese 5 07/11/2013 01:23 PM
[Ajuda] Remover a "«" , "»" e "Spawn" noobre Português/Portuguese 9 28/06/2012 07:34 PM
[Problem] y_stringhash + command change nick to "setnick"... Dystans Scripting Help 0 27/05/2012 10:01 AM


All times are GMT. The time now is 08:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.