SA-MP Forums Archive
Problem About PlayerInfo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem About PlayerInfo (/showthread.php?tid=369928)



Problem About PlayerInfo - liquid13 - 18.08.2012

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


Re: Problem About PlayerInfo - liquid13 - 18.08.2012

no answer ?


Re: Problem About PlayerInfo - Sandiel - 18.08.2012

Set the var1's value to 1 OnPlayerConnect.


Re: Problem About PlayerInfo - liquid13 - 18.08.2012

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


Re: Problem About PlayerInfo - Sandiel - 18.08.2012

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....



Re: Problem About PlayerInfo - ikey07 - 18.08.2012

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.


Re: Problem About PlayerInfo - liquid13 - 18.08.2012

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.


Re: Problem About PlayerInfo - ikey07 - 18.08.2012

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