Help a bit here?
#1

Код:
C:\Users\Hellman.Hellmans-PC\Desktop\Project Roleplay\gamemodes\PRP.pwn(51023) : error 029: invalid expression, assumed zero
pawn Код:
if (PlayerInfo[playerid][pJob] > 0) {
                    switch(PlayerInfo[playerid][pJob])
                    {
                        case 1: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find");
                        case 2: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /lawyerduty /free /defend /wanted");
                        case 3: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex");
                        case 4: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellpot /sellcrack /getcrack /getseeds /plantseeds /pickweed /checkweed");
                        case 5: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar");
                        case 7: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fix /nos /hyd /repair /refill /mechduty");
                        case 8: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard /frisk");
                        case 9: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /sellgun");
                        //case 10: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellnewcar");
                        case 12: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight");
                        case 14: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getcrate");
                        //case 15: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /papers /bring /deliver");
                        case 17: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fare");
                        case 18: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /craft");
                        case 19: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrink");
                        case 20: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /loadtruck /checktruck /hijacktruck");
                        case 21: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getpizza");
                        }
            line 51023          else
                        {
                            SendClientMessageEx(playerid, COLOR_WHITE,"You don't have a Job!");
Reply
#2

u sure you dint miss any opening brackets ?
Reply
#3

wht line has the error?
Reply
#4

try
pawn Код:
(PlayerInfo[playerid][pJob] >= 1)
and ensure the else is line up
Reply
#5

This
Код:
                        }
            line 51023          else
                        {
Reply
#6

show the full code until the closing bracket of if (PlayerInfo[playerid][pJob] > 0) {
Reply
#7

pawn Код:
if (PlayerInfo[playerid][pJob] > 0)
{
                    switch(PlayerInfo[playerid][pJob])
                    {
                        case 1: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find");
                        case 2: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /lawyerduty /free /defend /wanted");
                        case 3: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex");
                        case 4: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellpot /sellcrack /getcrack /getseeds /plantseeds /pickweed /checkweed");
                        case 5: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar");
                        case 7: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fix /nos /hyd /repair /refill /mechduty");
                        case 8: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard /frisk");
                        case 9: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /sellgun");
                        //case 10: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellnewcar");
                        case 12: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight");
                        case 14: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getcrate");
                        //case 15: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /papers /bring /deliver");
                        case 17: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fare");
                        case 18: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /craft");
                        case 19: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrink");
                        case 20: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /loadtruck /checktruck /hijacktruck");
                        case 21: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getpizza");
                        }
                        else
                        {
                            SendClientMessageEx(playerid, COLOR_WHITE,"You don't have a Job!");
                        }
                    }
                    return 1;
}
Reply
#8

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
show the full code until the closing bracket of if (PlayerInfo[playerid][pJob] > 0) {
pawn Код:
}
                case 4:
                {
                    if (PlayerInfo[playerid][pJob] > 0) {
                    switch(PlayerInfo[playerid][pJob])
                    {
                        case 1: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find");
                        case 2: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /lawyerduty /free /defend /wanted");
                        case 3: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex");
                        case 4: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellpot /sellcrack /getcrack /getseeds /plantseeds /pickweed /checkweed");
                        case 5: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar");
                        case 7: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fix /nos /hyd /repair /refill /mechduty");
                        case 8: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard /frisk");
                        case 9: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /sellgun");
                        //case 10: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellnewcar");
                        case 12: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight");
                        case 14: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getcrate");
                        //case 15: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /papers /bring /deliver");
                        case 17: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fare");
                        case 18: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /craft");
                        case 19: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrink");
                        case 20: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /loadtruck /checktruck /hijacktruck");
                        case 21: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getpizza");
                        }
                        else
                        {
                            SendClientMessageEx(playerid, COLOR_WHITE,"You don't have a Job!");
                        }
                    }
                    switch(PlayerInfo[playerid][pJob2])
                    {
                        case 1: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find");
                        case 2: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /lawyerduty /free /defend /wanted");
                        case 3: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex");
                        case 4: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellpot /sellcrack /getcrack /getseeds /plantseeds /pickweed /checkweed");
                        case 5: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar");
                        case 7: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fix /nos /hyd /repair /refill /mechduty");
                        case 8: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard /frisk");
                        case 9: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /sellgun");
                        //case 10: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellnewcar");
                        case 12: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight");
                        case 14: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getcrate");
                        //case 15: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /papers /bring /deliver");
                        case 17: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fare");
                        case 18: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /craft");
                        case 19: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrink");
                        case 20: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /loadtruck /checktruck /hijacktruck");
                        case 21: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getpizza");
                    }
                }
Reply
#9

EDIT w8 missed something out
EDIT 2 try this out
pawn Код:
case 4:
                {
                    if (PlayerInfo[playerid][pJob] > 0)
                    {
                        switch(PlayerInfo[playerid][pJob])
                        {
                            case 1: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find");
                            case 2: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /lawyerduty /free /defend /wanted");
                            case 3: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex");
                            case 4: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellpot /sellcrack /getcrack /getseeds /plantseeds /pickweed /checkweed");
                            case 5: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar");
                            case 7: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fix /nos /hyd /repair /refill /mechduty");
                            case 8: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard /frisk");
                            case 9: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /sellgun");
                            //case 10: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellnewcar");
                            case 12: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight");
                            case 14: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getcrate");
                            //case 15: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /papers /bring /deliver");
                            case 17: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fare");
                            case 18: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /craft");
                            case 19: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrink");
                            case 20: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /loadtruck /checktruck /hijacktruck");
                            case 21: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getpizza");
                        }
                    }else return SendClientMessageEx(playerid, COLOR_WHITE,"You don't have a Job!");
                    switch(PlayerInfo[playerid][pJob2])
                    {
                        case 1: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find");
                        case 2: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /lawyerduty /free /defend /wanted");
                        case 3: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex");
                        case 4: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellpot /sellcrack /getcrack /getseeds /plantseeds /pickweed /checkweed");
                        case 5: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar");
                        case 7: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fix /nos /hyd /repair /refill /mechduty");
                        case 8: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard /frisk");
                        case 9: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /sellgun");
                        //case 10: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellnewcar");
                        case 12: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight");
                        case 14: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getcrate");
                        //case 15: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /papers /bring /deliver");
                        case 17: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fare");
                        case 18: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /craft");
                        case 19: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrink");
                        case 20: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /loadtruck /checktruck /hijacktruck");
                        case 21: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getpizza");
                    }
                }
make sure the tab size are current so the else doesn't get mixed up.
Reply
#10

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
EDIT w8 missed something out
EDIT 2 try this out
pawn Код:
case 4:
                {
                    if (PlayerInfo[playerid][pJob] > 0)
                    {
                        switch(PlayerInfo[playerid][pJob])
                        {
                            case 1: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find");
                            case 2: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /lawyerduty /free /defend /wanted");
                            case 3: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex");
                            case 4: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellpot /sellcrack /getcrack /getseeds /plantseeds /pickweed /checkweed");
                            case 5: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar");
                            case 7: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fix /nos /hyd /repair /refill /mechduty");
                            case 8: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard /frisk");
                            case 9: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /sellgun");
                            //case 10: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellnewcar");
                            case 12: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight");
                            case 14: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getcrate");
                            //case 15: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /papers /bring /deliver");
                            case 17: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fare");
                            case 18: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /craft");
                            case 19: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrink");
                            case 20: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /loadtruck /checktruck /hijacktruck");
                            case 21: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getpizza");
                        }
                    }else return SendClientMessageEx(playerid, COLOR_WHITE,"You don't have a Job!");
                    switch(PlayerInfo[playerid][pJob2])
                    {
                        case 1: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /find");
                        case 2: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /lawyerduty /free /defend /wanted");
                        case 3: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sex");
                        case 4: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellpot /sellcrack /getcrack /getseeds /plantseeds /pickweed /checkweed");
                        case 5: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /dropcar");
                        case 7: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fix /nos /hyd /repair /refill /mechduty");
                        case 8: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /guard /frisk");
                        case 9: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /sellgun");
                        //case 10: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /sellnewcar");
                        case 12: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fight");
                        case 14: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getcrate");
                        //case 15: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /papers /bring /deliver");
                        case 17: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /fare");
                        case 18: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getmats /sellmats /craft");
                        case 19: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /selldrink");
                        case 20: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /loadtruck /checktruck /hijacktruck");
                        case 21: SendClientMessage(playerid,COLOR_WHITE,"*** JOB *** /getpizza");
                    }
                }
make sure the tab size are current so the else doesn't get mixed up.
Thanks man.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)