23.06.2012, 22:06
Hello!
I am using 1admin system.When a player connect then the login box will appear and 2 options will be there "Login" & "Quit"
I want when the player click "Quit" then he should get kick from the server
Here is the code
OnDialogResponse
I am using 1admin system.When a player connect then the login box will appear and 2 options will be there "Login" & "Quit"
I want when the player click "Quit" then he should get kick from the server
Here is the code
pawn Код:
public OnPlayerConnect(playerid){
new logstring[256];
format(logstring,256,"Welcome back \n\n '%s 'is already Registered!\n Login to access your Account",pName(playerid));
ShowPlayerDialog(playerid,DIALOGID0+2,DIALOG_STYLE_INPUT,"Login Account",logstring,"Login","Quit");
return 1}
pawn Код:
if(dialogid == DIALOGID0+2){
if(response)
{
cmd_login(playerid,inputtext);
if (PlayerInfo[playerid][LoggedIn] == 1) {
SendClientMessage(playerid, 0x32CD32AA,"* Login Successfull... Welcome Back !");
return 1;}
if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Account doesn't exist, please use '/register [password]'.");
if (udb_CheckLogin(PlayerName2(playerid),inputtext))
{
new file[256], tmp3[100], lname[MAX_PLAYER_NAME];
GetPlayerName(playerid,lname,sizeof(lname));
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(lname));
GetPlayerIp(playerid,tmp3,100);
dini_Set(file,"ip",tmp3);
LoginPlayer(playerid);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
if(PlayerInfo[playerid][Level] > 0) {
format(string,sizeof(string),"|- You have Successfully Logged! | Level %d -|", PlayerInfo[playerid][Level]);
SendClientMessage(playerid,green,string);
} else return SendClientMessage(playerid,green,"|- You have Successfully logged! -|");
}
return ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT,"Password", "WRONG Password, Try Again", "OK", "Cancel");
}
return 1;}