error 001: expected token: ")", but found "]"
#1

line:

Код:
C:\Users\ii\Desktop\roleplay.pwn(26201) : warning 217: loose indentation
C:\Users\ii\Desktop\roleplay.pwn(26282) : error 001: expected token: ")", but found "["
C:\Users\ii\Desktop\roleplay.pwn(26282) : error 029: invalid expression, assumed zero
C:\Users\ii\Desktop\roleplay.pwn(26282) : warning 215: expression has no effect
C:\Users\ii\Desktop\roleplay.pwn(26282) : error 001: expected token: ";", but found "]"
C:\Users\ii\Desktop\roleplay.pwn(26282) : fatal error 107: too many error messages on one line
Код:
forward ViewPlayer(extraid, name[]);
public ViewPlayer(extraid, name[])
{
		new string[200];
        new HistoryString[2048];
        if (GetFactionType(extraid) != FACTION_POLICE)
            return 0;
        new sex[18];
        if(PlayerData[extraid][pMDCPlayer][pGender] == 1) { sex = "Male"; }
		if(PlayerData[extraid][pMDCPlayer][pGender] == 2) { sex = "Female"; }
        SendClientMessageEx(extraid, COLOR_GREEN, "------------------------_POLICE DATABASE_----------------------");
        SendClientMessageEx(extraid, COLOR_GREEN, "Logged in as %s", ReturnName(extraid, 1));
        SendClientMessageEx(extraid, COLOR_GREEN, "------------------------_POLICE DATABASE_-----------------------");
		SendClientMessageEx(extraid, COLOR_WHITE, "------------------------_PERSON CHECK_----------------------");
        SendClientMessageEx(extraid, COLOR_WHITE, "Name: %s", ReturnName(PlayerData[extraid][pMDCPlayer], 1));
        if(PlayerData[extraid][pGender] == 1) ? { sex = "Male"; } else { sex = "Female"; }
		{
				format(string, sizeof(string), "Gender : %s", sex);
				strcat(HistoryString, string, sizeof(HistoryString));
		}
        SendClientMessageEx(extraid, COLOR_WHITE, "Date Of Birth: %s", PlayerData[PlayerData[extraid][pMDCPlayer]][pBirthdate]);
        SendClientMessageEx(extraid, COLOR_WHITE, "Driving License: %s", PlayerData[PlayerData[extraid][pMDCPlayer]][pDrivingTest]);
        SendClientMessageEx(extraid, COLOR_WHITE, "Time in Los Santos: %d", PlayerData[PlayerData[extraid][pMDCPlayer]][pPlayingHours]);
        SendClientMessageEx(extraid, COLOR_WHITE, "Phone Number: %s", PlayerData[PlayerData[extraid][pMDCPlayer]][pPhone]);
        SendClientMessageEx(extraid, COLOR_WHITE, "---------------------------------------------------------------");
        return 1;
}
Код:
if(PlayerData[extraid][pMDCPlayer][pGender] == 1) { sex = "Male"; }
Reply
#2

why 2 closed brackets here [pMDCPlayer]]:

Код:
if(PlayerData[extraid][pMDCPlayer][pGender] == 1) { sex = "Male"; }
if(PlayerData[extraid][pMDCPlayer][pGender] == 2) { sex = "Female"; }
Reply
#3

you said :

Код:
if(PlayerData[extraid][pMDCPlayer]][pGender] == 1) { sex = "Male"; }
you made a simple mistake by putting double brackets somewhere in the line.
Its suppose to look like this :

Код:
if(PlayerData[extraid][pMDCPlayer][pGender] == 1) { sex = "Male"; }
Hope you have it all figured out now haha
Reply
#4

Why did you open another topic? Post the same problem in your old topic.
Reply
#5

bumped with new issue.
Reply
#6

It's the same issue as in your other thread and you didn't respond to my post there which has the solution to your issue.
Reply
#7

that is not a solution to my issue the code you sent me im using now and its still giving me errors.
Reply
#8

Can you post "new PlayerData..." line?
Reply
#9

new PlayerData[MAX_PLAYERS][playerData];
Reply
#10

Then try this:

Код:
if(PlayerData[extraid][pGender] == 1) { sex = "Male"; }
if(PlayerData[extraid][pGender] == 2) { sex = "Female"; }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)