Why do i get an error on this line?
#1

Hello, im trying to make that if someone is selling a car (/dropcar) and the family which he is member of is controlling the dropcar turf, he will get a bonus on $1000 when he drops a vehicle.

Pawno output:
pawn Code:
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Code:
pawn Code:
if(level >= 0 && level < 50)
            {
                new cgang;

                if(PlayerInfo[playerid][pMember] == 5) { cgang = 1; }  // Mafia
                if(PlayerInfo[playerid][pMember] == 6) { cgang = 2; }  // Yakuza
                if(PlayerInfo[playerid][pMember] == 12) { cgang = 3; } // Hell's Rebels
                if(PlayerInfo[playerid][pMember] == 13) { cgang = 4; } // Homeless
                if(PlayerInfo[playerid][pMember] == 15) { cgang = 5; } // Ballas
                if(PlayerInfo[playerid][pMember] == 16) { cgang = 6; } // Aztecas
                if(PlayerInfo[playerid][pMember] == 17) { cgang = 7; } // Corp
                if(PlayerInfo[playerid][pMember] == 18) { cgang = 8; } // Vagos
                if(PlayerInfo[playerid][pMember] == 19) { cgang = 9; } // Grove
                if(PlayerInfo[playerid][pMember] == 14) { cgang = 10; } // Import
                if(PlayerInfo[playerid][pMember] == 20) { cgang = 11; } // none
                new rand = random(sizeof(SELLCAR1));
                format(string, sizeof(string), "You sold a car for $%s, you can sell another in 20 minutes.", Comma(SELLCAR1[rand]));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                GiveMoney(playerid, SELLCAR1[rand]);
                if([cOwned][8][cgang] >= 1) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "Dropcar Bonus $2000!"); GiveMoney(playerid, +1000); }
                PlayerInfo[playerid][pCarTime] = 1200;
            }
Error line:
pawn Code:
if([cOwned][8][cgang] >= 1) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "Dropcar Bonus $2000!"); GiveMoney(playerid, +1000); }
Reply
#2

Quote:
Originally Posted by Mikkel_RE
View Post
Hello, im trying to make that if someone is selling a car (/dropcar) and the family which he is member of is controlling the dropcar turf, he will get a bonus on $1000 when he drops a vehicle.

Pawno output:
pawn Code:
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Code:
pawn Code:
if(level >= 0 && level < 50)
            {
                new cgang;

                if(PlayerInfo[playerid][pMember] == 5) { cgang = 1; }  // Mafia
                if(PlayerInfo[playerid][pMember] == 6) { cgang = 2; }  // Yakuza
                if(PlayerInfo[playerid][pMember] == 12) { cgang = 3; } // Hell's Rebels
                if(PlayerInfo[playerid][pMember] == 13) { cgang = 4; } // Homeless
                if(PlayerInfo[playerid][pMember] == 15) { cgang = 5; } // Ballas
                if(PlayerInfo[playerid][pMember] == 16) { cgang = 6; } // Aztecas
                if(PlayerInfo[playerid][pMember] == 17) { cgang = 7; } // Corp
                if(PlayerInfo[playerid][pMember] == 18) { cgang = 8; } // Vagos
                if(PlayerInfo[playerid][pMember] == 19) { cgang = 9; } // Grove
                if(PlayerInfo[playerid][pMember] == 14) { cgang = 10; } // Import
                if(PlayerInfo[playerid][pMember] == 20) { cgang = 11; } // none
                new rand = random(sizeof(SELLCAR1));
                format(string, sizeof(string), "You sold a car for $%s, you can sell another in 20 minutes.", Comma(SELLCAR1[rand]));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                GiveMoney(playerid, SELLCAR1[rand]);
                if([cOwned][8][cgang] >= 1) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "Dropcar Bonus $2000!"); GiveMoney(playerid, +1000); }
                PlayerInfo[playerid][pCarTime] = 1200;
            }
Error line:
pawn Code:
if([cOwned][8][cgang] >= 1) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "Dropcar Bonus $2000!"); GiveMoney(playerid, +1000); }
there is a problem with this
PHP Code:
[cOwned][8][cgang] >= 
as i dont know your code definations but it should be something like this

PHP Code:
cOwned[8][cgang] >= 
Reply
#3

Okay i made this, but i still get errors


pawn Code:
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] = 8);
                {
                    GiveMoney(playerid, 1000);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Dropcar Bonus $1000!");
                }
Errors:
pawn Code:
error 022: must be lvalue (non-constant)
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
Reply
#4

pawn Code:
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] = 8);
to

pawn Code:
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] = 8)
Reply
#5

Quote:
Originally Posted by Tenka
View Post
pawn Code:
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] = 8);
to

pawn Code:
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] = 8)
Doesnt work
Reply
#6

pawn Code:
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] == 8)
Try
Reply
#7

Quote:
Originally Posted by Tenka
View Post
pawn Code:
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] = 8);
to

pawn Code:
if(PlayerInfo[playerid][pMember] >= 1 || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] = 8)
this is also wrong dude

this must be like this

PHP Code:
if(PlayerInfo[playerid][pMember] >= || PlayerInfo[playerid][pFMember] < 255 && CPInfo[cgang][cOwned] == 8
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)