07.08.2011, 14:51
Quote:
Bem interessante .. Nunca tinha visto.
dudaefj, seria possivel vocк postar as publics OnPlayerConnect e OnPlayerDisconnect ? |
que bom que posso de alguma forma ajudar alguйm :]
mas antes de tudo os crйditos pela crianзгo desse comando que alguns "nunca viram" й do park4bmx
mREGV0.7
PHP код:
public OnPlayerConnect(playerid)
{
ResetSettings(playerid);
SetPlayerColor(playerid, PlayerColors[playerid]);
TogglePlayerSpectating(playerid, 1);
IsLogged[playerid] = 0;
new file[128], string[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/mRegistration/Users/%s.txt",name);
if(!fexist(file))
{
ShowPlayerDialog(playerid, WELCOME1, DIALOG_STYLE_MSGBOX, " ", ""WHITE"Bem Vindo ao "BLUE""SERVER_NAME"", "Nгo Enxe!", "Registrar");
}
if(fexist(file))
{
format(file,sizeof(file),"/mRegistration/Settings/%s.txt",name);
INI_ParseFile(file, "LoadAutoLog", false, true, playerid, true, false);
PlayerInfo[playerid][AutoLogin] = GetPVarInt(playerid,"AutoLog");
if(PlayerInfo[playerid][AutoLogin] == 0){
ShowPlayerDialog(playerid, WELCOME2, DIALOG_STYLE_MSGBOX, ""WHITE"Bem Vindo ao "BLUE""SERVER_NAME"", ""WHITE"Use "GREEN"/AutoLog "WHITE"se voce quiser fazer login automaticamente na proxima vez", "Pular", "Login");
}else if(PlayerInfo[playerid][AutoLogin] >= 1)
{
format(file,sizeof(file),"/mRegistration/Users/%s.txt",name);
INI_ParseFile(file, "LoadUserIp", false, true, playerid, true, false );
GetPlayerIp(playerid,rip[playerid],16);
new IPa[80]; GetPVarString(playerid, "pIP", IPa, sizeof IPa);
if(!strcmp(rip[playerid],IPa,true))
{
LoadStatus(playerid);
TogglePlayerSpectating(playerid, 0);
SetTimer("IsLoggedTimer",1500,false);
SpawnPlayer(playerid);
format(string, sizeof(string), ""YELLOW"[SERVER] "GREEN"%s "WHITE"Logou-se com sucesso! :D",name );
SendClientMessageToAll(COLOR_GREEN2, string);
printf("%s Has Logged Into His Account", name);
}else{
format(string, sizeof string, ""WHITE"Seu IP e sua senha nгo batem: "BLUE"%s "WHITE"\nPara logar-se digite sua senha:", name);
ShowPlayerDialog(playerid, Login, DIALOG_STYLE_MSGBOX, ""RED"Login Failed", string, "OK", "Cancelar");
}
}
return 1;
}
return 0;
}
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
if(PlayerReconnecting[playerid]==1)
{
new string[8+16];
GetPVarString(playerid, "pIp", string, 16);
format(string, sizeof(string), "unbanip %s", string);
SendRconCommand(string);
}
SaveStatus(playerid);
ResetSettings(playerid);
IsLogged[playerid] = 0;
KillTimer(TimeTimer);
KillTimer(AutoSaveTimer[playerid]);
return 1;
}