The string get shrink why?
#2

You are removing the first word by using "strtok placed in a function - godfather style", after nearly 8 years this disease isn't dead yet

Long version
pawn Код:
if(Mobile[playerid] == 2525)
        {
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GREEN, "People CNN: Ok , what is the announce??");
                return 0;
            }
            //GetPlayerName(playerid, sendername, sizeof(sendername)); // never used
            //strtok part removed
            new payout = idx * SBizzInfo[6][sbEntranceCost] * 2;
            if(GetPlayerMoney(playerid) < payout + 900)
            {
                format(string,sizeof(string), "~R~NO CASH~N~~R~(%d$ )", payout);
                GameTextForPlayer(playerid, string, 5000, 1);
                Mobile[playerid] = 255;
                return 1;
            }
            if(adds == 0) // unclear variable name
            {
                format(string,sizeof(string), "~Y~WAIT PLEASE ~R~60~Y~ SEC", payout); // payout never formated (no %d in string)
                GameTextForPlayer(playerid, string, 5000, 1);
                Mobile[playerid] = 255;
                return 1;
            }
            SafeGivePlayerMoney(playerid, - payout);
            SBizzInfo[6][sbTill] += payout;
            new stringnumar[32] = "000-000"; // why 456 cells ?
            if(PlayerInfo[playerid][pPnumber] != 0)
            {
                format(stringnumar, sizeof stringnumar, "%d", PlayerInfo[playerid][pPnumber]); // why format ? use strcat to copy a string
                strins(stringnumar, "-", 3);
            }
            new stringcnn[128]; // yeah you like the number 456
            format(stringcnn, sizeof(stringcnn), "(Anunt publicat de %s) -  %s, (Phone: %s)",  GetName(playerid), text, stringnumar);
            OOCNews(TEAM_GROVE_COLOR,stringcnn);
            format(string, sizeof(string), "~Y~Paid ~R~%d$~n~~Y~%d Characters", payout, idx);
            GameTextForPlayer(playerid, string, 5000, 4);
            SetTimer("AddsOn", addtimer, 0);
            Mobile[playerid] = 255;
            adds = 0;
        }
Short version - change in that line "result" to "text"
pawn Код:
format(stringcnn, sizeof(stringcnn), "(Anunt publicat de %s) -  %s, (Phone: %s)",  GetName(playerid), result, stringnumar);
Reply


Messages In This Thread
The string get shrink why? - by Metharon - 21.06.2015, 20:33
AW: The string get shrink why? - by Nero_3D - 21.06.2015, 21:57

Forum Jump:


Users browsing this thread: 2 Guest(s)