Autosave timer and if(inputtext) error -
CSLangdale - 31.05.2016
Код:
#if AUTOSAVE == true
SetTimerEx("Save_Players",AUTOSAVE_INTERVAL*1000,true); //Start the autosave timer if enabled
#endif
Thats the timer and it keeps saying that "SetTimerEx" is already defined...
Код:
/*case DIALOG_LOGIN:
{
if (!response) return Kick(playerid);
if(response)
{
if(inputtext) == PlayerInfo[playerid][pPassword])
{
INI_ParseFile(Path(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
format(string, sizeof(string), "SERVER:{FFFFFF} Welcome back, %s!", pname);
SendClientMessage(playerid, 0x46E850FF, string);
Logged[playerid] = true;
SetSpawnInfo(playerid, 0, 0, -162.9535, 158.3127, 53.8754, 0.00, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "{FFFFFF}You have entered an {C44B4B}incorrect{FFFFFF} password.\nType your password below to login.", "Login", "Quit");
return 1;
}
}*/
if i try using this i get the error "inputtext needs to be indexed"
Any ideas?
Re: Autosave timer and if(inputtext) error -
Kaliber - 31.05.2016
Quote:
Originally Posted by CSLangdale
Код:
if(inputtext) == PlayerInfo[playerid][pPassword])
|
this line..is bullshit
write it like this:
PHP код:
if(!strcmp(inputtext, PlayerInfo[playerid][pPassword]) && inputtext[0] != EOS)
And for the other thing...where this code is placed?
Re: Autosave timer and if(inputtext) error -
CSLangdale - 01.06.2016
the other line is placed on its own it doesnt have anything with it
Код:
forward Save_PlayerInfo();
public Save_PlayerInfo() //Saves all the garages, changed to a public because of the autosave timer
{
new playerid;
if(Logged[playerid] == true)
{
new path[64];
format(path,sizeof(path),"/Players/%s.ini");
new INI:file = INI_Open(path);
INI_WriteInt(file, "Admin", PlayerInfo[playerid][pAdmin]);
INI_WriteInt(file, "Level", PlayerInfo[playerid][pLevel]);
INI_WriteInt(file, "Skin", GetPlayerSkin(playerid));
INI_WriteInt(file, "Registered", PlayerInfo[playerid][Registered]);
INI_WriteInt(file, "HandMoney", GetPlayerMoney(playerid));
INI_Close(file);
}
}
/*#if AUTOSAVE == true
SetTimerEx("Save_Players",AUTOSAVE_INTERVAL*1000,true); //Start the autosave timer if enabled
#endif*/
Thats the SetTimerEx line that i have the issues with
Re: Autosave timer and if(inputtext) error -
CSLangdale - 01.06.2016
Код:
case DIALOG_LOGIN:
{
if (!response) return Kick(playerid);
new string[128], Path;
if(response)
{
if(!strcmp(inputtext, PlayerInfo[playerid][pPassword]) && inputtext[0] != EOS)
{
INI_ParseFile(Path(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
format(string, sizeof(string), "SERVER:{FFFFFF} Welcome back, %s!", pname);
SendClientMessage(playerid, 0x46E850FF, string);
Logged[playerid] = true;
SetSpawnInfo(playerid, 0, 0, -162.9535, 158.3127, 53.8754, 0.00, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "{FFFFFF}You have entered an {C44B4B}incorrect{FFFFFF} password.\nType your password below to login.", "Login", "Quit");
return 1;
}
}
thats with your correction and i now get these errors
Код:
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : error 012: invalid function call, not a valid address
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : error 001: expected token: ";", but found ")"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : fatal error 107: too many error messages on one line
Re: Autosave timer and if(inputtext) error -
Vince - 01.06.2016
You can't have a statement "on its own" outside of a function. You will likely want to place that in main or OnGameModeInit.
Re: Autosave timer and if(inputtext) error -
CSLangdale - 01.06.2016
Edit: I just did that and got a warning that it doesnt match number of definition
Re: Autosave timer and if(inputtext) error -
CSLangdale - 01.06.2016
Код:
INI_ParseFile(Path(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
Line 558 ^^^^
Код:
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : error 012: invalid function call, not a valid address
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : error 001: expected token: ";", but found ")"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\grandlarc.pwn(558) : fatal error 107: too many error messages on one line