4 Error
#1

Hi,My English is poor I script get errors.

(11894) : error 017: undefined symbol "CarInfo"
(11894) : warning 215: expression has no effect
(11894) : error 001: expected token: ";", but found "]"
(11894) : error 029: invalid expression, assumed zero
(11894) : fatal error 107: too many error messages on one line

Код:
new carfaction = CarInfo[vehicleid][cFaction];
Commands:
Код:
	    if(strcmp(cmd, "/aracekle", true) == 0)
		{
		    if(IsPlayerConnected(playerid))
		    {
		        new string2[350];
		        new vehicleid = GetPlayerVehicleID(playerid);
		        new carfaction = CarInfo[vehicleid][cFaction];
		        new tip[16];
		        if(CarInfo[vehicleid][cAracTip] == 1) { tip = "Normal"; }
				else if(CarInfo[vehicleid][cAracTip] == 2) { tip = "Ьstь Aзık"; }
				else if(CarInfo[vehicleid][cAracTip] == 3) { tip = "Motosiklet"; }
				else if(CarInfo[vehicleid][cAracTip] == 4) { tip = "Bisiklet"; }
				else if(CarInfo[vehicleid][cAracTip] == 5) { tip = "Helikopter"; }
				else if(CarInfo[vehicleid][cAracTip] == 6) { tip = "Uзak"; }
				else if(CarInfo[vehicleid][cAracTip] == 7) { tip = "Deniz Taşıtı"; }
		        new plaka[16];
		        if(CarInfo[vehicleid][cPlakaTip] == 1) { plaka = "Normal Plaka"; }
				else if(CarInfo[vehicleid][cPlakaTip] == 2) { plaka = "Mavi Plaka"; }
				else if(CarInfo[vehicleid][cPlakaTip] == 3) { plaka = "Siyah Plaka"; }

		        if(IsPlayerInAnyVehicle(playerid))
				{
				    format(string, sizeof(string), "{1B7EE0}Araз Dьzenleme: {FFFFFF}%d", vehicleid);
				    format(string2, sizeof(string2), "{799CD4}Araз Model: {FFFFFF}%d\n{799CD4}1. Renk: {FFFFFF}%d\n{799CD4}2. Renk: {FFFFFF}%d\n{799CD4}Sahibi: {FFFFFF}%s\n{799CD4}Plakası: {FFFFFF}%s\n{799CD4}Anahtar id: {FFFFFF}%d\n{799CD4}Faction: {FFFFFF}%s\n{799CD4}Araз Tip: {FFFFFF}%s\n{799CD4}Plaka Renk: {FFFFFF}%s",
					CarInfo[vehicleid][cModel], CarInfo[vehicleid][cColorOne], CarInfo[vehicleid][cColorTwo], CarInfo[vehicleid][cSahibi], CarInfo[vehicleid][cPlaka], CarInfo[vehicleid][cAnahtar], FactionName[carfaction], tip, plaka);
				    ShowPlayerDialog(playerid, 351, DIALOG_STYLE_LIST, string, string2, "Dьzenle", "Зıkış");
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, RENK_FISTIKYESILI, "Kullanım: /editcar [seзenek] [değer]");
						SendClientMessage(playerid, RENK_FISTIKYESILI, "Seзenekler: 1:[Model] 2:[Renk1] 3:[Renk2] 4:[Sahibi] 5:[Plaka]");
						SendClientMessage(playerid, RENK_FISTIKYESILI, "Seзenekler: 6:[Anahtar] 7:[Faction] 8:[Kilit] 9:[KM] 10:[Benzin]");
						SendClientMessage(playerid, RENK_FISTIKYESILI, "Seзenekler: 11:[AracTipi] 12:[PlakaTipi] 13:[Kontak] 14:[Motor]");
						return 1;
					}
					new arabaid = GetPlayerVehicleID(playerid);
					new secenek;
					secenek = strval(tmp);
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, RENK_FISTIKYESILI, "Kullanım: /editcar [seзenek] [değer]");
						SendClientMessage(playerid, RENK_FISTIKYESILI, "Seзenekler: 1:[Model] 2:[Renk1] 3:[Renk2] 4:[Sahibi] 5:[Plaka]");
						SendClientMessage(playerid, RENK_FISTIKYESILI, "Seзenekler: 6:[Anahtar] 7:[Faction] 8:[Kilit] 9:[KM] 10:[Benzin]");
						SendClientMessage(playerid, RENK_FISTIKYESILI, "Seзenekler: 11:[AracTipi] 12:[PlakaTipi] 13:[Kontak] 14:[Motor]");
						return 1;
					}
					if(secenek < 1||secenek > 14)
					{
						SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Geзersiz seзenek numarası girdiniz.");
						return 1;
					}
					if (GetPlayerInfoInt(playerid, "Admin") >= 2)
					{
					    if(secenek == 1)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <400||deger > 611)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Model değeri ancak 400-611 arasında olmalıdır.");
								return 1;
							}
							else
							{
							    new Float:cx, Float:cy, Float:cz;
								GetPlayerPos(playerid, cx, cy, cz);
								CarInfo[arabaid][cModel] = deger;
								DestroyVehicle(arabaid);
		    					CreateVehicle(deger,cx,cy,cz,90,CarInfo[arabaid][cColorOne],CarInfo[arabaid][cColorTwo],60000);
		    					SetVehicleParamsEx(arabaid,CarInfo[arabaid][cMotor],VehicleLights[arabaid],0,CarInfo[arabaid][cLock],VehicleKaporta[arabaid],VehicleBagaj[arabaid],0);
		    					SetVehicleHealth(arabaid, CarInfo[arabaid][cCan]);
								UpdateVehicleDamageStatus(arabaid, CarInfo[arabaid][cPanelCan], CarInfo[arabaid][cDoorCan], CarInfo[arabaid][cLightCan], CarInfo[arabaid][cTireCan]);
								//SetVehicleToRespawn(arabaid);
		   						//RemovePlayerFromVehicle(playerid);
		   						format(string, sizeof(string), "Aracın modeli %d olarak değiştirildi.", deger);
								SendClientMessage(playerid, RENK_TURUNCU, string);
								PutPlayerInVehicle(playerid, arabaid, 0);
							}
						}
						if(secenek == 2)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <0||deger > 255)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Renk değeri ancak 0-255 arasında olmalıdır.");
								return 1;
							}
							else
							{
							    new collor = CarInfo[arabaid][cColorTwo];
								CarInfo[arabaid][cColorOne] = deger;
								ChangeVehicleColor(arabaid, deger, collor);
								DestroyVehicle(arabaid);
		    					CreateVehicle(CarInfo[arabaid][cModel],CarInfo[arabaid][cLocationx],CarInfo[arabaid][cLocationy],CarInfo[arabaid][cLocationz],CarInfo[arabaid][cAngle],deger,collor,60000);
		    					SetVehicleParamsEx(arabaid,CarInfo[arabaid][cMotor],VehicleLights[arabaid],0,CarInfo[arabaid][cLock],VehicleKaporta[arabaid],VehicleBagaj[arabaid],0);
		    					SetVehicleHealth(arabaid, CarInfo[arabaid][cCan]);
								UpdateVehicleDamageStatus(arabaid, CarInfo[arabaid][cPanelCan], CarInfo[arabaid][cDoorCan], CarInfo[arabaid][cLightCan], CarInfo[arabaid][cTireCan]);
								format(string, sizeof(string), "Aracın 1. rengi %d olarak değiştirildi.", deger);
								SendClientMessage(playerid, RENK_TURUNCU, string);
								PutPlayerInVehicle(playerid, arabaid, 0);
							}
						}
						if(secenek == 3)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <0||deger > 255)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Renk değeri ancak 0-255 arasında olmalıdır.");
								return 1;
							}
							else
							{
							    new collor = CarInfo[arabaid][cColorOne];
								CarInfo[arabaid][cColorTwo] = deger;
								ChangeVehicleColor(arabaid, collor, deger);
								DestroyVehicle(arabaid);
		    					CreateVehicle(CarInfo[arabaid][cModel],CarInfo[arabaid][cLocationx],CarInfo[arabaid][cLocationy],CarInfo[arabaid][cLocationz],CarInfo[arabaid][cAngle],collor,deger,60000);
		    					SetVehicleParamsEx(arabaid,CarInfo[arabaid][cMotor],VehicleLights[arabaid],0,CarInfo[arabaid][cLock],VehicleKaporta[arabaid],VehicleBagaj[arabaid],0);
		    					SetVehicleHealth(arabaid, CarInfo[arabaid][cCan]);
								UpdateVehicleDamageStatus(arabaid, CarInfo[arabaid][cPanelCan], CarInfo[arabaid][cDoorCan], CarInfo[arabaid][cLightCan], CarInfo[arabaid][cTireCan]);
								format(string, sizeof(string), "Aracın 2. rengi %d olarak değiştirildi.", deger);
								SendClientMessage(playerid, RENK_TURUNCU, string);
								PutPlayerInVehicle(playerid, arabaid, 0);
							}
						}
						if(secenek == 4)
						{
							new length = strlen(cmdtext);
							while ((idx < length) && (cmdtext[idx] <= ' '))
							{
								idx++;
							}
							new offset = idx;
							new result[64];
							while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
							{
								result[idx - offset] = cmdtext[idx];
								idx++;
							}
							result[idx - offset] = EOS;
							if(length > 60)
							{
							    SendClientMessage(playerid, RENK_DENIZMAVISI, "Yazı зok uzun!");
							    return 1;
							}
							if(!strlen(result))
							{
								SendClientMessage(playerid, RENK_FISTIKYESILI, "Kullanım: /editcar 4 [Yazı]");
								return 1;
							}
							else
							{
							    strmid(CarInfo[arabaid][cSahibi], result, 0, strlen(result), 255);
							    format(string, sizeof(string), "Aracın sahibi %s olarak değiştirildi.", result);
								SendClientMessage(playerid, RENK_TURUNCU, string);
							    return 1;
							}
						}
						if(secenek == 5)
						{
						    new length = strlen(cmdtext);
							while ((idx < length) && (cmdtext[idx] <= ' '))
							{
								idx++;
							}
							new offset = idx;
							new result[64];
							while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
							{
								result[idx - offset] = cmdtext[idx];
								idx++;
							}
							result[idx - offset] = EOS;
							if(length > 60)
							{
							    SendClientMessage(playerid, RENK_DENIZMAVISI, "Yazı зok uzun!");
							    return 1;
							}
							if(!strlen(result))
							{
								SendClientMessage(playerid, RENK_FISTIKYESILI, "Kullanım: /editcar 5 [Yazı]");
								return 1;
							}
							else
							{
							    strmid(CarInfo[arabaid][cPlaka], result, 0, strlen(result), 255);
							    format(string, sizeof(string), "Aracın plakası %s olarak değiştirildi.", result);
								SendClientMessage(playerid, RENK_TURUNCU, string);
							    return 1;
							}
						}
						if(secenek == 6)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <100||deger > 998)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Anahtar değeri ancak 100-998 arasında olmalıdır.");
								return 1;
							}
							else
							{
								CarInfo[arabaid][cAnahtar] = deger;
								format(string, sizeof(string), "Aracın anahtarı %d olarak değiştirildi.", deger);
								SendClientMessage(playerid, RENK_TURUNCU, string);
							}
						}
						if(secenek == 7)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <1||deger > 100)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Faction değeri ancak 1-100 arasında olmalıdır.");
								return 1;
							}
							else
							{
								CarInfo[arabaid][cFaction] = deger;
								if(deger == 0){SendClientMessage(playerid, RENK_TURUNCU, "Araз artık hiз bir factiona bağlı değil."); }
								else if(deger >= 1 && deger < 26)
								{
								    format(string, sizeof(string), "Araз %s factionuna bağlandı.", FactionName[deger]);
									SendClientMessage(playerid, RENK_TURUNCU, string);
								}
								else
								{
									format(string, sizeof(string), "Araз %d numaralı factiona bağlandı.", deger);
									SendClientMessage(playerid, RENK_TURUNCU, string);
								}
							}
						}
						if(secenek == 8)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <0||deger > 1)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "0: Kilit aзık  1: Kilitli.");
								return 1;
							}
							else
							{
								CarInfo[arabaid][cLock] = deger;
								if(deger == 0){SendClientMessage(playerid, RENK_TURUNCU, "Aracın kilidi aзıldı."); }
								else if(deger == 1){SendClientMessage(playerid, RENK_TURUNCU, "Araз kilitlendi."); }
							}
						}
						if(secenek == 9)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <0)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Geзersiz değer girdiniz.");
								return 1;
							}
							else
							{
								CarInfo[arabaid][cKm] = deger;
								format(string, sizeof(string), "Aracın KM değeri %d olarak değiştirildi.", deger);
								SendClientMessage(playerid, RENK_TURUNCU, string);
							}
						}
						if(secenek == 10)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <0||deger > 100)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Benzin değeri ancak 0-100 arasında olmalıdır.");
								return 1;
							}
							else
							{
								CarInfo[arabaid][cBenzin] = deger;
								format(string, sizeof(string), "Aracın benzini %d olarak değiştirildi.", deger);
								SendClientMessage(playerid, RENK_TURUNCU, string);
							}
						}
						if(secenek == 11)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <1||deger > 10)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Araз tipi değeri ancak 1-10 arasında olmalıdır.");
								return 1;
							}
							else
							{
								CarInfo[arabaid][cAracTip] = deger;
								if(deger == 1){SendClientMessage(playerid, RENK_TURUNCU, "Araз normal araba olarak ayarlandı."); }
								else if(deger == 2){SendClientMessage(playerid, RENK_TURUNCU, "Araз ьstь aзık araba olarak ayarlandı."); }
								else if(deger == 3){SendClientMessage(playerid, RENK_TURUNCU, "Araз motosiklet olarak ayarlandı."); }
								else if(deger == 4){SendClientMessage(playerid, RENK_TURUNCU, "Araз bisiklet olarak ayarlandı."); }
								else if(deger == 5){SendClientMessage(playerid, RENK_TURUNCU, "Araз helikopter olarak ayarlandı."); }
								else if(deger == 6){SendClientMessage(playerid, RENK_TURUNCU, "Araз uзak olarak ayarlandı."); }
								else if(deger == 7){SendClientMessage(playerid, RENK_TURUNCU, "Araз deniz taşıtı olarak ayarlandı."); }
								else if(deger == 8){SendClientMessage(playerid, RENK_TURUNCU, "Araз xxx olarak ayarlandı."); }
								else if(deger == 9){SendClientMessage(playerid, RENK_TURUNCU, "Araз xxx olarak ayarlandı."); }
								else if(deger == 10){SendClientMessage(playerid, RENK_TURUNCU, "Araз xxx olarak ayarlandı."); }
							}
						}
						if(secenek == 12)
						{
						    new deger;
						    deger = strval(tmp);
						    tmp = strtok(cmdtext, idx);
							if(deger <1||deger > 3)
							{
								SendClientMessage(playerid, RENK_ACDENIZMAVISI, "1: Normal Plaka  2: Mavi Plaka  3: Siyah Plaka.");
								return 1;
							}
							else
							{
								CarInfo[arabaid][cPlakaTip] = deger;
								if(deger == 1){SendClientMessage(playerid, RENK_TURUNCU, "Araз plakası normal plaka olarak ayarlandı."); }
								else if(deger == 2){SendClientMessage(playerid, RENK_TURUNCU, "Araз plakası mavi plaka olarak ayarlandı."); }
								else if(deger == 3){SendClientMessage(playerid, RENK_TURUNCU, "Araз plakası siyah plaka olarak ayarlandı."); }
							}
						}
						if(secenek == 13)
						{
						SendClientMessage(playerid, RENK_KIRMIZI, "Bu sistem henьz aktif değil.");
						}
						if(secenek == 14)
						{
						SendClientMessage(playerid, RENK_KIRMIZI, "Bu sistem henьz aktif değil.");
						}
					}
					else
					{
						SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Bu komutu kullanmak iзin yetkiniz yok.");
					}
				}
				else
				{
					SendClientMessage(playerid, RENK_ACDENIZMAVISI, "Herhangi bir araзta değilken bu komutu kullanamazsınız.");
				}
			}

		}
