Returning string of enum
#4

pawn Код:
enum a {
    str[MAX_PLAYER_NAME];
}

new array[MAX_PLAYERS][a];

public OnPlayerConnect(playerid) {
    GetPlayerName(playerid, array[playerid][str], MAX_PLAYER_NAME);
}

returnPlayerName(playerid) {
    new name[MAX_PLAYER_NAME];
    format(name, sizeof(name), "%s", array[playerid][str]);
    return name;
}
That would work but creating another variable is a waste of resources - how can I do it without that variable?
Reply


Messages In This Thread
Returning string of enum - by hiok - 03.08.2013, 11:06
Re: Returning string of enum - by Konstantinos - 03.08.2013, 11:11
Re: Returning string of enum - by hiok - 03.08.2013, 11:14
Re: Returning string of enum - by hiok - 03.08.2013, 11:47
Re: Returning string of enum - by Edix - 03.08.2013, 11:55
Re: Returning string of enum - by hiok - 03.08.2013, 12:52
Re: Returning string of enum - by Edix - 03.08.2013, 14:08
Re: Returning string of enum - by hiok - 04.08.2013, 13:22
Re: Returning string of enum - by RajatPawar - 04.08.2013, 13:34
Re: Returning string of enum - by hiok - 04.08.2013, 14:51

Forum Jump:


Users browsing this thread: 2 Guest(s)