heres some code
the login with the msgs and log.
Code: Select all
function bool Login(String IDName, String pass, PlayerPawn player){
local int index,index2;
local string temptime,temptext;
index = GetIndex(IDName);
index2 = GetPlayerIndex(player);
if(IDName == "" || index == -1 || pass == "" )
return false;
else if(ID[index].pass == pass){
temptext = "Last time logged in was at "$ID[index].timeStamp;
player.clientmessage(temptext);
log(temptext);
BroadCastMessage(player.PlayerReplicationInfo.PlayerName$" logged in as "$ID[index].IDName$" [Lvl "$GetLevel(ID[index].XP)$"]");
temptime = ID[index].timeStamp;
ID[index].timeStamp = TimeStamp();
PI[index2].loggedIn = true;
PI[index2].entered = true;
saveconfig();
return true;
}
}
login works and the msgs and log within Login are executed;
Code: Select all
if(action ~= "Login")
if(Login(par1,par2,Sender))
Sender.clientmessage("Login successfull as "$par1);
else
Sender.clientmessage("Login failed");
Login works but the msgs and log within Login are NOT executed, only first time in game;
PS: It was all in Tick first but i thought maybe if i put it in timer it will msg again but no
Code: Select all
function Timer(){
local int index,index2;
local pawn P;
SearchForLeftPlayers();
for(P=Level.PawnList;P!=none;P=P.NextPawn){
if(PlayerPawn(P) != none){
index = GetIndexPlayerIP(PlayerPawn(P));
index2 = GetPlayerIndex(PlayerPawn(P));
if(!PI[index2].entered && index != -1)
Login(ID[index].IDName,ID[index].pass,PlayerPawn(P));
PI[index2].entered = true;
}
}
}