Help please i get errors
#1

Код:
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(289) : warning 225: unreachable code
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(606) : error 017: undefined symbol "y"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(606) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   switch(dialogid)
    {
        case dlogin:
        {
            if(!response) Kick(playerid);
            new hpass[129];
            new query[100]; y.
            WP_Hash(hpass, 129, inputtext);
            if(!strcmp(hpass, pInfo[playerid][Password]))
            {
                mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
                mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
            }
            else
            {
                ShowPlayerDialog(playerid, dlogin, DIALOG_STYLE_INPUT, "Login", "In order to play, you need to login\nWrong password!", "Login", "Quit");
            }
        }
        case dregister:
        {
            if(!response) return Kick(playerid);
            if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, dregister, DIALOG_STYLE_INPUT, "Register", "In order to play, you need to register.\nYour password must be at least 6 characters long!", "Register", "Quit");
            new query[300];
            WP_Hash(pInfo[playerid][Password], 129, inputtext);
            mysql_format(mysql, query, sizeof(query), "INSERT INTO `players` (`Username`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `PosX` ,`PosY`, `PosZ`) VALUES ('%e', '%s', '%s', 0, 0, 0, 0.0, 0.0, 0.0)", Name[playerid], pInfo[playerid][Password], IP[playerid]);
            mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);
        }
    }
   return 1;
}
Reply
#2

Remove the "y." next to new "query[100];"

And where is line 289?
Reply
#3

Код:
 IsPlayerPolice[playerid] = 0;
Or should i show all the code
Reply
#4

Show me 5 lines above that line.
Reply
#5

post code after and before line 289
Reply
#6

pawn Код:
forward OnAccountCheck(playerid);
public OnAccountCheck(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields, mysql);
    if(rows)
    {
        cache_get_field_content(0, "PASS", pInfo[playerid][Password], mysql, 129);
        pInfo[playerid][ID] = cache_get_field_content_int(0, "ID");
        printf("%s", pInfo[playerid][Password]);
        ShowPlayerDialog(playerid, dlogin, DIALOG_STYLE_INPUT, "Login", "Welcome Back! Please Login.", "Login", "Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, dregister, DIALOG_STYLE_INPUT, "Register", "Welcome to LSCNR, If you want to play you have to register", "Register", "Quit");
        }
    return 1;

    IsPlayerPolice[playerid] = 0;//<<<<<<<<<<<<
    return 1;
}
Reply
#7

pawn Код:
forward OnAccountCheck(playerid);
public OnAccountCheck(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields, mysql);
    if(rows)
    {
        cache_get_field_content(0, "PASS", pInfo[playerid][Password], mysql, 129);
        pInfo[playerid][ID] = cache_get_field_content_int(0, "ID");
        printf("%s", pInfo[playerid][Password]);
        ShowPlayerDialog(playerid, dlogin, DIALOG_STYLE_INPUT, "Login", "Welcome Back! Please Login.", "Login", "Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, dregister, DIALOG_STYLE_INPUT, "Register", "Welcome to LSCNR, If you want to play you have to register", "Register", "Quit");
    }
    IsPlayerPolice[playerid] = 0;//<<<<<<<<<<<<
    return 1;
}
Reply
#8

Thanks and by you know where do i put this ?

pawn Код:
forward OnAccountLoad(playerid);
forward OnAccountRegister(playerid);
public OnAccountLoad(playerid)
{
    pInfo[playerid][Admin] = cache_get_field_content_int(0, "Admin");
    pInfo[playerid][VIP] = cache_get_field_content_int(0, "VIP");
    pInfo[playerid][Money] = cache_get_field_content_int(0, "Money");
    pInfo[playerid][posX] = cache_get_field_content_float(0, "PosX");
    pInfo[playerid][posY] = cache_get_field_content_float(0, "PosY");
    pInfo[playerid][posZ] = cache_get_field_content_float(0, "PosZ");

    GivePlayerMoney(playerid, pInfo[playerid][Money]);
    SendClientMessage(playerid, -1, "Successfully logged in");
    return 1;
}

public OnAccountRegister(playerid)
{
    pInfo[playerid][ID] = cache_insert_id();
    printf("New account registered. ID: %d", pInfo[playerid][ID]);
    return 1;
}
}
Reply
#9

pawn Код:
OnAccountLoad(playerid); // Add this at your login dialog response if player successfully logged in

pawn Код:
OnAccountRegister(playerid); // add this at your register dialog response if player successfully registered
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)