Jump to content

Probleme de compilare register


Emanuel

Recommended Posts

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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.