Problem with login/register system
#1

Hello,
I create gamemode. I use login/register system from this forum's tutorial with Y_INI. In registration I have
Код:
INI_WriteInt(File,"HERE IS VARIABLE",0);
. The problem is sometimes when person registering in my server(I use free hosting), he have my permision(5 level admin, 3 level VIP, my faction and leader on my faction). Where is a problem? I will give you +REP
Sorry for my bad English!
Thank you and have a nice day!
Reply
#2

Do you reset player variables to 0 in OnPlayerConnect?
Reply
#3

dont use spaces and special characters in variable names, use underscore if you have to.
Reply
#4

Reset their variables, as Amads is referring too.

i.e:

PHP код:
public OnPlayerConnect(playerid)
{
   
ResetPlayer(playerid);
   return 
1;
}
ResetPlayer(playerid)
{
   
PlayerData[playerid][pAdmin] = 0
   
PlayerData[playerid][pLevel] = 0
   
PlayerData[playerid][pFaction] = 0;
   
PlayerData[playerid][pVIP] = 0;
   return 
1;

Reply
#5

I reset in dialog fuction. Thank you very much. I will test you answers.
Reply
#6

Код:
public OnPlayerDisconnect(playerid, reason)
{
//code before
INI_WriteInt(File,"HERE IS VARIABLE",0);
INI_Close(file);
PlayerInfo[playerid][pAdmin] = 0;
//RESET ALL ENUM info
}
Reply
#7

Quote:
Originally Posted by ThomasEvil
Посмотреть сообщение
Код:
public OnPlayerDisconnect(playerid, reason)
{
//code before
INI_WriteInt(File,"HERE IS VARIABLE",0);
INI_Close(file);
PlayerInfo[playerid][pAdmin] = 0;
//RESET ALL ENUM info
}
Why I need from this?
Reply
#8

You need it to reset playerid.
If Player0 with id 0 disconnect and then Player1 come to the server ,
Player1 get stats from Player0 because both of them are id 0. Understand?
Reset it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)