Reset array data
#1

Hi!

My array is defined with:
pawn Код:
enum PlayerData
{
pString[64],
bool: pLogged,
pTime,
.
.
.
}
new Player[MAX_PLAYERS][PlayerData];
When player disconnect, I want to reset the Player[playerid] array to default values.

The following code does NOT work.
pawn Код:
for(new i;i < sizeof(PlayerData);i++)
{
Player[playerid][i] = 0;
}
How can I do this?
Reply
#2

Код:
for(new i;i < sizeof(PlayerData);i++)
{
Player[playerid][i] = --;
}
Try this
Reply
#3

We can try this code:

pawn Код:
for(new j = 0; j < sizeof(Player); j++)
{
    Player[playerid][PlayerData:j] = 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)