Little Help
#1

Hello everybody today I am working on big project but I don`t understand why my message won`t show player. I use strcat to get two strings in one but message is not showing why?
Here is the code:
pawn Код:
//First string
format(longstr, sizeof(longstr), "{BDBDBD}[Server] {FFFFFF}You used item {50A0BF}%s{FFFFFF} ({BDBDBD}ID %d{FFFFFF}) from {BDBDBD}slot %d{FFFFFF}.", InventoryItems[iItem[playerid][slot]][1], InventoryItems[iItem[playerid][slot]][0], iValue[playerid][slot], slot);
    strcat(longstr,shortstr);
    SendClientMessage(playerid, -1, longstr);

//Second String
switch(reward)
            {
                case 0:
                {
                    GivePlayerMoney(playerid,124500);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}124,500$ {FFFFFF}!");
                }
                case 1:
                {
                    GivePlayerMoney(playerid,241200);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}241,200$ {FFFFFF}!");
                }
                case 2:
                {
                    GivePlayerMoney(playerid,200012);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}200,012$ {FFFFFF}!");
                }
                case 3:
                {
                    GivePlayerMoney(playerid,212011);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}212,011$ {FFFFFF}!");
                }
                case 4:
                {
                    GivePlayerMoney(playerid,155024);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}155,024$ {FFFFFF}!");
                }
                case 5:
                {
                    GivePlayerMoney(playerid,186900);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}186,900$ {FFFFFF}!");
                }
                case 6:
                {
                    GivePlayerMoney(playerid,198000);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}198,000$ {FFFFFF}!");
                }
                case 7:
                {
                    GivePlayerMoney(playerid,201020);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}201,020$ {FFFFFF}!");
                }
                case 8:
                {
                    GivePlayerMoney(playerid,205021);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}205,021$ {FFFFFF}!");
                }
                case 9:
                {
                    GivePlayerMoney(playerid,804200);
                    format(shortstr,sizeof(shortstr),"You have claimed your money bag containing: {FFD900}804,200$ {FFFFFF}!");
                }
                   
            }
        }
Reply
#2

I see just one SendClientMessage in your code.. The one for 'longstr'
Reply
#3

asfar as I can see all you're doing is formatting it,you're never sending the actual string with SendClientMessage
Reply
#4

Quote:
Originally Posted by Smileys
Посмотреть сообщение
asfar as I can see all you're doing is formatting it,you're never sending the actual string with SendClientMessage
pawn Код:
SendClientMessage(playerid, -1, longstr);
he is.
OT: Is that SendClientMessage() function in an if-statement? if yes, show us the if().
Reply
#5

Quote:
Originally Posted by NaClchemistryK
Посмотреть сообщение
pawn Код:
SendClientMessage(playerid, -1, longstr);
he is.
OT: Is that SendClientMessage() function in an if-statement? if yes, show us the if().
No it`s not in if system..
Reply
#6

put this hwne u send client message and see if it prints or not
printf("**[DEBUG] Client message sent || Message : %s",longstr);

if it prints then see that your longstr size is very long
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)