You could just start a timer in OnPlayerConnect that will check in one minute if the player has logged in, if he has not, warn him, then kick him in one more minute.
I think this will work, no guarantees, it compiles but I have not tested.
pawn Код:
forward LoginWarn();
forward LoginKick();
pawn Код:
new NotLoggedIn[MAX_PLAYERS];
new LoginWarned[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
NotLoggedIn[playerid] = 1;
SetTimer("LoginWarn",60000,false);
return 1;
}
pawn Код:
public LoginWarn()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(NotLoggedIn[i] == 1)
{
GameTextForPlayer(i,"WARNING: You will be kicked in sixty seconds if you do not login!",5000,5);
LoginWarned[i] = 1;
SetTimer("LoginKick",60000,false);
}
}
return 1;
}
pawn Код:
public LoginKick()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(NotLoggedIn[i] == 1)
{
if(LoginWarned[i] == 1)
{
GameTextForPlayer(i,"You have been kicked for being idle!",5000,5);
Kick(i);
}
else
{
LoginWarn();
}
}
}
return 1;
}
Now just add:
pawn Код:
NotLoggedIn[playerid] = 1;
In the login command where ever it confirms you have logged in.
Let me know if there are any problems.
EDIT: I just realized thats not what you asked for, I misread 'kill' as kick.
When do you want it to kill him, when he tries to spawn? You can just keep him from spawning until he has logged in. Let me know.