What's the problem here?
#1

I don't see any problem Here.

Here is the errors:
pawn Код:
Roleplay.pwn(547) : error 001: expected token: ")", but found "["
Roleplay.pwn(547) : warning 215: expression has no effect
Roleplay.pwn(547) : error 001: expected token: ";", but found "]"
Roleplay.pwn(547) : error 029: invalid expression, assumed zero
Roleplay.pwn(547) : fatal error 107: too many error messages on one line
Here is the code:
pawn Код:
new j1text[30];
    switch(pInfo[targetid][pJob][1])
    {
        case 0:   { j1text = "Unemployed"; }
        case 1:   { j1text = "Taxi Driver"; }
        case 2:   { j1text = "Mechanic"; }
        case 3:   { j1text = "Pizza Boy"; }
    }
Reply
#2

PHP код:
new j1text[15]; //No need to make this 30.
new job PInfo[targetid][pJob][1]; //not required tho.

    
switch(job)
    {
        case 
0:   format(j1textsizeof(j1text),  "Unemployed");
        case 
1:   format(j1textsizeof(j1text),  "Taxi Driver");
        case 
2:   format(j1textsizeof(j1text),  "Mechanic");
        case 
3:   format(j1textsizeof(j1text),  "Pizza Boy");
                default: 
format(j1textsizeof(j1text), "Job less");
    } 
Try this.
Reply
#3

Error in this.
pawn Код:
error 001: expected token: ";", but found "["
pawn Код:
new job = pInfo[targetid][pJob][1];
Reply
#4

Quote:
Originally Posted by HeroDR22
Посмотреть сообщение
Error in this.
pawn Код:
error 001: expected token: ";", but found "["
pawn Код:
new job = pInfo[targetid][pJob][1];
That is a multi-dimensional array. Make sure you have defined it properly. Show the pInfo definition.

I think it's supposed to be like this:

PHP код:
new j1text[30];
    switch(
pInfo[targetid][pJob])
    {
        case 
0:   { j1text "Unemployed"; }
        case 
1:   { j1text "Taxi Driver"; }
        case 
2:   { j1text "Mechanic"; }
        case 
3:   { j1text "Pizza Boy"; }
    } 
Reply
#5

You sure you have it defined 4 Dimensional though?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)