mysql problem
#1

Hello, im trying to make a few systems MySQL currently i'm using R6 and the following code aren't in the R6 MySQL but I have no idea to fix this.

Код:
forward OnLoadDynamicMapIcon(index);
public OnLoadDynamicMapIcon(index)
{
	new string[256];
	new rows, fields;
	cache_get_data(rows, fields, MainPipeline);
 	for(new field;field<fields;field++)
	{
  		cache_get_row(index, field, string, MainPipeline);
		switch(field)
		{
			case 0: DMPInfo[index][dmpSQLId] = strval(string);
			case 1: DMPInfo[index][dmpMarkerType] = strval(string);
			case 2: DMPInfo[index][dmpColor] = strval(string);
			case 3: DMPInfo[index][dmpVW] = strval(string);
			case 4: DMPInfo[index][dmpInt] = strval(string);
			case 5: DMPInfo[index][dmpPosX] = floatstr(string);
			case 6: DMPInfo[index][dmpPosY] = floatstr(string);
			case 7: DMPInfo[index][dmpPosZ] = floatstr(string);
		}
	}
  	if(DMPInfo[index][dmpMarkerType] != 0) DMPInfo[index][dmpMapIconID] = CreateDynamicMapIcon(DMPInfo[index][dmpPosX], DMPInfo[index][dmpPosY], DMPInfo[index][dmpPosZ], DMPInfo[index][dmpMarkerType], DMPInfo[index][dmpColor], DMPInfo[index][dmpVW], DMPInfo[index][dmpInt], -1, 500.0);
  	return 1;
}

stock LoadDynamicMapIcons()
{
	printf("[LoadDynamicMapIcons] Loading data from database...");
	mysql_query(MainPipeline, "SELECT * FROM `dmapicons`", true, "OnLoadDynamicMapIcons", "");
}

forward OnLoadDynamicMapIcons();
public OnLoadDynamicMapIcons()
{
	new string[256], iIndex = 0;
    new rows, fields;
	cache_get_data(rows, fields, MainPipeline);
	while(iIndex<rows)
	{
		for(new field;field<fields;field++)
		{
		    cache_get_row(iIndex, field, string, MainPipeline);
			switch(field)
			{
				case 0: DMPInfo[iIndex][dmpSQLId] = strval(string);
				case 1: DMPInfo[iIndex][dmpMarkerType] = strval(string);
				case 2: DMPInfo[iIndex][dmpColor] = strval(string);
				case 3: DMPInfo[iIndex][dmpVW] = strval(string);
				case 4: DMPInfo[iIndex][dmpInt] = strval(string);
				case 5: DMPInfo[iIndex][dmpPosX] = floatstr(string);
				case 6: DMPInfo[iIndex][dmpPosY] = floatstr(string);
				case 7: DMPInfo[iIndex][dmpPosZ] = floatstr(string);
			}
		}
        if(DMPInfo[iIndex][dmpMarkerType] != 0) DMPInfo[iIndex][dmpMapIconID] = CreateDynamicMapIcon(DMPInfo[iIndex][dmpPosX], DMPInfo[iIndex][dmpPosY], DMPInfo[iIndex][dmpPosZ], DMPInfo[iIndex][dmpMarkerType], DMPInfo[iIndex][dmpColor], DMPInfo[iIndex][dmpVW], DMPInfo[iIndex][dmpInt], -1, 500.0);
		iIndex++;
	}
	if(iIndex > 0) printf("[LoadDynamicMapIcons] %d map icons rehashed/loaded.", iIndex);
	else printf("[LoadDynamicMapIcons] Failed to load any map icons.");
	return 1;
}
How can I let this fix without using
PHP код:
cache_get_data
cache_get_row 
Those functions are in MySQL R33 but Im using R6 and want to stay at this plugin.
Please do not send me to any wiki page, I have been trying to fix this for about 4 or 5 hours...
Reply
#2

anyone ?
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=404546

In this link you will see how to change from R6 to R7. Just do the other way around.
Reply
#4

Quote:
Originally Posted by zPain
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=404546

In this link you will see how to change from R6 to R7. Just do the other way around.
i do not want to change, just tell me how I can edit this to the functions that R6 has.
Reply
#5

You should review what I said.

Quote:

"In this link you will see how to change from R6 to R7. Just do the other way around."

In the first post, there's a code with R6 functions. In the reply, there's a code showing how to make the convertion to R7. You just have to do the opposite.
Reply
#6

Check this may help you

https://sampforum.blast.hk/showthread.php?tid=337810
Reply
#7

Quote:
Originally Posted by Slawiii
Посмотреть сообщение

Please do not send me to any wiki page, I have been trying to fix this for about 4 or 5 hours...

That now around 8 hours...
Reply
#8

is anyone able to edit my code and add the good functions ?
Reply
#9

Anyone ?
Reply
#10

I think zPain answered to your question already
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)