Name help.
#1

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)?
Reply
#2

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;
}
Reply
#3

Код:
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; }
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)