Creating a stock to return file path of a users account, better ways? [REP++]
#1

Alright so far this is what I have.

pawn Код:
stock GetAccountPath(playerid)
{
    new Player[25];
    new AccountName[50];

    GetPlayerName(playerid, Player, sizeof(Player) );
    format(AccountName,sizeof(AccountName),"\\Accounts\\%s.ini", Player);
   
    return AccountName;
}
and I have to call it like so.

pawn Код:
new File[50];
    format(File,sizeof(File),"%s",GetAccountPath(playerid) );

now I haven't been around for a while but I am pretty sure there's a much simpler way I've missed, like being able to return the value without having to format it into another string.
Reply
#2

Why do you even need the file variable / format? Just use GetAccountPath(playerid) directly.
Reply
#3

Because with like, 15 variables, I'd rather see (File,"Money") instead of GetAccountPath(playerid) each time.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)