05.04.2009, 12:26
Hello, I am currently working on a TDM mode and I want to make a PlayerInfo variable to store data as admin level and such... well I succedd stroing admin levels but when I try to store data as team name or something like that I get errors...
this is what i've done:
enum pInfo {
admin,
level,
kills,
team[256]
};
new PlayerInfo[MAX_PLAYERS][pInfo];
---------
but when I try to do:
PlayerInfo[playerid][team] = "none";
for example, I get some errors like array sizes does not much and more....
someone gave me the following code to write in this variable that works:
strmid(PlayerInfo[playerid][team], "none", 0, strlen("none"), 256);
but when I try to read:
if (PlayerInfo[playerid][team] = "agent") { AgentRandomSpawnPlayer(playerid); }
I get these errors:
warning 211: possibly unintended assignment
error 047: array sizes do not match, or destination array is too small
someone knows what's the problem?
this is what i've done:
enum pInfo {
admin,
level,
kills,
team[256]
};
new PlayerInfo[MAX_PLAYERS][pInfo];
---------
but when I try to do:
PlayerInfo[playerid][team] = "none";
for example, I get some errors like array sizes does not much and more....
someone gave me the following code to write in this variable that works:
strmid(PlayerInfo[playerid][team], "none", 0, strlen("none"), 256);
but when I try to read:
if (PlayerInfo[playerid][team] = "agent") { AgentRandomSpawnPlayer(playerid); }
I get these errors:
warning 211: possibly unintended assignment
error 047: array sizes do not match, or destination array is too small
someone knows what's the problem?