05.06.2012, 22:43
I made this code on PlayerDisconnect so that it checks if the player has completed registration if not then it deletes the user file of the player and he has to register again.
I Have set SetPVarInt(playerid,"Regan",1) on OnPlayerConnect so if the player disonnect before login his user.txt wont get deleted.
I Have set SetPVarInt(playerid,"Regan",0) on the start of the registration and SetPVarInt(playerid,"Regan",1) when the player finishes it.
Now when I reset my server over /gmx my user.txt in scriptfiles gets deleted.
pawn Код:
if(GetPVarInt(playerid,"Regan")==0)
{
new name[MAX_PLAYER_NAME],strPath[128];
GetPlayerName(playerid,name,sizeof(name));
format(strPath,sizeof(strPath), "/users/%s.txt",name);
fremove(strPath);
}
I Have set SetPVarInt(playerid,"Regan",0) on the start of the registration and SetPVarInt(playerid,"Regan",1) when the player finishes it.
Now when I reset my server over /gmx my user.txt in scriptfiles gets deleted.