public OnPlayerConnect(playerid) { GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP)); AccountInfo[playerid][aIP]=PlayerIP; return 1; }
public OnPlayerRequestClass(playerid, classid) { if(IsUserNameAvailable(PlayerName[playerid])) { if(OnPlayerAutoLogin(playerid)) { LoadPlayer(playerid); return SpawnPlayer(playerid); } ShowPlayerDialog(playerid,DIALOGID+1,DIALOG_STYLE_MSGBOX,ServerInfo[sName],"The system found an account by your nickname. \nYou have to login to continue.","Login","Quit"); }else{ ShowPlayerDialog(playerid,DIALOGID+2,DIALOG_STYLE_MSGBOX,ServerInfo[sName],"The system didn't found an account by your nickname. You can play with or without an account. \nIf you don't register, you stats won't be restored. If you register your stats will be stored. \nPlease make your choice.","Register","Don't Reg."); } return 1; }
stock OnPlayerAutoLogin(playerid) { format(File, sizeof(File), "/accountfiles/%s.sav", PlayerName[playerid]); AutoLogin = dini_Int(File, "AutoLogin"); if(AutoLogin) { GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP)); AccountInfo[playerid][aIP] = dini_Int(File, "IP"); if(!strcmp(AccountInfo[playerid][aIP], PlayerIP)) { return 1; } } return 0; }
enum sAccount { aIP[16],// IP of the player //other account variables }; new AccountInfo[MAX_PLAYERS][sAccount];
stock OnPlayerAutoLogin(playerid)
{
format(File, sizeof(File), "/accountfiles/%s.sav", PlayerName[playerid]);
AutoLogin = dini_Int(File, "AutoLogin");
if(AutoLogin)
{
if(!strcmp(AccountInfo[playerid][aIP], dini_Get(File, "IP"))) return 1;
}
return 0;
}
public OnPlayerConnect(playerid)
{
GetPlayerIp(playerid, AccountInfo[playerid][aIP], sizeof(AccountInfo[playerid][aIP]));
return 1;
}
Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : error 001: expected token: "]", but found "-identifier-" Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : warning 215: expression has no effect Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : error 001: expected token: ";", but found "]" Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : error 029: invalid expression, assumed zero Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : fatal error 107: too many error messages on one line
error 047: array sizes do not match, or destination array is too small
Ok, now if got 2 errors.
By this line: GetPlayerIp(playerid, AccountInfo[playerid][aIP], sizeof(AccountInfo[playerid][aIP])); // at on player connect the follow errors: Код:
Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : error 001: expected token: "]", but found "-identifier-" Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : warning 215: expression has no effect Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : error 001: expected token: ";", but found "]" Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : error 029: invalid expression, assumed zero Z:\Mijn documenten\PC\Game\Maxlife\Script\2011\januari 2011\MLRPG 2011 2 januari\MLRPG 2011 2 januari\gamemodes\mlrpg.pwn(29) : fatal error 107: too many error messages on one line AccountInfo[playerid][aIP] = dini_Get(File, "IP"); this error: Код:
error 047: array sizes do not match, or destination array is too small |
AccountInfo[playerid][aIP] = dini_Get(File, "IP");
public OnPlayerConnect(playerid)
{
GetPlayerIp(playerid, AccountInfo[playerid][aIP], 16); // Assuming 16 is the size of your array, since that's the maximum length of an IP address.
return 1;
}