How to do this?
#1

Hehy I got this
new pStats[MAX_PLAYERS][Player] (Player is the enum)
How I can set all those things to 0 for a player when he connect?
Something like:
for(new i=0; i<sizeof(pStats); i++) { pStats[playerid][i] = 0; }
but that doesn't work.
Reply
#2

Код:
OnPlayerConnect(playerid)
{
pStats[playerid][Level] = 0; // Level is just an example
return 1;
}
Reply
#3

Quote:
Originally Posted by Etch ❽ H
Код:
OnPlayerConnect(playerid)
{
pStats[playerid][Level] = 0; // Level is just an example
return 1;
}
Nah I want to set all of them to 0 in once. Not with 50 lines.
Reply
#4

Quote:

for(new i=0; i<sizeof(pStats); i++) { pStats[playerid] = 0; }

simply use "i" instead of "playerid"
Reply
#5

Quote:
Originally Posted by MyName?
Quote:
Originally Posted by Etch ❽ H
Код:
OnPlayerConnect(playerid)
{
pStats[playerid][Level] = 0; // Level is just an example
return 1;
}
Nah I want to set all of them to 0 in once. Not with 50 lines.
You will need 50 lines then or use PVars which are reset automatically.

Quote:
Originally Posted by Cank
Quote:

for(new i=0; i<sizeof(pStats); i++) { pStats[playerid] = 0; }

simply use "i" instead of "playerid"
Fail
Reply
#6

Quote:
Originally Posted by $ЂЯĢ
Quote:
Originally Posted by MyName?
Quote:
Originally Posted by Etch ❽ H
Код:
OnPlayerConnect(playerid)
{
pStats[playerid][Level] = 0; // Level is just an example
return 1;
}
Nah I want to set all of them to 0 in once. Not with 50 lines.
You will need 50 lines then or use PVars which are reset automatically.

Quote:
Originally Posted by Cank
Quote:

for(new i=0; i<sizeof(pStats); i++) { pStats[playerid] = 0; }

simply use "i" instead of "playerid"
Fail
yea thats fail.
Never mind I already use the 50 lines. Who cares
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)