forward AKICK(playerid);
public AKICK(playerid)
{
GameTextForPlayer(playerid, "You have ~g~10~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK9", 1000, false, "i", playerid);
if(PlayerInfo[playerid][LoggedIn] == 1)
{
new string[128];
format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d)", PlayerInfo[playerid][Level] );
return SendClientMessage(playerid,green,string);
KillTimer(playerid);
}
return 1;
}
forward AKICK9(playerid);
public AKICK9(playerid)
{
GameTextForPlayer(playerid, "You have ~g~9~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK8", 1000, false, "i", playerid);
}
forward AKICK8(playerid);
public AKICK8(playerid)
{
GameTextForPlayer(playerid, "You have ~g~8~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK7", 1000, false, "i", playerid);
}
forward AKICK7(playerid);
public AKICK7(playerid)
{
GameTextForPlayer(playerid, "You have ~y~7~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK6", 1000, false, "i", playerid);
}
forward AKICK6(playerid);
public AKICK6(playerid)
{
GameTextForPlayer(playerid, "You have ~y~6~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK5", 1000, false, "i", playerid);
}
forward AKICK5(playerid);
public AKICK5(playerid)
{
GameTextForPlayer(playerid, "You have ~b~5~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK4", 1000, false, "i", playerid);
}
forward AKICK4(playerid);
public AKICK4(playerid)
{
GameTextForPlayer(playerid, "You have ~b~4~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK3", 1000, false, "i", playerid);
}
forward AKICK3(playerid);
public AKICK3(playerid)
{
GameTextForPlayer(playerid, "You have ~r~3~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK2", 1000, false, "i", playerid);
}
forward AKICK2(playerid);
public AKICK2(playerid)
{
GameTextForPlayer(playerid, "You have ~r~2~w~ seconds to login!", 5000, 6);
SetTimerEx("AKICK1", 1000, false, "i", playerid);
}
forward AKICK1(playerid);
public AKICK1(playerid)
{
GameTextForPlayer(playerid, "You have ~r~1~w~ seconds to login!", 5000, 6);
Kick(playerid);
}
CMD:login(playerid,params[])
{
if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"ACCOUNT: You are already logged in.");
if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"ACCOUNT: Account doesn't exist, please use '/register [password]'.");
if (strlen(params)==0) return SendClientMessage(playerid,red,"ACCOUNT: Correct usage: '/login [password]'");
if (udb_CheckLogin(PlayerName2(playerid),params))
{
new file[256], tmp3[100], string[128];
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) );
GetPlayerIp(playerid,tmp3,100);
dini_Set(file,"ip",tmp3);
LoginPlayer(playerid);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
if(PlayerInfo[playerid][Level] > 0)
{
SetTimerEx("AKICK", 5000, false, "i", playerid);
return 1;
} else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In");
}
else {
PlayerInfo[playerid][FailLogin]++;
printf("LOGIN: %s has failed to login, Wrong password (%s) Attempt (%d)", PlayerName2(playerid), params, PlayerInfo[playerid][FailLogin] );
if(PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS)
{
new string[128]; format(string, sizeof(string), "%s has been kicked (Failed Logins)", PlayerName2(playerid) );
SendClientMessageToAll(grey, string);
print(string);
Kick(playerid);
}
return SendClientMessage(playerid,red,"ACCOUNT: Login failed! Incorrect Password");
}
}
KillTimer(AKICK9);
new loginTime[MAX_PLAYERS];
forward OneSecond();
public OneSecond()
{
new string[124];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
loginTime[i] --;
if(loginTime[i] == 0 && PlayerInfo[playerid][LoggedIn] == 0)
{
format(string,sizeof(string),"You have ~r~%d ~w~seconds to log in.",loginTime[i]);
GameTextForPlayer(i,string,4000,4);
}
}
}
return 1;
}
public OnGameModeInit()
{
SetTimer("OneSecond",1000,1);
return 1;
}
KillTimer(AKICK9); |
[C:\Users\Alex\Documents\Samp Server\gamemodes\2.pwn(18340) : error 076: syntax error in the expression, or invalid function call] KillTimer(AKICK9);
loginTime[i] --;
if(loginTime[i] == 0 && PlayerInfo[playerid][LoggedIn] == 0)
#define IsLoggedIn(%0) PlayerInfo[%0][LoggedIn]
if(!IsLoggedIn(i))
{
loginTime[i] --;
if(loginTime[i] > 0)
{
// Count down code here
}
else
{
// Kick code here
}
}
C:\Users\Alex\Documents\Samp Server\gamemodes\2.pwn(18617) : error 010: invalid function or declaration
C:\Users\Alex\Documents\Samp Server\gamemodes\2.pwn(18620) : error 010: invalid function or declaration
C:\Users\Alex\Documents\Samp Server\gamemodes\2.pwn(18624) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
if(!IsLoggedIn(i))
{
loginTime[i] --;
if(loginTime[i] > 0)
{
SendClientMessage(playerid,red,"ACCOUNT: Test1'");
}
else
{
SendClientMessage(playerid,red,"ACCOUNT: Test2'");
}
}