Please help me.
Reply
#2

Where do you define CarInfo?
Reply
#3

Don't you need an enum for this kinda thing?
Reply
#4

I created an enum, but gives these errors in the now.

Enum;
Код:
enum CarInfo
{
cFaction,
cAracTip,
cPlakaTip,
cColorOne,
cModel,
cColorTwo,
cSahibi,
cAnahtar,
cMotor,
cLock,
cTireCan,
cLightCan,
cPanelCan,
cDoorCan,
cLocationx,
cLocationy,
cLocationz,
cAngle,
cCan,
};
new CarInfo[MAX_PLAYERS][CarInfo];
Error;
Код:
 : error 020: invalid symbol name ""
 : error 029: invalid expression, assumed zero
 : warning 215: expression has no effect : 
 : error 001: expected token: ";", but found "]"
 : error 029: invalid expression, assumed zero
(11920) : fatal error 107: too many error messages on one line
Код:
 new carfaction = CarInfo[vehicleid][cFaction];
Reply
#5

pawn Код:
enum cInfo
{
    cFaction,
    cAracTip,
    cPlakaTip,
    cColorOne,
    cModel,
    cColorTwo,
    cSahibi,
    cAnahtar,
    cMotor,
    cLock,
    cTireCan,
    cLightCan,
    cPanelCan,
    cDoorCan,
    cLocationx,
    cLocationy,
    cLocationz,
    cAngle,
    cCan,
};
new CarInfo[MAX_PLAYERS][cInfo];
Reply
#6

I'm trying to

Edit:Thanks.
Reply
#7

No problem, helping is my duty.
Just to let you know, don't make the enum name and variable name the same.
So don't do:

pawn Код:
enum CarInfo //Enum name (CarInfo)
{
    cFaction,
    cAracTip,
    cPlakaTip,
    cColorOne,
    cModel,
    cColorTwo,
    cSahibi,
    cAnahtar,
    cMotor,
    cLock,
    cTireCan,
    cLightCan,
    cPanelCan,
    cDoorCan,
    cLocationx,
    cLocationy,
    cLocationz,
    cAngle,
    cCan,
};
new CarInfo[MAX_PLAYERS][cInfo]; //Variable name (Car Info)
Just do:

pawn Код:
enum cInfo //Enum Name (cInfo)
{
    cFaction,
    cAracTip,
    cPlakaTip,
    cColorOne,
    cModel,
    cColorTwo,
    cSahibi,
    cAnahtar,
    cMotor,
    cLock,
    cTireCan,
    cLightCan,
    cPanelCan,
    cDoorCan,
    cLocationx,
    cLocationy,
    cLocationz,
    cAngle,
    cCan,
};
new CarInfo[MAX_PLAYERS][cInfo]; //Variable name (CarInfo)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)