Problem Org
#1

On the console shows that one organization has been charged and when I check the command in the game there is no organization loaded. Why?

Code:
enum eOrg {
    o_UID,
    o_Type,
    o_Name[32],
    o_Motd[128],
    o_Color,
    Float:o_Spawn[4],
    o_Int,
    o_VW
};
new OrgInfo[MAX_ORG][eOrg];

stock orgLoading()
{
	new query[500];
	mysql_format(g_SQL, query, sizeof(query), "SELECT * FROM org");
	mysql_tquery(g_SQL, query, "orgLoad");
	return 1;
}

forward orgLoad();
public orgLoad()
{
    new lQuery[256], lID, lRow;

    new results = cache_num_rows();

	if(results > 0)
	{
		for(new i = 0; i < results; i++)
		{
			sscanf(lQuery, "p<|>de<dds[32]s[128]hffffdd>", lRow, OrgInfo[lID]);
        	lID++;
		}
		printf("___ %d | Loading organization", lID);
	}
	return 1;
}

CreateTableORG()
{
	new query[1500];
	strcat(query, "CREATE TABLE IF NOT EXISTS `org` (");
	strcat(query, "`UID` INT(11) NOT NULL AUTO_INCREMENT,");
	strcat(query, "`Type` INT(11) NOT NULL DEFAULT '0',");
	strcat(query, "`Name` VARCHAR(256) NOT NULL,");
	strcat(query, "`Color` INT(11) NOT NULL DEFAULT '0',");
	strcat(query, "`x` FLOAT NOT NULL,");
	strcat(query, "`y` FLOAT NOT NULL,");
	strcat(query, "`z` FLOAT NOT NULL,");
	strcat(query, "`a` FLOAT NOT NULL,");
	strcat(query, "`Int` INT(11) NOT NULL DEFAULT '0',");
	strcat(query, "`VW` INT(11) NOT NULL DEFAULT '0',");
	strcat(query, "`Motd` VARCHAR(129) NOT NULL,");
	strcat(query, "PRIMARY KEY (`UID`), UNIQUE KEY `UID` (`UID`))");
 	mysql_tquery(g_SQL, query);
	return 1;
}
Reply
#2

You seriously need to learn pawn and sql features. You're taking our time to gave yourself answers without reading tutorials which includes required knowledge...

Code:
cache_get_value();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)