enum DLocker { Text[128], Float:lockerz, Float:lockery, Float:lockerx, lTeam, };
forward LoadUser_data(playerid,name[],value[]); public LoadUser_data(playerid,name[],value[]) { INI_Int("Password",PlayerInfo[playerid][pPass]); INI_Int("Level",PlayerInfo[playerid][pLevel]);
enum DLocker { Text[128], Float:lockerz, Float:lockery, Float:lockerx, lTeam, };
Not really sure about Y_INI but..
Код:
enum DLocker { Text[128], Float:lockerz, Float:lockery, Float:lockerx, lTeam, }; |
@WhiteGhost, this will cause errors while compiling, It's wrong.
@Brian, Save the string with Int_String, the float Int_Float and 1Team with integer or however you use it. |
forward loadlocker(here??, name[], value[])
#define MAX_LOCKERS 3
forward LoadLocker(lockerid, name[], value[]);
enum DLocker
{
Name[128],
Float:lockerz,
Float:lockery,
Float:lockerx,
lTeam,
};
new LockerInfo[MAX_LOCKERS][DLocker];
public LoadLocker(lockerid, name[], value[])
{
INI_String("Text", LockerInfo[lockerid][Name], 128);
INI_Float("LockerZ", LockerInfo[lockerid][lockerz]);
INI_Float("LockerY", LockerInfo[lockerid][lockery]);
INI_Float("LockerX", LockerInfo[lockerid][lockerx]);
INI_Int("LTeam", LockerInfo[lockerid][lTeam]);
}
forward SaveLocker(lockerid);
public SaveLocker(lockerid)
{
new INI:File = INI_Open(LockerPath(lockerid));
INI_SetTag(File, "Locker Data");
INI_WriteString(File, "Text",LockerInfo[lockerid][Name]);
INI_WriteFloat(File, "LockerZ",LockerInfo[lockerid][lockerz]);
INI_WriteFloat(File, "LockerY",LockerInfo[lockerid][lockery]);
INI_WriteFloat(File, "LockerX",LockerInfo[lockerid][lockerx]);
INI_WriteInt(File, "lTeam",LockerInfo[lockerid][lTeam]);
INI_Close(File);
return 1;
}
(199) : error 047: array sizes do not match, or destination array is too small (209) : error 001: expected token: "-string end-", but found "-identifier-" (209) : warning 215: expression has no effect (209) : error 001: expected token: ";", but found ")" (209) : error 029: invalid expression, assumed zero (209) : fatal error 107: too many error messages on one line --------------------------------------------------------------------------------------------------------- #define LockerPath "/Lockers/%i.ini"
199 - INI_String("Text", LockerInfo[lockerid][Name], 128); ______________________________________________________________________________ 209 - new INI:File = INI_Open(LockerPath(lockerid));
Thanks a lot i'll test it,
So i can type anything instead of "lockerid?" i choose what to call it? |
public LoadLocker(reallylongunneededname, name[], value[])
{
INI_String("Text", LockerInfo[reallylongunneededname][Name], 128);
INI_Float("LockerZ", LockerInfo[reallylongunneededname][lockerz]);
INI_Float("LockerY", LockerInfo[reallylongunneededname][lockery]);
INI_Float("LockerX", LockerInfo[reallylongunneededname][lockerx]);
INI_Int("LTeam", LockerInfo[reallylongunneededname][lTeam]);
}