CMD:empresainfo(playerid,params[]) { new string[1500]; for(new c = 0; c < MAX_PROPIEDADES; c++) { if(IsPlayerInRangeOfPoint(playerid,2.5,PropInfo[c][pPosX],PropInfo[c][pPosY],PropInfo[c][pPosZ])) { format(string, 1500, "{FF0000}Empresa {FFFFFF}ID - %d {FFFFFF}", PropInfo[c][pID]); format(string, 1500, "\n{FF0000}Propietбrio(a) - {FFFFFF}%s {FFFFFF}", PropInfo[c][pPropietario]); if(strcmp(PropInfo[c][pFunc], "Ninguem", false)) { format(string, 1500, "\n{009EFF}Funcionбrio(a) 1 - {FFFFFF}Ninguйm"); } else { format(string, 1500, "\n{009EFF}Funcionбrio(a) 1 - {FFFFFF}%s", PropInfo[c][pFunc]); } if(strcmp(PropInfo[c][pFunc1], "Ninguem", false)) { format(string, 1500, "\n{009EFF}Funcionбrio(a) 2 - {FFFFFF}Ninguйm"); } else { format(string, 1500, "\n{009EFF}Funcionбrio(a) 2 - {FFFFFF}%s", PropInfo[c][pFunc1]); } if(strcmp(PropInfo[c][pFunc2], "Ninguem", false)) { format(string, 1500, "\n{009EFF}Funcionбrio(a) 3 -{FFFFFF}Ninguйm"); } else { format(string, 1500, "\n{009EFF}Funcionбrio(a) 3 - {FFFFFF}%s", PropInfo[c][pFunc2]); } if(strcmp(PropInfo[c][pFunc3], "Ninguem", false)) { format(string, 1500, "\n{009EFF}Funcionбrio(a) 4 -{FFFFFF}Ninguйm"); } else { format(string, 1500, "\n{009EFF}Funcionбrio(a) 4 - {FFFFFF}%s", PropInfo[c][pFunc3]); } ShowPlayerDialog(playerid, EMPINFO, DIALOG_STYLE_MSGBOX, "{FFFFFF}Informaзхes da empresa", string, "OK", ""); break; } } return 1; }
Use strcat.
Vocк tб formatando sempre a string, por isso sу exibe a ъltima. |
CMD:empresainfo(playerid,params[]) { new string[1200],string2[1250]; for(new c = 0; c < MAX_PROPIEDADES; c++) { if(IsPlayerInRangeOfPoint(playerid,2.5,PropInfo[c][pPosX],PropInfo[c][pPosY],PropInfo[c][pPosZ])) { format(string,sizeof(string), "{FF0000}Empresa {FFFFFF}ID - %d {FFFFFF}", PropInfo[c][pID]); strcat(string2,string); format(string,sizeof(string), "\n{FF0000}Propietбrio(a) - {FFFFFF}%s {FFFFFF}", PropInfo[c][pPropietario]); strcat(string2,string); if(strcmp(PropInfo[c][pFunc], "Ninguem", false)) { format(string,sizeof(string), "\n{009EFF}Funcionбrio(a) 1 - {FFFFFF}Ninguйm"); } else { format(string,sizeof(string), "\n{009EFF}Funcionбrio(a) 1 - {FFFFFF}%s", PropInfo[c][pFunc]); strcat(string2,string); } if(strcmp(PropInfo[c][pFunc1], "Ninguem", false)) { format(string,sizeof(string), "\n{009EFF}Funcionбrio(a) 2 - {FFFFFF}Ninguйm"); } else { format(string,sizeof(string), "\n{009EFF}Funcionбrio(a) 2 - {FFFFFF}%s", PropInfo[c][pFunc1]); strcat(string2,string); } if(strcmp(PropInfo[c][pFunc2], "Ninguem", false)) { format(string,sizeof(string), "\n{009EFF}Funcionбrio(a) 3 -{FFFFFF}Ninguйm"); } else { format(string,sizeof(string), "\n{009EFF}Funcionбrio(a) 3 - {FFFFFF}%s", PropInfo[c][pFunc2]); strcat(string2,string); } if(strcmp(PropInfo[c][pFunc3], "Ninguem", false)) { format(string,sizeof(string), "\n{009EFF}Funcionбrio(a) 4 -{FFFFFF}Ninguйm"); } else { format(string,sizeof(string), "\n{009EFF}Funcionбrio(a) 4 - {FFFFFF}%s", PropInfo[c][pFunc3]); strcat(string2,string); } ShowPlayerDialog(playerid, EMPINFO, DIALOG_STYLE_MSGBOX, "{FFFFFF}Informaзхes da empresa", string2, "OK", ""); break; } } return 1; }