Jump to content
  • 0

Erroare la Compilare


Stefan Alin

Question

Problema intalnita (descriere): Am facut un sistem de Inregistrare/Logare pe Dini si cand am dat compilare imi aparea eroarea din poza
Ero(area / rile) / warning-(ul / urile):F1030r1030titlu_zps2d3ae7ca.png
Liniile de cod / sursa / script-ul: 
Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Da

Edited by Stefan Alin
Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <dini>
new Text:buggedcopie;
new Dialog_inregistrat
#if defined FILTERSCRIPT

    enum
{
    DIALOG_INREGISTRAT = 5,// 5 este numarul dialogului
    DIALOG_LOGIN //va avea id-ul 6
}

    enum pData
{
    oras[30],
    varsta,
    sex[20],
    logged,
}
    new P_Data[MAX_PLAYERS][pData];
    new incercari[MAX_PLAYERS];

public OnFilterScriptInit()
{
	print("n--------------------------------------");
	print(" Obsed RPG");
	print("--------------------------------------n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("n----------------------------------");
	print(" Obsed RPG");
	print("----------------------------------n");
}

#endif

public OnGameModeInit()
{
    buggedcopie = TextDrawCreate(580.000000, 429.000000, "OBSED RPG");
    TextDrawBackgroundColor(buggedcopie, 255);
    TextDrawFont(buggedcopie, 2);
    TextDrawLetterSize(buggedcopie, 0.250000, 2.000000);
    TextDrawColor(buggedcopie, -1);
    TextDrawSetOutline(buggedcopie, 1);
    TextDrawSetProportional(buggedcopie, 1);
    TextDrawSetSelectable(buggedcopie, 0);

	// Don't use these lines if it's a filterscript
	SetGameModeText("OBSED RPG");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    new file[20+MAX_PLAYER_NAME];
    format(file,sizeof(file),"/Jucatori/%s.ini", pName(playerid));//vom stoca in variabila file, locul unde se afla fisierul jucatorului
    incercari[playerid] = 0;
    if(!dini_Exists(file))
}
    //daca jucatorul nu este inregistrat
    ShowPlayerDialog(playerid, DIALOG_INREGISTRAT, DIALOG_STYLE_INPUT, "Inregistrare", "Scrieti parola pentru a te inregistra", "OK", "Cancel");
}
    else
{
    //daca jucatorul este inregistrat
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Logare", "Scrieti parola pentru a te loga", "OK", "Cancel");
}

	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
    new file[20+MAX_PLAYER_NAME];
    format(file, sizeof(file), "/Jucatori/%s.ini", pName(playerid));//vom stoca in variabila file, locul unde se afla fisierul jucatorului
    incercari[playerid] = 0;
    if(!dini_Exists(file))
{
    //daca jucatorul nu este inregistrat
    ShowPlayerDialog(playerid, DIALOG_INREGISTRAT, DIALOG_STYLE_INPUT, "Inregistrare", "Scrieti parola pentru a te inregistra", "OK", "Cancel");
}
    else
{
    //daca jucatorul este inregistrat
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Logare", "Scrieti parola pentru a te loga", "OK", "Cancel");
}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
    new file[20+MAX_PLAYER_NAME];
    format(file, sizeof(file), "/Jucatori/%s.ini", pName(playerid));//vom stoca in variabila file, locul unde se afla fisierul jucatorului
    incercari[playerid] = 0;
    if(!dini_Exists(file))
{
    //daca jucatorul nu este inregistrat
    ShowPlayerDialog(playerid, DIALOG_INREGISTRAT, DIALOG_STYLE_INPUT, "Inregistrare", "Scrieti parola pentru a te inregistra", "OK", "Cancel");
}
    else
{
    //daca jucatorul este inregistrat
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Logare", "Scrieti parola pentru a te loga", "OK", "Cancel");
}
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public  OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    newfile[20+MAX_PLAYER_NAME];
    format(file, sizeof(file), "/Jucatori/%s.ini", pName(playerid));

switch(dialogid)
{
    case DIALOG_INREGISTRAT:
{
    if(!response) return Kick(playerid);//daca va da cancel ii vom da kick
    else
{
    new pwlength = strlen(inputtext);
    if(pwlength > 3)//daca parola are mai mult de 3 caractere
{
    dini_Create(file); //vom creea fisierul
    dini_Set(file, "parola", inputtext);//vom seta parola
    dini_Set(file, "oras", "Los Santos"); //vom seta orasul
    dini_IntSet(file, "varsta", 0);//vom seta varsta
    dini_Set(file, "sex", "Barbat");//vom seta sex-ul
    P_Data[playerid][logged] = 1;
    SpawnPlayer(playerid);
}
else
{
    ShowPlayerDialog(playerid, DIALOG_INREGISTRAT, DIALOG_STYLE_MSGBOX, "Inregistrare", "Trebuie sa introduci o parola!", "OK", "Cancel");
}
}
}
    case DIALOG_LOGIN:
{
    if(!response) Kick(playerid);
    else
{
    incercari[playerid]++;
    if(incercari[playerid] == 3) return Kick(playerid);
    new pwlength = strlen(inputtext);
    if(pwlength > 3)
{
    new pw[200];
    format(pw, sizeof(pw), "%s", dini_Get(file, "parola");//stocam parola in variabila pw
    if(strcmp(inputtext, pw) == 0)
{
    format(P_Data[MAX_PLAYERS][oras], 30, dini_Get(file, "oras");
    P_Data[playerid][varsta] = dini_Get(file, "varsta");
    format(P_Data[MAX_PLAYERS][sex], 20, dini_Get(file, "sex");
    P_Data[playerid][logged] = 1;
    SpawnPlayer(playerid);
}
    else
{
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_MSGBOX, "Login", "Parola Gresita!", "OK", "Cancel");
}
}
    else
{
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_MSGBOX,"Login", "Trebuie sa introduci o parola", "OK", "Cancel");
}
}
}
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}

    stock pName(playerid)
{
    new nume[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nume, sizeof(nume));
    return nume;
}
Link to comment
Share on other sites

  • 0

Pune cum a spus Night cu #define DIALOG_INREGISTRAT 5 la fel si dialog login

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.