Hola a todos es mi primer post por acá, me estoy adentrando a este tipo de lenguaje y viendo unos tutoriales comence a crear un sistema de registro para mi servidor, pero al acabar me salen algunos errores que no he podido encontrar, por favor necesito una ayudita.
Alguien podría ayudarme por favor :/ desde ayer estoy con este problema, estoy haciendo una gm desde cero de roleplay.
Acá mostraré un poco del codigo
Code:
error 001: expected token: ",", but found ";"
error 001: expected token: ",", but found "-string-"
warning 215: expression has no effect
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Acá mostraré un poco del codigo
Code:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
new file[50], aname[MAX_PLAYER_NAME], string[250];
GetPlayerName(playerid, aname, sizeof(aname);
format(file, sizeof(file), "cuentas/%s.ini", aname);
if(DOF2_FileExists(file))
{
//si existe
format(string, sizeof(string), "Hola %s, nos vemos denuevo!/nIngresa tu contrasena", aname);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "INGRESO", string "Aceptar", "Cancelar");
}
else
{
//si no existe
format(string, sizeof(string), "Hola %s, nos vemos denuevo!/nRegistra tu contrasena", aname);
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "REGISTRO", string "Registrar", "Cancelar");
return 1;
}
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new file[50], aname[MAX_PLAYER_NAME], string[250];
GetPlayerName(playerid, aname, sizeof(aname));
format(file, sizeof(file), "cuentas/%s.ini", aname);
if(dialogid == DIALOG_REGISTRO)
{
DOF2_CreateFile(file);
DOF2_SetString(file, "contrasena", imputtext);
DOF2_SetInt(file, "Dinero", 5000);
DOF2_SaveFile();
SendClientMessage(playerid, COLOR_NARANJA, "Cuenta registrada correctamente");
SpawnPlayer(playerid);
}
if(dialogid == DIALOG_LOGIN)
{
if(strcmp(imputtext, DOF2_GetString(file, "Contrasena"), true) == 0)
{
GivePlayerMoney(playerid, DOF2_GetInt(file, "Dinero"));
SendClientMessage(playerid, COLOR_NARANJA, "Ingreso efectuado correctamente");
SpawnPlayer(playerid);
}
else
{
Intentos[playerid]++;
if(Intentos[playerid] == 3) Kick (playerid);
format(string, sizeof(string(, "Hola %s, nos volvemos a ver/nIngresa tu contrasena");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "INGRESO", string, "Aceptar", "Cancelar");
SendClientMessage(playerid, -1, "{FF0000}Contrasena invalida!");
return 1;
}