12.08.2012, 19:45
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
NoEvento[playerid] = false;
SalvarPlayer(playerid);
KillTimer(godcarTimer[playerid]);
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
Delete3DTextLabel(Incar[playerid]);
}
if(DonoCarro[playerid] != INVALID_VEHICLE_ID) {
DestroyVehicle(DonoCarro[playerid]);
}
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason) {
case 0: format(string, sizeof(string), "%s saiu do servidor. (Net/Crash)", pname);
case 1: format(string, sizeof(string), "%s saiu do servidor. (Saiu)", pname);
case 2: format(string, sizeof(string), "%s saiu do servidor. (Kick/Ban)", pname);
}
SendClientMessageToAll(0x778899FF, string);
switch(reason) {
case 0..2: KillTimer(TimerFPS[playerid]);
}
return 1;
}
PHP код:
//Salvamento
if(!DOF2_FileExists(ReturnFileUser(playerid))) ShowPlayerDialog(playerid, Dialog_Registro, DIALOG_STYLE_PASSWORD,"-| Bem vindo |-","{CFCFCF}Conta:{FF0000} Nгo registrada\n \n{CFCFCF}Digite uma senha para se registrar:", "Registrar","Quit");
else if(DOF2_FileExists(ReturnFileUser(playerid))) ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_PASSWORD,"[Login]", "{CFCFCF}Olб, Seja bem-vindo ao nosso servidor\n \n{CFCFCF}Conta:{00FF00} Registrada\n{CFCFCF}Digite sua senha para logar:", "Logar","Quit");