01.06.2016, 10:29
Guys can you help to how make like this ?? when your logged in . ty
new file[256], tmp3[100]; format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) ); GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3); LoginPlayer(playerid); LoadPlayer(playerid); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); if(PlayerInfo[playerid][Level] > 0) { format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d) ", PlayerInfo[playerid][Level]); return SendClientMessage(playerid,green,string); } else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In");
public OnPlayerConnect (playerid)
{
if (PlayerInfo [playerid][Admin] == 1) return SendClientMessage(playerid, COLOR_GREEN, "You have sucessfully logged. | Admin Level: 1);
}
Код:
new file[256], tmp3[100]; format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) ); GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3); LoginPlayer(playerid); LoadPlayer(playerid); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); if(PlayerInfo[playerid][Level] > 0) { format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d) ", PlayerInfo[playerid][Level]); return SendClientMessage(playerid,green,string); } else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In"); |
if(dialogid == 9048) { if (response) { new dialogstr[256]; new pame[MAX_PLAYER_NAME]; GetPlayerName(playerid, pame, sizeof(pame)); if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"ACCOUNT: You are already logged in."); if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"ACCOUNT: Account doesn't exist, please use '/register [password]'."); if (strlen(inputtext)==0) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}%s This nickname is registed please login:", pame), ShowPlayerDialog(playerid, 9048, DIALOG_STYLE_INPUT, "{FF0000}Login", dialogstr, "Accept", "Cancel"); if (udb_CheckLogin(PlayerName2(playerid),inputtext)) { new file[256], tmp3[100]; format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) ); GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3); LoginPlayer(playerid); LoadPlayer(playerid); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); if(PlayerInfo[playerid][Level] > 0) { format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d) ", PlayerInfo[playerid][Level]); return SendClientMessage(playerid,green,string); } else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In"); } else { PlayerInfo[playerid][FailLogin]++; printf("LOGIN: %s has failed to login, Wrong password (%s) Attempt (%d)", PlayerName2(playerid), inputtext, PlayerInfo[playerid][FailLogin] ); if(PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS) { format(string, sizeof(string), "%s has been kicked (Failed Logins)", PlayerName2(playerid) ); SendClientMessageToAll(grey, string); print(string); Kick(playerid); } return SendClientMessage(playerid,red,"ACCOUNT: Login failed! Incorrect Password"), format(dialogstr,sizeof(dialogstr),"{FF0000}Login failed! Incorrect Password, Please Tray Agin!", pame), ShowPlayerDialog(playerid, 9048, DIALOG_STYLE_INPUT, "{FF0000}Login", dialogstr, "Login", "Cancel"); } } else { SendClientMessage(playerid, red, "|- ERROR: !KICKED! | Reason: Not Loggedin -|"); return Kick(playerid); } } return 0; }
new string[128]; format(string, sizeof(string), "|- You have Successfully Logged! Level %d - Administator -|, PlayerInfo[playerid][Level]); SendClientMessage(playerid, COLOR_GREEN, string);