SA-MP Forums Archive
Name help. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Name help. (/showthread.php?tid=270238)



Name help. - iGetty - 19.07.2011

pawn Код:
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;
}
How can I do that with instead of (playerid) to (id)?


Re: Name help. - shaikh007 - 19.07.2011

try this may be it work
pawn Код:
stock RemoveUnderScore(playerid)
{
    new name[MAX_PLAYER_NAME];
    playerid = id
    GetPlayerName(id,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}



Re: Name help. - XGh0stz - 19.07.2011

Код:
stock RemoveUnderScore(id) {    
new name[MAX_PLAYER_NAME];
GetPlayerName(id,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++) {        
if(name[i] == '_') {
name[i] = ' '; }
}
return
name;}
I might not be understanding you correctly, but it's as simple as changing playerid to id
(Dont forget to change playerid to id in the Forward as well...)

Example usage
Код:
OnPlayerConnect(playerid) { 
RemoveUnderScore(playerid);
return 1; }



Re: Name help. - Amit_B - 19.07.2011

What ecaxtly is the problem with the current function?
If you wan't to replace the playerid to id, just select them at the function and rewrite.
The #2's above will get nothing except of error.