Menu problems
#1

So My problem:
Код:
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(444) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(445) : error 001: expected token: ";", but found "switch"
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(472) : error 014: invalid statement; not in switch
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(472) : warning 215: expression has no effect
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(472) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(472) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(472) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Code:
pawn Код:
if (strcmp("/buyweapon", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"Buy weapon","SMG\nUZI\nAK47\nM4","Buy","Cancel");
        return 1;
    }
    if (strcmp("/reportbug", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Report a bug","Write down here a bug, what you found!","Report","Cancel");
        return 1;
    }
And OnDialogResponse
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response == 0) return SendClientMessage(playerid,COLOR_GREEN,"You bought SMG for $30000!") && GivePlayerMoney(playerid,-30000) &&;
        switch(listitem)
        {
        case 0:
        {
        if(GetPlayerMoney(playerid) > 30000)
        {
            SendClientMessage(playerid,COLOR_RED,"You don't have $30000!");
        }
        if(GetPlayerMoney(playerid) < 30000)
        {
            SendClientMessage(playerid,COLOR_GREEN,"You bought SMG for $30000!");
            GivePlayerWeapon(playerid,29,500);
            GivePlayerMoney(playerid,-30000);
        }
        }
        case 1:
        {
        if(GetPlayerMoney(playerid) > 30000)
        {
            SendClientMessage(playerid,COLOR_RED,"You don't have $30000!");
        }
        if(GetPlayerMoney(playerid) < 30000)
        {
            SendClientMessage(playerid,COLOR_GREEN,"You bought UZI for $30000!");
            GivePlayerWeapon(playerid,28,500);
            GivePlayerMoney(playerid,-30000);
        }
        case 2:
        {
        if(GetPlayerMoney(playerid) > 100000)
        {
            SendClientMessage(playerid,COLOR_RED,"You don't have $100000!");
        }
        if(GetPlayerMoney(playerid) < 100000)
        {
            SendClientMessage(playerid,COLOR_GREEN,"You bought AK47 for $100000!");
            GivePlayerWeapon(playerid,30,500);
            GivePlayerMoney(playerid,-100000);
        }
        }
        case 3:
        {
        if(GetPlayerMoney(playerid) > 150000)
        {
            SendClientMessage(playerid,COLOR_RED,"You don't have $150000!");
        }
        if(GetPlayerMoney(playerid) < 150000)
        {
            SendClientMessage(playerid,COLOR_GREEN,"You bought M4 for $150000!");
            GivePlayerWeapon(playerid,31,500);
            GivePlayerMoney(playerid,-150000);
        }
        }
    }
    if(dialogid == 2)
    {
        if(strlen(inputtext) == 0) return SendClientMessage(playerid,COLOR_RED,"No text wrote!");
        new string[128];
        format(string, sizeof(string), "NEW BUG REPORT: %s", inputtext);
        print(string);
    }
    return 1;
}
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response == 0) return SendClientMessage(playerid,COLOR_GREEN,"You bought SMG for $30000!") && GivePlayerMoney(playerid,-30000);
            switch(listitem)
            {
                case 0:
                {
                    if(GetPlayerMoney(playerid) > 30000)
                    {
                        SendClientMessage(playerid,COLOR_RED,"You don't have $30000!");
                    }
                    if(GetPlayerMoney(playerid) < 30000)
                    {
                        SendClientMessage(playerid,COLOR_GREEN,"You bought SMG for $30000!");
                        GivePlayerWeapon(playerid,29,500);
                        GivePlayerMoney(playerid,-30000);
                    }
                }
                case 1:
                {
                    if(GetPlayerMoney(playerid) > 30000)
                    {
                        SendClientMessage(playerid,COLOR_RED,"You don't have $30000!");
                    }
                    if(GetPlayerMoney(playerid) < 30000)
                    {
                        SendClientMessage(playerid,COLOR_GREEN,"You bought UZI for $30000!");
                        GivePlayerWeapon(playerid,28,500);
                        GivePlayerMoney(playerid,-30000);
                    }
                }
                case 2:
                {
                    if(GetPlayerMoney(playerid) > 100000)
                    {
                        SendClientMessage(playerid,COLOR_RED,"You don't have $100000!");
                    }
                    if(GetPlayerMoney(playerid) < 100000)
                    {
                        SendClientMessage(playerid,COLOR_GREEN,"You bought AK47 for $100000!");
                        GivePlayerWeapon(playerid,30,500);
                        GivePlayerMoney(playerid,-100000);
                    }
                }
                case 3:
                {
                    if(GetPlayerMoney(playerid) > 150000)
                    {
                        SendClientMessage(playerid,COLOR_RED,"You don't have $150000!");
                    }
                    if(GetPlayerMoney(playerid) < 150000)
                    {
                        SendClientMessage(playerid,COLOR_GREEN,"You bought M4 for $150000!");
                        GivePlayerWeapon(playerid,31,500);
                        GivePlayerMoney(playerid,-150000);
                    }
                }
            }
        }
    if(dialogid == 2)
    {
        if(strlen(inputtext) == 0) return SendClientMessage(playerid,COLOR_RED,"No text wrote!");
        new string[128];
        format(string, sizeof(string), "NEW BUG REPORT: %s", inputtext);
        print(string);
    }
    return 1;
}
fixed
Reply
#3

