WHAT THE HELL IS WRONG
#1





If you're going to ask for the code, the code is right
Reply
#2

Can u give more details?

And we cannot see ur code from our mind, though
Reply
#3

WHAT THE HELL IS THE MISTAKE THERE, WHAT DO YOU WANT TO FIX AND STOP USING CAPS.

Give us the code and tell us what to do and what is the mistake.
Reply
#4

Quote:
Originally Posted by TahaAsif12
Посмотреть сообщение
Can u give more details?

And we cannot see ur code from our mind, though
Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
WHAT THE HELL IS THE MISTAKE THERE, WHAT DO YOU WANT TO FIX AND STOP USING CAPS.

Give us the code and tell us what to do and what is the mistake.
The fact that the colours in the two highlighted squares are the wrong way around.
Reply
#5

Quote:
Originally Posted by SlonCHL
Посмотреть сообщение
If you're going to ask for the code, the code is right
well then don't bother posting here, nothing is wrong
Reply
#6

cessil, exactly, nothing is wrong with the code but something is wrong with the dialog that's why I'm so frustrated

Since you all still want the code

pawn Код:
if(!strcmp(cmdtext, "/shop", true) && (GetPlayerTeam(playerid) == 0 || GetPlayerTeam(playerid) == 2) && GetGVarInt("RoundStarted") == 1)
    {
        new Content[5000];
        Content = GetHumanShopContentForPlayer(playerid);
        ShowPlayerDialog(playerid, 4730, DIALOG_STYLE_LIST, "Human Item Shop", Content, "Buy", "Cancel");
        return 1;
    }
