#1

Check this, cannot see the problem is crash my script


pawn Код:
for(new i = 0; i < 247; i++)
    {
        if(PlayerToPoint(1.0,playerid,2.1507,-29.0139,1003.5494))
        {
            ShowPlayerDialog(playerid, 752, DIALOG_STYLE_LIST, "Welcome to 24/7", "Phone Book ($20) \nDice($10) \nMask($50) \nWatch($35) \nWalkieTalkie($50) \nSpray can($90) \nSprunk Can($3) \nRope($100) \nCigarettes($20) \nLighter($5) \nSeeds($100) \nHidden Number($20) \nMP3 Player($70)\nRoller Skates($25)\nCellphone($55)\nPhone Card($20)", "Buy", "Cancel");
        }
    }
    for(new i = 0; i < 247; i++)
    {
        if(PlayerToPoint(1.0,playerid,-28.1577,-89.9538,1003.5469))
        {
            ShowPlayerDialog(playerid, 752, DIALOG_STYLE_LIST, "Welcome to 24/7", "Phone Book ($20) \nDice($10) \nMask($50) \nWatch($35) \nWalkieTalkie($50) \nSpray can($90) \nSprunk Can($3) \nRope($100) \nCigarettes($20) \nLighter($5) \nSeeds($100) \nHidden Number($20) \nMP3 Player($70)\nRoller Skates($25)\nCellphone($55)\nPhone Card($20)", "Buy", "Cancel");
    }
    for(new i = 0; i < 247; i++)
    {
        if(PlayerToPoint(1.0,playerid,-29.0530,-185.1293,1003.5469))
        {
            ShowPlayerDialog(playerid, 752, DIALOG_STYLE_LIST, "Welcome to 24/7", "Phone Book ($20) \nDice($10) \nMask($50) \nWatch($35) \nWalkieTalkie($50) \nSpray can($90) \nSprunk Can($3) \nRope($100) \nCigarettes($20) \nLighter($5) \nSeeds($100) \nHidden Number($20) \nMP3 Player($70)\nRoller Skates($25)\nCellphone($55)\nPhone Card($20)", "Buy", "Cancel");
        }
    }
Reply
#2

I have a question for you, why did you make a loop and you do not use your variable i?

I'll make your code simple.

pawn Код:
for(new i = 0; i < 247; i++)
    {
        if(PlayerToPoint(1.0,i,2.1507,-29.0139,1003.5494) || PlayerToPoint(1.0,i,-28.1577,-89.9538,1003.5469) || PlayerToPoint(1.0,i,-29.0530,-185.1293,1003.5469))
        {
            ShowPlayerDialog(i, 752, DIALOG_STYLE_LIST, "Welcome to 24/7", "Phone Book ($20) \nDice($10) \nMask($50) \nWatch($35) \nWalkieTalkie($50) \nSpray can($90) \nSprunk Can($3) \nRope($100) \nCigarettes($20) \nLighter($5) \nSeeds($100) \nHidden Number($20) \nMP3 Player($70)\nRoller Skates($25)\nCellphone($55)\nPhone Card($20)", "Buy", "Cancel");
        }
    }

EDIT: I wish the i was for the players, if so, you could use MAX_PLAYERS instead.
Reply
#3

Quote:
Originally Posted by lelemaster
Посмотреть сообщение
I have a question for you, why did you make a loop and you do not use your variable i?

I'll make your code simple.

pawn Код:
for(new i = 0; i < 247; i++)
    {
        if(PlayerToPoint(1.0,i,2.1507,-29.0139,1003.5494) || PlayerToPoint(1.0,i,-28.1577,-89.9538,1003.5469) || PlayerToPoint(1.0,i,-29.0530,-185.1293,1003.5469))
        {
            ShowPlayerDialog(i, 752, DIALOG_STYLE_LIST, "Welcome to 24/7", "Phone Book ($20) \nDice($10) \nMask($50) \nWatch($35) \nWalkieTalkie($50) \nSpray can($90) \nSprunk Can($3) \nRope($100) \nCigarettes($20) \nLighter($5) \nSeeds($100) \nHidden Number($20) \nMP3 Player($70)\nRoller Skates($25)\nCellphone($55)\nPhone Card($20)", "Buy", "Cancel");
        }
    }

EDIT: I wish the i was for the players, if so, you could use MAX_PLAYERS instead.
...Sorry wrong. Dialogid should be player-specific.
pawn Код:
ShowPlayerDialog(playerid, 752+playerid, DIALOG_STYLE_LIST, "Welcome to 24/7", "Phone Book ($20) \nDice($10) \nMask($50) \nWatch($35) \nWalkieTalkie($50) \nSpray can($90) \nSprunk Can($3) \nRope($100) \nCigarettes($20) \nLighter($5) \nSeeds($100) \nHidden Number($20) \nMP3 Player($70)\nRoller Skates($25)\nCellphone($55)\nPhone Card($20)", "Buy", "Cancel");
I'm guessing that loop isn't necessary at all.. Who knows. Also, there's bracket missing after second if -statement.
Reply
#4

Код:
C:\Users\N0FeaR\Desktop\PRP\gamemodes\P-RP.pwn(3576) : error 029: invalid expression, assumed zero
C:\Users\N0FeaR\Desktop\PRP\gamemodes\P-RP.pwn(3579) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\N0FeaR\Desktop\PRP\gamemodes\P-RP.pwn(3579) : error 029: invalid expression, assumed zero
C:\Users\N0FeaR\Desktop\PRP\gamemodes\P-RP.pwn(3579) : warning 215: expression has no effect
C:\Users\N0FeaR\Desktop\PRP\gamemodes\P-RP.pwn(3579) : error 017: undefined symbol "i"
C:\Users\N0FeaR\Desktop\PRP\gamemodes\P-RP.pwn(3579) : fatal error 107: too many error messages on one line
Reply
#5

Where are these errors occurring? Post some code.
Reply
#6

Why not just show the player the dialog when they /enter to a 24/7?
Why gotta loop and waste memory over nothing...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)