Is this good or not?
#1

Is this command is good or not if it isnt good can you make me better?

pawn Код:
if (strcmp(cmd, "/weaponskills", true)
    {
        format(string, sizeof(string), "Colt : %s", PlayerInfo[targetid][pPistSkill]);
        SendClientMessage(playerid, COLOR_WHITE,string);
        format(string, sizeof(string), "Silenced Colt : %s", PlayerInfo[targetid][pSilenSkill]);
        SendClientMessage(playerid, COLOR_GRAD2,string);
        format(string, sizeof(string), "Deagle : %s", PlayerInfo[targetid][pDesertSkill]);
        SendClientMessage(playerid, COLOR_GRAD3,string);
        format(string, sizeof(string), "Shotgun : %s", PlayerInfo[targetid][pShotgSkill]);
        SendClientMessage(playerid, COLOR_GRAD4,string);
        format(string, sizeof(string), "Sawn : %s", PlayerInfo[targetid][pSawnSkill]);
        SendClientMessage(playerid, COLOR_GRAD5,string);
        format(string, sizeof(string), "Combat : %s", PlayerInfo[targetid][pCombSkill]);
        SendClientMessage(playerid, COLOR_GRAD5,string);
        format(string, sizeof(string), "Uzi : %s", PlayerInfo[targetid][pUziSkill]);
        SendClientMessage(playerid, COLOR_GRAD5,string);
        format(string, sizeof(string), "Smg : %s", PlayerInfo[targetid][pSmgSkill]);
        SendClientMessage(playerid, COLOR_GRAD5,string);
        format(string, sizeof(string), "M4 : %s", PlayerInfo[targetid][pM4Skill]);
        SendClientMessage(playerid, COLOR_GRAD5,string);
        format(string, sizeof(string), "Ak47 : %s", PlayerInfo[targetid][pAkSkill]);
        SendClientMessage(playerid, COLOR_GRAD5,string);
    }
Sry for bad english :P
Reply
#2

Why not just format 1 string with all of these messages and create a line break(\n) in each line ?
Reply
#3

why not like this?

pawn Код:
if (strcmp(cmd, "/weaponskills", true)
{
  new string[250];
  format(string, sizeof(string), "Colt : %s\nSilenced Colt : %s\nDeagle : %s\nShotgun : %s\nSawn : %s\nCombat : %s\nUzi : %s\nSmg : %s\nM4 : %s\nAk47 : %s", PlayerInfo[targetid][pPistSkill]PlayerInfo[targetid][pSilenSkill],PlayerInfo[targetid][pDesertSkill], PlayerInfo[targetid][pShotgSkill], PlayerInfo[targetid][pSawnSkill], PlayerInfo[targetid][pCombSkill], PlayerInfo[targetid][pUziSkill], PlayerInfo[targetid][pSmgSkill], PlayerInfo[targetid][pM4Skill], PlayerInfo[targetid][pAkSkill]);
SendClientMessage(playerid, COLOR_WHITE,string);
}
Reply
#4

Thank you.
Reply
#5

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
Why not just format 1 string with all of these messages and create a line break(\n) in each line ?
SCM doesn't support line breaks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)