variable+enum question
#1

Just wondering if I can do something like this: (trying to spend less time on setting every single variable in pInfo to 0, seeing if I can do it with a loop.)
pawn Код:
enum pInfo
{
    pVar1,
    pVar2,
    pVar3
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
    for(new i = 0; i < sizeof(PlayerInfo); i++) // Would I use sizeof(PlayerInfo) or sizeof(pInfo)?
    {
        PlayerInfo[playerid][i] = 0; // Will set pVar1, pVar2, and pVar3 to 0.
    }
    return 1;
}
Reply
#2

I think it should work, why dont you test it ?
Reply
#3

I've tested and neither of them worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)