18.01.2016, 20:14
Hello my usernick is Jasta and I have a short question, Is the code right?:
I have a problem that points below.
I have a problem that points below.
Код:
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; }