16.08.2012, 01:50
Quote:
si quiero que aparezca en onplayerconnect.
Otacom voy a ver si puedo hacerlo pero me tengo que i a dormir maсana lo hago. Si alguien lo tiene me beneficia. Para cuando me conecte maсana |
onplayerconnect
pawn Код:
if(!udb_Exists(PlayerName2(playerid))) {
format(string,sizeof(string),"{FFFFFF}Bienvenido a {05A3FE}MTDM.\n{FFFFFF}Esta Cuenta No Se Encuentra {6600FF}Registrada.\n{FFFFFF}Ingrese una Contraseсa.");
ShowPlayerDialog(playerid, 9049, DIALOG_STYLE_PASSWORD, "{FF0000}MTDM te da la Bienvenida", string, "Registrarse", "");
}
if(udb_Exists(PlayerName2(playerid))) {
format(string, sizeof(string), "Bienvenido %s.", PlayerName);
SendClientMessage(playerid, COLOR_WHITE, string);
format(file,256,"/ladmin/users/%s.sav",udb_encode(PlayerName));
new tmp[50],tmp2[256];
GetPlayerIp(playerid,tmp,128);
tmp2 = dini_Get(file,"ip");
if(!strcmp(tmp,tmp2,true) && ServerInfo[AutoLogin] == 1) {
}
else {
format(string,sizeof(string),"{FFFFFF}Bienvenido a MTDM,{6600FF} %s\n{FFFFFF}Ingrese Contraseсa", PlayerName);
ShowPlayerDialog(playerid, 9048, DIALOG_STYLE_PASSWORD, "{05A3FE}MTDM te da la Bienvenida", string, "Entrar", "");
}
}
pawn Код:
if(dialogid == 9048)
{
if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"CUENTA: Ya haz iniciado sesion.");
if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"Cuenta: Esta cuenta no existe");
if (strlen(inputtext)==0) return format(string,sizeof(string),"{FFFFFF}Bienvenido a MTDM,{6600FF} %s\n{FFFFFF}Ingrese Contraseсa", nombre), ShowPlayerDialog(playerid, 9048, DIALOG_STYLE_PASSWORD, "{05A3FE}MTDM te da la Bienvenida", string, "Entrar", "");
if (udb_CheckLogin(PlayerName2(playerid),params))
{
new file[256], tmp3[100], string[128];
format(file,sizeof(file),"/ladmin/users/%s.ini",udb_encode(PlayerName2(playerid)) );
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),"Logueado correctamente. {FFFF00}(Nivel %d)", PlayerInfo[playerid][Level] );
return SendClientMessage(playerid,green,string);
} else return SendClientMessage(playerid,green,"Logueado correctamente.");
}
return format(string,sizeof(string),"{FFFFFF}Servidor: {FE0505}Contraseсa Incorrecta\n{FFFFFF}Coloca Bien Tu {6600FF}Contraseсa.", nombre), ShowPlayerDialog(playerid, 9048, DIALOG_STYLE_PASSWORD, "{05A3FE}MTDM te da la Bienvenida", string, "Entrar", "");
}
if(dialogid == 9049)
{
if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"Cuenta: You are already registered and logged in.");
if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"Cuenta: This Cuenta already exists, please use '/login [password]'.");
if (strlen(inputtext) == 0) return format(string,sizeof(string),"{FFFFFF}Bienvenido a {05A3FE}MTDM.\n{FFFFFF}Esta Cuenta No Se Encuentra {6600FF}Registrada.\n{FFFFFF}Coloca Tu Contraseсa Para Registrarte."), ShowPlayerDialog(playerid, 9049, DIALOG_STYLE_INPUT, "{05A3FE}MTDM te da la Bienvenida", string, "Registrarse", "");
if (strlen(inputtext) < 4 || strlen(inputtext) > 20) return format(string,sizeof(string),"{FFFFFF}Servidor: {FE0505}Contraseсa Corta\n{FFFFFF}Ingresa una contraseсa mas larga.", nombre), ShowPlayerDialog(playerid, 9049, DIALOG_STYLE_INPUT, "{05A3FE}MTDM te da la Bienvenida", string, "Registrarse", "");
if (udb_Create(PlayerName2(playerid),inputtext))
{
new string[256],file[256],name[MAX_PLAYER_NAME], tmp3[100];
new strdate[20], year,month,day; getdate(year, month, day);
GetPlayerName(playerid,name,sizeof(name)); format(file,sizeof(file),"/ladmin/users/%s.ini",udb_encode(name));
GetPlayerIp(playerid,tmp3,100); dini_Set(file,"ip",tmp3);
// dini_Set(file,"password",params);
dUserSetINT(PlayerName2(playerid)).("registered",1);
format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year);
dini_Set(file,"RegisteredDate",strdate);
dUserSetINT(PlayerName2(playerid)).("loggedin",1);
dUserSetINT(PlayerName2(playerid)).("banned",0);
dUserSetINT(PlayerName2(playerid)).("level",0);
dUserSetINT(PlayerName2(playerid)).("LastOn",0);
dUserSetINT(PlayerName2(playerid)).("money",0);
dUserSetINT(PlayerName2(playerid)).("kills",0);
dUserSetINT(PlayerName2(playerid)).("score",0);
dUserSetINT(PlayerName2(playerid)).("deaths",0);
dUserSetINT(PlayerName2(playerid)).("hours",0);
dUserSetINT(PlayerName2(playerid)).("minutes",0);
dUserSetINT(PlayerName2(playerid)).("seconds",0);
dUserSetINT(PlayerName2(playerid)).("saw",PlayerInfo[playerid][saw]);
dUserSetINT(PlayerName2(playerid)).("sz",PlayerInfo[playerid][sz]);
dUserSetINT(PlayerName2(playerid)).("vip",0);
dUserSetINT(PlayerName2(playerid)).("Hitman",0);
PlayerInfo[playerid][LoggedIn] = 1;
PlayerInfo[playerid][Registered] = 1;
format(string,sizeof(string),"Registrado correctamente. la proxima vez que te conectes usa /login %s",params);
SendClientMessage(playerid, green, string);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GivePlayerMoney(playerid,5000);
return 1;
}
return 1;
}