Код:
C:\Documents and Settings\Rein\Desktop\SAMP server\gamemodes\CvT.pwn(516) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
I don't know, but the warning come's from first dialog.
Reply
#4

show line 516.
Reply
#5

Fixed.
Reply
#6

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 1)
    {
        if(
response == 0) return SendClientMessage(playerid,COLOR_GREEN,"You bought SMG for $30000!") && GivePlayerMoney(playerid,-30000);
        switch(
listitem)
        {
            case 
0:
            {
                if(
GetPlayerMoney(playerid) > 30000)
                 {
                    
SendClientMessage(playerid,COLOR_RED,"You don't have $30000!");
                  }
                if(
GetPlayerMoney(playerid) < 30000)
                {
                       
SendClientMessage(playerid,COLOR_GREEN,"You bought SMG for $30000!");
                       
GivePlayerWeapon(playerid,29,500);
                       
GivePlayerMoney(playerid,-30000);
                   }
               }
               case 
1:
               {
                  if(
GetPlayerMoney(playerid) > 30000)
                  {
                    
SendClientMessage(playerid,COLOR_RED,"You don't have $30000!");
                }
                   if(
GetPlayerMoney(playerid) < 30000)
                {
                       
SendClientMessage(playerid,COLOR_GREEN,"You bought UZI for $30000!");
                       
GivePlayerWeapon(playerid,28,500);
                       
GivePlayerMoney(playerid,-30000);
                   }
            }
               case 
2:
               {
                   if(
GetPlayerMoney(playerid) > 100000) return SendClientMessage(playerid,COLOR_RED,"You don't have $100000!");
                   {
                    if(
GetPlayerMoney(playerid) < 100000)
                     {
                         
SendClientMessage(playerid,COLOR_GREEN,"You bought AK47 for $100000!");
                         
GivePlayerWeapon(playerid,30,500);
                         
GivePlayerMoney(playerid,-100000);
                     }
                }
            }
            case 
3:
            {
                if(
GetPlayerMoney(playerid) > 150000)
                 {
                           
SendClientMessage(playerid,COLOR_RED,"You don't have $150000!");
                }
                if(
GetPlayerMoney(playerid) < 150000)
                {
                           
SendClientMessage(playerid,COLOR_GREEN,"You bought M4 for $150000!");
                           
GivePlayerWeapon(playerid,31,500);
                           
GivePlayerMoney(playerid,-150000);
                }
            }
        }
    }
    if(
dialogid == 2)
    {
        if(
strlen(inputtext) == 0) return SendClientMessage(playerid,COLOR_RED,"No text wrote!");
        new 
string[128];
        
format(stringsizeof(string), "NEW BUG REPORT: %s"inputtext);
        print(string);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)