Jump to content

Recommended Posts

Posted

D:\Server\Gaemode 0\gamemodes\GMMINCEPUT.pwn(73) : error 017: undefined symbol "pSQLID"
D:\Server\Gaemode 0\gamemodes\GMMINCEPUT.pwn(74) : error 017: undefined symbol "pSQLID"

Acesta sunt erorile care mile ofera.

Quote

 

#include <a_samp>

#include <a_mysql>
new SQL = -1, gQuery[256];

#define function%0(%1)    forward %0(%1); public %0(%1)

enum pInfo {
    pSQLD,
    pName[MAX_PLAYER_NAME],
    pPassword[32],
    pEmail[32],
    pGender
}
new PlayerInfo[MAX_PLAYERS][pInfo];

enum {
    // Register
    DIALOG_REGISTER,
    DIALOG_EMAIL,
    DIALOG_GENDER,

    // Login
    DIALOG_LOGIN
}

main() { print("Incercare qEmanuel Gamemodeqemanuel!"); }


public OnGameModeInit()
{
    SQL = mysql_connect("localhost", "root", "inceput_db", "");

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

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);
    return 1;
}

public OnPlayerConnect(playerid) {
    gQuery[0] = EOS;
    mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM 'users' WHERE 'Name'= %s LIMIT 1", GetName(playerid));
    mysql_tquery(SQL, gQuery, "checkAccont", "i", playerid);
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    switch(dialogid) {
        case DIALOG_REGISTER: {
            if(!response) 
                return Kick(playerid);

            if(strlen(inputtext) < 6 || strlen(inputtext) > 32)
                return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Scrie o parola pentru a te puta inregistra (Minim 6 caractere / maxim 32):", "Select", "Canel");

                gQuery[0] = EOS;
                mysql_format(SQL, gQuery, sizeof(gQuery), "INSER INTO 'users' ('Name', 'Pasword') VALUES ('%s, '%s')", GetName(playerid), inputtext);
                mysql_tquery(SQL, gQuery, "insertAccount", "i", playerid);
        }
    }
    return 1;
}

function insertAccount(playerid){
    PlayerInfo[playerid][pSQLID] = cache_insert_id();
    printf("%s s-a inregistrat cu SQLID-ul #%d.", GetName(playerid), PlayerInfo[playerid][pSQLID]);
    return 1;
}

function checkAccont(playerid){
    switch(cache_num_rows()) {
        case 0:    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Scrie o parola pentru a te puta inregistra (Minim 6 caractere / maxim 32):", "Select", "Canel");
        case 1: ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Scrie parola pentru a te putea juca:", "Select", "Canel");
    }
    return 1;
}


stock GetName(playerid) {
    new playerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
    return playerName;
}

 

Va rog ajutor

 

Posted
5 hours ago, LaZ said:

Mesajul de eroare îți spune că field-ul pSQLID nu există (undefined) în pInfo.

Si ce as putea face? ca mna sunt mai nou in script l-am intrebat si pe HPQ123 si pnm el mia raspuns da nus pnm sa fac

Posted (edited)
6 minutes ago, Emanuel said:

Si ce as putea face? ca mna sunt mai nou in script l-am intrebat si pe HPQ123 si pnm el mia raspuns da nus pnm sa fac

Sub enum pInfo înlocuiește pSQLD cu pSQLID.

Edited by LaZ

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.