#1

getting 2 errors :
Код:
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(236) : warning 217: loose indentation
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(248) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(273) : warning 217: loose indentation
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(280) : warning 217: loose indentation
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(285) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(287) : warning 217: loose indentation
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(481) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Код:
public OnPlayerConnect(playerid)
{
mysql_format(1, query, "SELECT * FROM `players` WHERE `Name` = '%e' LIMIT 0,1", GetName(playerid));
mysql_function_query(1, query, true, "CheckPlayer", "i", playerid);
return 1;
}

// Kijkt of iemand in de database staat Vervolgens inloggen of registreren
forward CheckPlayer(playerid);
public CheckPlayer(playerid)
{
new rows, fields, string[128];
cache_get_data(rows, fields);
if(!rows)
{
format(string, sizeof(string), "{FFFFFF}Welcome {A3FF00}%s{FFFFFF} on my server. Input your password and register account.", GetName(playerid));
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "Registration", string, "Registration", "Quit");
        }
        else
        {
new temp[12];
cache_get_row(0, 1, temp); PlayerInfo[playerid][pSQLid] = strval(temp);
cache_get_row(0, 2, PlayerInfo[playerid][pPass]);
cache_get_row(0, 3, temp); PlayerInfo[playerid][pMoney] = strval(temp);
format(string, sizeof(string), "{FFFFFF}Welcome back {A3FF00}%s{FFFFFF}, your account is ready for use. Input your password and login.", GetName(playerid)); 
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Login", string, "Login", "Quit");
        }
        return 1;
}
//Maakt een row aan met account info en zet die vervolgens in de database
forward OnAccountCreate(playerid);
public OnAccountCreate(playerid)
{
    PlayerInfo[playerid][pSQLid] = mysql_insert_id();
        return 1;
}
	//als iemand disconnect Shit opslaan in de database
	public OnPlayerDisconnect(playerid, reason)
{
mysql_format(1, query, "UPDATE `players` SET `Money` = '%d' WHERE `Name` = '%e' LIMIT 1", GetPlayerMoney(playerid), GetName(playerid)); 
mysql_function_query(1, query, false, "", "");
        return 1;
}
I do not understand the errors
But they are on the following lines;
Код:
mysql_format(1, query, "SELECT * FROM `players` WHERE `Name` = '%e' LIMIT 0,1", GetName(playerid));
mysql_format(1, query, "UPDATE `players` SET `Money` = '%d' WHERE `Name` = '%e' LIMIT 1", GetPlayerMoney(playerid), GetName(playerid));
Reply
#2

Fuck, your indentation is horrible and I hope you do have MySQL Experience the one you just did is totally WRONG not in MySQL but in your CALLBACKS

Fixed
pawn Код:
public OnPlayerConnect(playerid)
{
    mysql_format(1, query, "SELECT * FROM `players` WHERE `Name` = '%e' LIMIT 0,1", GetName(playerid));
    mysql_function_query(1, query, true, "CheckPlayer", "i", playerid);
    return 1;
}

// Kijkt of iemand in de database staat Vervolgens inloggen of registreren
forward CheckPlayer(playerid);
public CheckPlayer(playerid)
{
    new rows, fields, string[128];
    cache_get_data(rows, fields);
    if(!rows)
    {
        format(string, sizeof(string), "{FFFFFF}Welcome {A3FF00}%s{FFFFFF} on my server. Input your password and register account.", GetName(playerid));
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "Registration", string, "Registration", "Quit");
    }
    else
    {
        new temp[12];
        cache_get_row(0, 1, temp); PlayerInfo[playerid][pSQLid] = strval(temp);
        cache_get_row(0, 2, PlayerInfo[playerid][pPass]);
        cache_get_row(0, 3, temp); PlayerInfo[playerid][pMoney] = strval(temp);
        format(string, sizeof(string), "{FFFFFF}Welcome back {A3FF00}%s{FFFFFF}, your account is ready for use. Input your password and login.", GetName(playerid)); //<---one here
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Login", string, "Login", "Quit");
    }
    return 1;
}

//Maakt een row aan met account info en zet die vervolgens in de database
forward OnAccountCreate(playerid);
public OnAccountCreate(playerid)
{
    PlayerInfo[playerid][pSQLid] = mysql_insert_id();
    return 1;
}

//als iemand disconnect Shit opslaan in de database
public OnPlayerDisconnect(playerid, reason)
{
    mysql_format(1, query, "UPDATE `players` SET `Money` = '%d' WHERE `Name` = '%e' LIMIT 1", GetPlayerMoney(playerid), GetName(playerid)); //<-- one error here
    mysql_function_query(1, query, false, "", "");
    return 1;
}
Reply
#3

Fixed that already but still getting
Код:
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(248) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\Administrator\桌面\FCRP.pwn(287) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664
Anyone any idea on how to fix those?
Reply
#4

And the code from those lines is?
Reply
#5

Код:
mysql_format(1, query, "SELECT * FROM `players` WHERE `Name` = '%e' LIMIT 0,1", GetName(playerid));
mysql_format(1, query, "UPDATE `players` SET `Money` = '%d' WHERE `Name` = '%e' LIMIT 1", GetPlayerMoney(playerid), GetName(playerid));
Reply
#6

The lenght was missing.
pawn Код:
mysql_format(1, query, sizeof(query), "SELECT * FROM `players` WHERE `Name` = '%e' LIMIT 0,1", GetName(playerid));
mysql_format(1, query, sizeof(query), "UPDATE `players` SET `Money` = '%d' WHERE `Name` = '%e' LIMIT 1", GetPlayerMoney(playerid), GetName(playerid));
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)