25.01.2015, 22:25
Quote:
Bien, supongo que tendrбs el script de registro/login dentro del callback OnPlayerConnect u OnPlayerRequestClass.
Bien, tendrбs que cambiar de lugar ese script de registro al callback OnPlayerSpawn, un ejemplo de donde irнa y lo que tendrнas que hacer: pawn Код:
|
pawn Код:
public Cuenta(playerid)
{
new PlayerName[MAX_PLAYER_NAME], string[128], file[256], tmp3[50];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
new pame[MAX_PLAYER_NAME];
GetPlayerName(playerid, pame, sizeof(pame));
new dialogstr[270];
SetPlayerTime(playerid, 12, 0);
//SetPlayerAttachedObject( playerid, 0, 18864, 1, 0.000000, 0.000000, 0.000000, 0.000000, 90.000000, 0.000000, 1.000000, 1.000000, 1.000000 );//nieve cae
//SetPlayerPos(playerid, 2037.9799,1342.7332,10.6719); // importante para que cargue el mapa
//SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid, 2090.2927,1293.2604,10.8128); // importante para que cargue el mapa
InterpolateCameraPos(playerid, 2349.223632, 1285.237426, 105.555534, 2045.112670, 1322.838256, 18.549226, 10000);
InterpolateCameraLookAt(playerid, 2344.918701, 1286.464843, 103.328094, 2042.972534, 1327.138671, 17.161443, 10000);
if(!udb_Exists(PlayerName2(playerid))) format(dialogstr,sizeof(dialogstr),"{FFFFFF}Hola! {0080FF}%s:\n\n{FFFFFF}Registrate para cargar tus estadisticas:\n\nArmas\n\nDinero\n\nScore\n\nIngresa una {0080FF}Contraseсa:", pame), ShowPlayerDialog(playerid,9049,DIALOG_STYLE_PASSWORD, "{FFFFFF}|| REGISTRO ||", dialogstr, "Registrar", "");
else
{
PlayerInfo[playerid][Registered] = 1;
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName));
new tmp2[256]; tmp2 = dini_Get(file,"ip");
if( (!strcmp(tmp3,tmp2,true)) && (ServerInfo[AutoLogin] == 8) )
{
LoginPlayer(playerid);
if(PlayerInfo[playerid][Level] >= 8)
{
format(string,sizeof(string),"[CUENTA]: Has sido automбticamente logueado. [NivelAdmin: %d] [Vip: %d] [Nivel: %d]", PlayerInfo[playerid][Level],PlayerInfo[playerid][pVip], PlayerInfo[playerid][Nivel] );
SendClientMessage(playerid,green,string);
}
else format(string,sizeof(string),"[CUENTA]: Has sido automбticamente logueado. [NivelAdmin: %d] [Vip: %d] [Nivel: %d]", PlayerInfo[playerid][Level],PlayerInfo[playerid][pVip], PlayerInfo[playerid][Nivel] ); SendClientMessage(playerid,orange,string);
}
else format(dialogstr,sizeof(dialogstr),"{FFFFFF}Bienvenido {0080FF}%s {FFFFFF}al server\n\n{FFFFFF}Ingresa tu {0080FF}Contraseсa \n\n{FFFFFF}Para Poder Empezar Ha Jugar Y Divertirte:", pame), ShowPlayerDialog(playerid, 9048, DIALOG_STYLE_PASSWORD, "{FFFFFF}SERVER", dialogstr, "Entrar", "");
}
return 1;
}