15.03.2011, 10:54
Sorry For Double Post Again But How can i Add it say ERROR:WRONG PASSWORD and kick him
it don't send message but it kicks the player i want it send Message Also
it don't send message but it kicks the player i want it send Message Also
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)
{
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Registration", "Welcome To The CALL OF DUTY MODERNWAFARE!\nPlease enter your password below to regiser\n an account.", "Continue", "Quit");
return 1;
}
new name[MAX_PLAYER_NAME], dat[200], ip[40];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerIp(playerid, ip, sizeof(ip));
format(dat, sizeof(dat), "MyData/User/%s.txt", name);
/*new File:fi = fopen(dat, io_write);
fclose(fi);*/ // No need to do this.
new day, year, month, date[10];
getdate(year, month, day);
format(date, sizeof(date), "%d/%d/%d", day, month, year);
dini_Set(dat, "Name", name);
dini_Set(dat, "IP", ip);
dini_Set(dat, "Password", inputtext);
dini_Set(dat, "Registered", date);
dini_IntSet(dat, "Money", 0);
dini_IntSet(dat, "Score", 0);
dini_IntSet(dat, "Level", 0);
SetPlayerScore(playerid, 0);
SetPlayerMoney(playerid, 0);
PlayerData[playerid][Level] = 0;
new string[150];
format(string, sizeof(string), "*%s registered and joined the server!", name);
SendClientMessageToAll(COLOR_GREEN, string);
SetPVarInt(playerid, "Logged", 1);
}
else return Kick(playerid);
}
if(dialogid == 1)
{
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Login", "Welcome To The CALL OF DUTY MODERNWAFARE!\nPlease enter your password below to login\n into your account.", "Continue", "Quit");
return 1;
}
new name[MAX_PLAYER_NAME], dat[200], ip[40], tmp[256];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerIp(playerid, ip, sizeof(ip));
format(dat, sizeof(dat), "MyData/User/%s.txt", name);
tmp = dini_Get(dat, "Password");
if(strcmp(tmp,inputtext,true)==0)
{
// Your code
}
else
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: WRONG PASSWORD");
Kick(playerid);
}
}
}
return 1;
}