Una duda, Error
#1

Holas a todos, tengo un pequeсo problema y pues basicamente no sй si esto sea posible pero me tira un error, (4 errores en la misma linea), este es mi code:

Код:
stock implodeTextVehicle(playerid, pvInfo: enum_tt, type_v, type_tt = 0)
{
	new string2[MAX_PLAYERVEHICLES*(14*MAX_MODS)];
	switch(type_tt)
	{
	    case 0:
	    {
		    new string[MAX_PLAYERVEHICLES][14*MAX_MODS], count;

		    while(count < MAX_PLAYERVEHICLES)
		    {
		        switch(type_v)
		        {
		            case 's':
		            {
						format(string[count], MAX_MODS*14, "%s", PlayerVehicleInfo[playerid][count][enum_tt]);
					}
					case 'i','d':
					{
						new count2, string3[14*MAX_MODS];
						while(count2 < MAX_MODS)
						{
						    if(count2 < MAX_MODS-1){
								format(string3, sizeof(string3), "%s%i|", string3, PlayerVehicleInfo[playerid][count][enum_tt][count2]); // THIS IS THE PROBLEM.
						    }
						    else
						    {
								format(string3, sizeof(string3), "%s%i", string3, PlayerVehicleInfo[playerid][count][enum_tt][count2]);
						    }
						}
						format(string[count], MAX_MODS*14, "[%s]", string3);
					}
					case 'f':
					{
						new count2, string3[14*MAX_MODS];
						while(count2 < MAX_MODS)
						{
						    if(count2 < MAX_MODS-1)
						    {
								format(string3, sizeof(string3), "%s%f,", string3, PlayerVehicleInfo[playerid][count][enum_tt][count2]);
						    }
						    else
						    {
								format(string3, sizeof(string3), "%s%f", string3, PlayerVehicleInfo[playerid][count][enum_tt][count2]);
						    }
						}
						format(string[count], MAX_MODS*14, "[%s]", string3);
					}
				}
		        count++;
		    }
			string2 = implode(string, ",");
			//return string2;
		}
		case 1:
	    {
		    new string[MAX_PLAYERVEHICLES][14*3], count;

		    while(count < MAX_PLAYERVEHICLES)
		    {
		        switch(type_v)
		        {
		            case 's':
		            {
						format(string[count], 3*14, "%s", PlayerVehicleInfo[playerid][count][enum_tt]);
					}
					case 'i','d':
					{
						new count2, string3[14*3];
						format(string3, sizeof(string3), "[");
						while(count2 < 3)
						{
						    if(count2 < 3-1){
								format(string3, sizeof(string3), "%s%i|", string3, PlayerVehicleInfo[playerid][count][enum_tt][count2]);
						    }
						    else
						    {
								format(string3, sizeof(string3), "%s%i", string3, PlayerVehicleInfo[playerid][count][enum_tt][count2]);
						    }
						}
						format(string3, sizeof(string3), "%s]", string3);
						format(string[count], 3*14, "%s", string3);
					}
					case 'f':
					{
						new count2, string3[14*3];
						format(string3, sizeof(string3), "[");
						while(count2 < 3)
						{
						    if(count2 < 3-1)
						    {
								format(string3, sizeof(string3), "%s%f,", string3, PlayerVehicleInfo[playerid][count][enum_tt][count2]);
						    }
						    else
						    {
								format(string3, sizeof(string3), "%s%f", string3, PlayerVehicleInfo[playerid][count][enum_tt][count2]);
						    }
						}
						format(string3, sizeof(string3), "%s]", string3);
						format(string[count], 3*14, "%s", string3);
					}
				}
		        count++;
		    }
			string2 = implode(string, ",");
			//return string2;
		}

		case 2:
	    {
		    new string[MAX_PLAYERVEHICLES][14*1], count;

		    while(count < MAX_PLAYERVEHICLES)
		    {
		        switch(type_v)
		        {
		            case 's':
		            {
						format(string[count], 1*14, "%s", PlayerVehicleInfo[playerid][count][enum_tt]);
					}
					case 'i','d':
					{
						format(string[count], 1*14, "%i", PlayerVehicleInfo[playerid][count][enum_tt]);
					}
					case 'f':
					{
						format(string[count], 1*14, "%f", PlayerVehicleInfo[playerid][count][enum_tt]);
					}
				}
		        count++;
		    }
			string2 = implode(string, ",");
			//return string2;
		}
	}
	return string2;
}
lo que hace esta funciуn (que yo hice) es algo simple, solo coge y un valor lo almacena y separa en varias secciones, para subir a Mysql y no tener que crear tantas columnas nuevas.

EDIT: Cuando la variable es de una dimensiуn (en el mysql) se separan con "," y si son de dos dimensiones se separan con "|" empaquetadas entre "[]"
Reply
#2

y cuales son los errores que te tira?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)