[SOS]argument type mismatch (argument 3) and error 017: undefined symbol "mysql_query"
#1

Код:
CMD:bagitem(playerid, params[])
{
	new string[128];
	if(!CheckAdmin(playerid, HIGH_ADMIN_LEVEL)) return NotAuthMSG(playerid);
    if(sscanf(params, "dd", params[0], params[1]))
	{
 		SendClientMessage(playerid, COLOR_RED, "/bagitem [itemID] [itemAmount]");
		return 1;
	}
	if(GetBagItemCount(playerid) >= MAX_ITEMS) return SCM(playerid, COLOR_RED, "数量已经超出最大物品限制");
	format(string, sizeof(string), "%s", GetName(playerid));
	_AddDatabaseItem(params[0], params[1], string);
	LoadPlayerBag(playerid);
	SCM(playerid, COLOR_GREEN, "成功添加 !");
	return 1;
}
MySQL error:

Код:
LoadPlayerBag(playerid)
{
    for(new i = 0,j = MAX_ITEMS; i < j; i ++)
    {
        Bag[playerid][bagItemID][i] = 0;
        Bag[playerid][bagItem][i] = 0;
        Bag[playerid][bagItemAmount][i] = 0;
        Bag[playerid][bagItemLoaded][i] = 0;
        Bag[playerid][bagItemLoadAmount][i] = 0;
        Bag[playerid][bagItemServer][i] = 0;
    }
	new temp[256], id = 0;
	format(query, sizeof(query), "SELECT * FROM `bagitems` WHERE `Owner` = %d", GetName(playerid));
	mysql_query(query);
	mysql_store_result();
	if(mysql_num_rows())
	{
		while(mysql_retrieve_row())
		{
		    mysql_fetch_field_row(temp, "ID"), Bag[playerid][bagItemID][id] = strval(temp);
	    	mysql_fetch_field_row(temp, "Item"), Bag[playerid][bagItem][id] = strval(temp);
	    	mysql_fetch_field_row(temp, "ItemAmount"), Bag[playerid][bagItemAmount][id] = strval(temp);
	    	mysql_fetch_field_row(temp, "ItemLoaded"), Bag[playerid][bagItemLoaded][id] = strval(temp);
	    	mysql_fetch_field_row(temp, "ItemLoadAmount"), Bag[playerid][bagItemLoadAmount][id] = strval(temp);
	    	mysql_fetch_field_row(temp, "ItemServer"), Bag[playerid][bagItemServer][id] = strval(temp);
			id ++;
		}
	}
	mysql_free_result();
	return 1;
}
Код:
stock _AddDatabaseItem(item, amount, owner)
{
	format(query, sizeof(query), "INSERT INTO `bagitems`(`Owner`, `Item`, `ItemAmount`) VALUES (%d, %d, %d)", owner, item, amount);
	mysql_query(query);
	return 1;
}
Код:
stock _AddDatabaseItem(item, amount, owner)
{
	format(query, sizeof(query), "INSERT INTO `bagitems`(`Owner`, `Item`, `ItemAmount`) VALUES (%d, %d, %d)", owner, item, amount);
	mysql_query(query);
	return 1;
}
Код:
stock _RemoveDatabaseItem(id)
{
	format(query, sizeof(query), "DELETE FROM `bagitems` WHERE `ID` = %d", id);
	mysql_query(query);
	return 1;
}
What happened? Will you give me a help? btw, my ucp is 'big' bugged too, if you're fixs it, i can give some compensation about money.

pls...
Reply
#2

what line does the compilation appear on?
Reply
#3

//old post............

PHP код:
CMD:bagitem(playeridparams[])
{
    new 
string[128];
    if(!
CheckAdmin(playeridHIGH_ADMIN_LEVEL)) return NotAuthMSG(playerid);
    if(
sscanf(params"dd"params[0], params[1]))
    {
         
SendClientMessage(playeridCOLOR_RED"/bagitem [itemID] [itemAmount]");
        return 
1;
    }
    if(
GetBagItemCount(playerid) >= MAX_ITEMS) return SCM(playeridCOLOR_RED"数量已经超出最大物品限制");
    
//format(string, sizeof(string), "%s", GetName(playerid));
    
_AddDatabaseItem(strval(params[0]), strval(params[1]), playerid);//
    
LoadPlayerBag(playerid);
    
SCM(playeridCOLOR_GREEN"成功添加 !");
    return 
1;

PHP код:
stock _AddDatabaseItem(itemamountowner)
{
        new 
query[200];
    
format(querysizeof(query), "INSERT INTO `bagitems`(`Owner`, `Item`, `ItemAmount`) VALUES (%s, %d, %d)"GetName(owner), itemamount);
    
mysql_query(query);
    return 
1;

PHP код:
stock _RemoveDatabaseItem(id)
{
        new 
query[100];
    
format(querysizeof(query), "DELETE FROM `bagitems` WHERE `ID` = %d"id);
    
mysql_query(query);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)