Problem About PlayerInfo
#1

Hi Everyone , I have a problem with PlayerInfo :

I set it like:
PHP код:
enum pInfo{
var1,
var2
};
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
Then:
PHP код:
public OnPlayerConnect(playerid)
{
 
PlayerInfo[playerid][var1] = 0;
return 
1;
}
public 
OnPlayerSpawn(playerid){
PlayerInfo[playerid][var1] = 1;
new 
LoginTimer;
LoginTimer SetTimerEx("LoginTimeOut"30000false"i"playerid);
}
public 
LoginTimeOut(playerid)
{
 if(
PlayerInfo[playerid][var1] == 1KillTimer(LoginTimer);
 else 
 {
  
Kick(playerid);
 }
return 
1;

And when i login it kicks me that it should not do
Sory for my english, please help me
Reply
#2

no answer ?
Reply
#3

Set the var1's value to 1 OnPlayerConnect.
Reply
#4

Quote:
Originally Posted by Sandiel
Посмотреть сообщение
Set the var1's value to 1 OnPlayerConnect.
still kicking me :/
Reply
#5

Quote:
Originally Posted by liquid13
Посмотреть сообщение
still kicking me :/
Instead of "else", try "else if(PlayerInfo[playerid][var1] == 0)".
So now it's
pawn Код:
else if(PlayerInfo[playerid][var1] == 0)
{
}
// instead of else....
Reply
#6

First of make timer also per player with LoginTimer[MAX_PLAYERS]; at top, but about your thing, I dont really see a use of why you need that timer.
Reply
#7

Quote:
Originally Posted by Sandiel
Посмотреть сообщение
Instead of "else", try "else if(PlayerInfo[playerid][var1] == 0)".
So now it's
pawn Код:
else if(PlayerInfo[playerid][var1] == 0)
{
}
// instead of else....
I'm testing now it looks okay .Thx for answer

Quote:
Originally Posted by ikey07
Посмотреть сообщение
First of make timer also per player with LoginTimer[MAX_PLAYERS]; at top, but about your thing, I dont really see a use of why you need that timer.
I kind of shrinked the code it's in the login system if player wont write password it'll kick the player.
Reply
#8

But if its isnt repeating timer, there is no reason to assign it to some variable at all, as you kill timer when its already done, so its just extra script lines
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)