Help with those errors
#1

Code:
C:\Users\Linus\Desktop\T\PZG\gamemodes\PZG.pwn(32314) : error 001: expected token: ")", but found "{"
C:\Users\Linus\Desktop\T\PZG\gamemodes\PZG.pwn(32330) : error 022: must be lvalue (non-constant)
C:\Users\Linus\Desktop\T\PZG\gamemodes\PZG.pwn(32330) : warning 215: expression has no effect
C:\Users\Linus\Desktop\T\PZG\gamemodes\PZG.pwn(32338) : error 029: invalid expression, assumed zero
C:\Users\Linus\Desktop\T\PZG\gamemodes\PZG.pwn(32338) : error 029: invalid expression, assumed zero
C:\Users\Linus\Desktop\T\PZG\gamemodes\PZG.pwn(32338) : warning 215: expression has no effect
C:\Users\Linus\Desktop\T\PZG\gamemodes\PZG.pwn(32338) : error 001: expected token: ";", but found "]"
C:\Users\Linus\Desktop\T\PZG\gamemodes\PZG.pwn(32338) : fatal error 107: too many error messages on one line

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


6 Errors.
lines:
32314:
Code:
{
32330:
Code:
tpye = 2; // bank
32338:
Code:
if(playersData[p][pGroup] == 1)
Reply
#2

You're going to need to provide some more information otherwise this does not show where the problems are.
Reply
#3

Yeah, we need the code or we won't be able to do anything.
Reply
#4

CODE IS
pawn Code:
stock RandomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
stock randomEx(min, max)
{
    new rand = random(max-min+1)+min;
    return rand;
}
stock IsPlayerAt247RobPoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 6, -25.884498,-185.868988,1003.546875) || IsPlayerInRangeOfPoint(playerid, 6, 6.091179,-29.271898,1003.549438))
    { return true; }
    return false;
}

stock IsPlayerAtBankRobPoint(playerid)
{

    if(IsPlayerInRangeOfPoint(playerid, 6, 2315.952880,-1.618174,26.742187))
    { return true; }
    return false;
}

stock DangerousWeapon(weaponid)
{
    switch(weaponid)
    {
        case 25, 26, 27, 29, 30, 31, 33, 35: return true;
    }
    return false;
}

CMD:rob( playerid, params[ ] )
{
    if(!IsPlayerAt247RobPoint(playerid) || !IsPlayerAtBankRobPoint(playerid))
    {
        return SendClientMessage(playerid, -1, "You are not at 24/7 or bank ");
    }
    if(!DangerousWeapon(GetPlayerWeapon(playerid))
    {
        return SendClientMessage(playerid, -1, "You need a dangerous weapon");
    }
    new
        type,
        money = 0;
    if(IsPlayerAt247RobPoint(playerid))
    {
        // Random money and give it to player ( 24/7
        money = randomEx(1000,50000);
        type = 1; // 24/7
    }
    else
    {
        // Random money and give it to player ( Bank )
        money = randomEx(50,300000);
        tpye = 2; // bank
    }
    GivePlayerMoney(playerid, money);

    // U can use TogglePlayerControllable to frezee player and SetTimerEx/SetTimer to release player

    foreach(Player, p)
    {
        if(playersData[p][pGroup] == 1)
        {
            if(type == 1)
            {
                SendClientMessage(p, -1, "Alarm to police ( 24/7 )");
            }
            else
            {
                SendClientMessage(p, -1, "Alarm to police ( bank )");
            }
        }
    }
    // Also u can use PlayAudioStreamForPlayer/SetPlayerWantedLevel to warning/wanted player and

    SendClientMessage(playerid, -1, "Warning to player");
    return 1;
}
Reply
#5

It needs to be fixed
Reply
#6

The way that you are using randoms is kind of confusing.

Is there a specific reason of why you're using them this way?

Keep in mind the number after "random(" is the maximum number. The things you are using to subtract and stuff don't seem clear to me, I mean I think they could just be set numbers, honestly.
Reply
#7

pawn Code:
{
        // Random money and give it to player ( Bank )
        money = randomEx(50,300000);
        tpye = 2; // bank
  }
Mistyped here. Put type instead of "tpye".
The second one I don't really know why it shows.

Later Edit : You could try to put
pawn Code:
GivePlayerMoney(playerid, money);
Here like this
pawn Code:
else
{
 // Random money and give it to player ( Bank )
money = randomEx(50,300000);
tpye = 2; // bank
GivePlayerMoney(playerid, money);
 }
Reply
#8

now i get C:\Documents and Settings\LinesX\My Documents\PZG.pwn(53836) : error 001: expected token: ")", but found "{"
C:\Documents and Settings\LinesX\My Documents\PZG.pwn(53860) : error 017: undefined symbol "playersData"
C:\Documents and Settings\LinesX\My Documents\PZG.pwn(53860) : warning 215: expression has no effect
C:\Documents and Settings\LinesX\My Documents\PZG.pwn(53860) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\LinesX\My Documents\PZG.pwn(53860) : error 029: invalid expression, assumed zero
C:\Documents and Settings\LinesX\My Documents\PZG.pwn(53860) : fatal error 107: too many error messages on one line
Reply
#9

Are you using 2 forum accounts?

Btw. You should always provide which line the error occurs.
Reply
#10

No i dont have 2 forum account. Steven Heinz is my server's admin.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)