pawn Код:
stock GetHumanShopContentForPlayer(playerid)
{
    new HumanShopDialogContent[5000];
    new NewLine[5] = "\n";
    new Content[150];
    new Query[500];
   
    mysql_format(DB, Query, sizeof(Query), "SELECT * FROM `items` WHERE id=(SELECT MAX(id) FROM `items`)");
    mysql_query(DB, Query);
   
    new MAXID = cache_get_field_content_int(0, "id");
    new FBT[20];
   
    for(new W = 1; W <= MAXID; W++)
    {
        mysql_format(DB, Query, sizeof(Query), "SELECT * FROM `items` WHERE id='%i'", W);
        mysql_query(DB, Query);
       
        if(cache_get_field_content_int(0, "id"))
        {
            new WeaponName[250];
            cache_get_field_content(0, "name", WeaponName);
           
            if(cache_get_field_content_int(0, "availability") == 2)
            {
                format(FBT, sizeof(FBT), "(For both teams)");
            }
            else
            {
                format(FBT, sizeof(FBT), "\0");
            }
           
            if(cache_get_field_content_int(0, "availability") == 0 || cache_get_field_content_int(0, "availability") == 2)
            {
                if(!cache_get_field_content_int(0, "price_type") && !cache_get_field_content_int(0, "premium_item"))
                {
                    if(GetPVarInt(playerid, "Level") >= cache_get_field_content_int(0, "level_lock") && GetPlayerMoney(playerid) >= cache_get_field_content_int(0, "price"))
                    {
                        format(Content, sizeof(Content), "{FFBB00}%s {FF0000}%s{BDBDBD}[$%i]", WeaponName, FBT, cache_get_field_content_int(0, "price"));
                    }
                    else
                    {
                        format(Content, sizeof(Content), "{7A7A7A}%s {FF0000}%s{BDBDBD}[$%i]", WeaponName, FBT, cache_get_field_content_int(0, "price"));
                    }
                    strcat(HumanShopDialogContent, Content);
                    strcat(HumanShopDialogContent, NewLine);
                }
                else if(cache_get_field_content_int(0, "price_type") && !cache_get_field_content_int(0, "premium_item"))
                {
                    if(GetPVarInt(playerid, "Level") >= cache_get_field_content_int(0, "level_lock") && GetPVarInt(playerid, "Cash") >= cache_get_field_content_int(0, "price"))
                    {
                        format(Content, sizeof(Content), "{32CD32}%s {FF0000}%s{BDBDBD}[%i Cash]", WeaponName, FBT, cache_get_field_content_int(0, "price"));
                    }
                    else
                    {
                        format(Content, sizeof(Content), "{7A7A7A}%s {FF0000}%s{BDBDBD}[%i Cash]", WeaponName, FBT, cache_get_field_content_int(0, "price"));
                    }
                    strcat(HumanShopDialogContent, Content);
                    strcat(HumanShopDialogContent, NewLine);
                }
                else if(cache_get_field_content_int(0, "premium_item"))
                {
                    if(!cache_get_field_content_int(0, "price_type"))
                    {
                        if(GetPVarInt(playerid, "Level") >= cache_get_field_content_int(0, "level_lock") && GetPlayerMoney(playerid) >= cache_get_field_content_int(0, "price") && GetPVarInt(playerid, "Package") >= 2)
                        {
                            format(Content, sizeof(Content), "{FFBB00}%s {FF0000}%s{BDBDBD}[$%i]", WeaponName, FBT, cache_get_field_content_int(0, "price"));
                        }
                        else
                        {
                            format(Content, sizeof(Content), "{7A7A7A}%s {FF0000}%s{BDBDBD}[$%i]", WeaponName, FBT, cache_get_field_content_int(0, "price"));
                        }
                        strcat(HumanShopDialogContent, Content);
                        strcat(HumanShopDialogContent, NewLine);
                    }
                    else if(cache_get_field_content_int(0, "price_type"))
                    {
                        if(GetPVarInt(playerid, "Level") >= cache_get_field_content_int(0, "level_lock") && GetPVarInt(playerid, "Cash") >= cache_get_field_content_int(0, "price") && GetPVarInt(playerid, "Package") >= 2)
                        {
                            format(Content, sizeof(Content), "{32CD32}%s {FF0000}%s{BDBDBD}[%i Cash]", WeaponName, FBT, cache_get_field_content_int(0, "price"));
                        }
                        else
                        {
                            format(Content, sizeof(Content), "{7A7A7A}%s {FF0000}%s{BDBDBD}[%i Cash]", WeaponName, FBT, cache_get_field_content_int(0, "price"));
                        }
                        strcat(HumanShopDialogContent, Content);
                        strcat(HumanShopDialogContent, NewLine);
                    }
                }
            }
        }
    }
   
    if(HumanShopDialogContent[0] == EOS)
    {
        HumanShopDialogContent = "Empty";
    }
   
    printf("%s", HumanShopDialogContent);
    return HumanShopDialogContent;
}
Realise I printf in the stock? Here's the result. In my word editor, I see it without the * but the forum changed my code, what??
Код:
[16:34:15] {7A7A7A}Antidote {FF0000}{BDBDBD}[$7000]
{7A7A7A}Exploding Bullet {FF0000}{BDBDBD}[250 Cash]
{7A7A7A}Fuel {FF0000}{BDBDBD}[$2000]
{7A7A7A}Premium Fuel {FF0000}{BDBDBD}[350 Cash]
{7A7A7A}Zombie Detector {FF0000}{BDBDBD}[$6000]
{7A7A7A}Premium Zombie Detector {FF0000}{BDBDBD}[300 Cash]
{7A7A7A}Fire Power Boost LVL 1 {FF0000}{BDBDBD}[$8000]
{7A7A7A}Fire Power Boost LVL 2 {FF0000}{BDBDBD}[$10000]
{7A7A7A}Fire Power Boost LVL 3 {FF0000}{BDBDBD}[300 Cash]
{7A7A7A}Premium Fire Power Boost {FF0000}{BDBDBD}[450 Cash]
{7A7A7A}Money Bonus LVL*1 {FF0000}(For both teams){BDBDBD}[$7000]
{7A7A7A}Money Bonus LVL 2 {FF0000}(For both teams){BDBDBD}[$9500]
{7A7A7A}Money Bonus LVL 3 {FF0000}(For both teams){BDBDBD}[550 Cash]
{7A7A7A}Premium Money Bonus {FF0000}(For both teams){BDBDBD}[600 Cash]
{7A7A7A}Score Bonus LVL 1 {FF0000}(For both teams){BDBDBD}[$5000]
{7A7A7A}Score Bonus LVL 2 {FF0000}(For both teams){BDBDBD}[$6000]
{7A7A7A}Score Bonus LVL 3 {FF0000}(For both teams){BDBDBD}[650 Cash]
{7A7A7A}Premium Score Bonus {FF0000}(For both teams){BDBDBD}[700 Cash]


I hope that's enough information, can some one find the problem now?
Reply
#7

Try using \t to tabulate the team thing and the cash.

Example:

pawn Код:
{7A7A7A}Money Bonus LVL*1 \t{FF0000}(For both teams)\t{BDBDBD}[$7000]
If that doesn't work, try increasing the size of the string.
Reply
#8

I apologise everyone, It's working now, it's because of my database, told you all my code was right
Reply
#9

it sounds like there's a symbol that's not meant to be there try re-entering that value in the database
Reply
#10

Yeah, exactly what I did, if someone else encounter this error just re-insert the field value
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)