SA-MP Forums Archive
Error on one line - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error on one line (/showthread.php?tid=125990)



Error on one line - Mechscape - 06.02.2010

Код:
C:\Program Files\SAMP\gamemodes\erp.pwn(1551) : error 028: invalid subscript (not an array or too many subscripts): "Soidukid"
C:\Program Files\SAMP\gamemodes\erp.pwn(1551) : warning 215: expression has no effect
C:\Program Files\SAMP\gamemodes\erp.pwn(1551) : error 001: expected token: ";", but found "]"
C:\Program Files\SAMP\gamemodes\erp.pwn(1551) : error 029: invalid expression, assumed zero
C:\Program Files\SAMP\gamemodes\erp.pwn(1551) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Error-Line
Код:
format(String, sizeof(String), "%s", List(GetVehicleModel(GetPlayerVehicleID(playerid))));
Full code
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
		new String[64];
		format(String, sizeof(String), "%s", List(GetVehicleModel(GetPlayerVehicleID(playerid))));
		TextDrawSetString(Soiduk, String);
		TextDrawShowForPlayer(playerid, Soiduk);
		format(String, sizeof(String), "%d KM/H", SaaSoidukiKiirus(playerid));
		TextDrawSetString(KM, String);
		TextDrawShowForPlayer(playerid, KM);
    TextDrawShowForPlayer(playerid, Liiklusvahend);
    TextDrawShowForPlayer(playerid, Kiirus);
	}
	else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
	{
		TextDrawHideForPlayer(playerid, Kiirus);
		TextDrawHideForPlayer(playerid, KM);
		TextDrawHideForPlayer(playerid, Liiklusvahend);
		TextDrawHideForPlayer(playerid, Soiduk);
	}
	return 1;
}



Re: Error on one line - Mechscape - 06.02.2010

/////////////////////////////////////


Re: Error on one line - ¤Adas¤ - 06.02.2010

OMFG! Soiduk Kiirus... What is that? Where are you from? I don't understand...


Re: Error on one line - Mechscape - 06.02.2010

Quote:
Originally Posted by ¤Adas¤
OMFG! Soiduk Kiirus... What is that? Where are you from? I don't understand...
Estonia. This is Estonian languange.

Soiduk (Sхiduk) = Vehicle
Kiirus = Speed


Re: Error on one line - smeti - 06.02.2010

new List[][] = {"vehiclenamelist","??"}; //??
pawn Код:
format(String, sizeof(String), "%s", List[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);



Re: Error on one line - Mechscape - 06.02.2010

Quote:
Originally Posted by Phento
new List[][] = {"vehiclenamelist","??"}; //??
pawn Код:
format(String, sizeof(String), "%s", List[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
Код:
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : error 017: undefined symbol "List"
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : warning 215: expression has no effect
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : error 001: expected token: ";", but found "]"
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : error 029: invalid expression, assumed zero
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Error on one line - smeti - 06.02.2010

pawn Код:
//                      ?????
format(String, sizeof(String), "%s",      List       (GetVehicleModel(GetPlayerVehicleID(playerid))));
What List?


Re: Error on one line - Mechscape - 06.02.2010

Quote:
Originally Posted by Phento
pawn Код:
//                      ?????
format(String, sizeof(String), "%s",     List      (GetVehicleModel(GetPlayerVehicleID(playerid))));
What List?
Only

Код:
#define List(%1) Soidukid[%1-400]
And

Код:
new	Soidukid[][] =
{
		"Landstalker",
		"Bravura",
		"Buffalo",
		"Linerunner",
		"Pereniel",
		"Sentinel",
		"Kallur",
		"Tuletorje Auto",
		"Prugiauto",
		"Limusiin",
		"Manana",
		"Infernus",
		"Voodoo",
		"Pony",
		"Mule",
		"Cheetah",
		"Kiirabiauto",
		"Leviathan",
		"Moonbeam",
		"Esperanto",
		"Takso",
		"Washington",
		"Bobcat",
		"Jaatiseauto",
		"BF Injection",
		"Hunter",
		"Premier",
		"LVP Buss",
		"Securicar",
		"Banshee",
		"LVP Paat",
		"Buss",
		"Rhino",
		"Barracks",
		"Hotknife",
		"Jarelhaagis",
		"Previon",
		"Buss",
		"Takso",
		"Stallion",
		"Rumpo",
		"RC Bandit",
		"Romero",
		"Packer",
		"Monster Truck",
		"Admiral",
		"Squalo",
		"Seasparrow",
		"Pizzaroller",
		"Tramm",
		"Jarelhaagis",
		"Turismo",
		"Speeder",
		"Reefer",
		"Tropic",
		"Flatbed",
		"Yankee",
		"Caddy",
		"Solair",
		"RC Kaubik",
		"Skimmer",
		"PCJ-600",
		"Faggio",
		"Freeway",
		"RC Baron",
		"RC Raider",
		"Glendale",
		"Oceanic",
		"Sanchez",
		"Sparrow",
		"Patriot",
		"Quad",
		"LV Piirivalve",
		"Dinghy",
		"Hermes",
		"Sabre",
		"Rustler",
		"ZR-350",
		"Walton",
		"Regina",
		"Comet",
		"BMX",
		"Burrito",
		"Vagunelamu",
		"Marquis",
		"Pagasi Vedaja",
		"Buldooser",
		"Maverick",
		"LV Uudistekopter",
		"Rancher",
		"KaPo Rancher",
		"Virgo",
		"Greenwood",
		"Jetmax",
		"Hotring",
		"Sandking",
		"Blista Compact",
		"LVP Helikopter",
		"Boxville",
		"Benson",
		"Mesa",
		"RC Goblin",
		"Hotring Racer",
		"Hotring Racer",
		"Bloodring Banger",
		"Rancher",
		"Super GT",
		"Elegant",
		"Journey",
		"Ratas",
		"Magiratas",
		"Beagle",
		"Cropdust",
		"Trikilennuk",
		"Veoauto",
		"Veoauto",
		"Nebula",
		"Majestic",
		"Buccaneer",
		"Shamal",
		"Hydra",
		"FCR-900",
		"NRG-500",
		"HPV1000",
		"Veoauto",
		"Puksiir",
		"Fortune",
		"Cadrona",
		"KaPo Veok",
		"Willard",
		"Tostuk",
		"Traktor",
		"Kombain",
		"Feltzer",
		"Remington",
		"Slamvan",
		"Blade",
		"Freight",
		"Streak",
		"Vortex",
		"Vincent",
		"Bullet",
		"Clover",
		"Sadler",
		"Tuletorje Auto",
		"Hustler",
		"Intruder",
		"Primo",
		"Cargobob",
		"Tampa",
		"Sunrise",
		"Merit",
		"Kaubik",
		"Nevada",
		"Yosemite",
		"Windsor",
		"Monster Truck",
		"Monster Truck",
		"Uranus",
		"Jester",
		"Sultan",
		"Stratum",
		"Elegy",
		"Raindance",
		"RC Tiger",
		"Flash",
		"Tahoma",
		"Savanna",
		"Bandito",
		"Freight",
		"Jarelhaagis",
		"Kart",
		"Niidumasin",
		"Dune",
		"Tanavapuhastaja",
		"Broadway",
		"Tornado",
		"AT-400",
		"DFT-30",
		"Huntley",
		"Stafford",
		"BF-400",
		"LV Uudistekaubik",
		"Tug",
		"Jarelhaagis",
		"Emperor",
		"Wayfarer",
		"Euros",
		"Hotdog",
		"Club",
		"Jarelhaagis",
		"Jarelhaagis",
		"Andromada",
		"Dodo",
		"RC Cam",
		"Launch",
		"LSP Patrullauto",
		"SFP Patrullauto",
		"LVP Patrullauto",
		"LVP Maastur",
		"Picador",
		"S.W.A.T.",
		"Alpha",
		"Phoenix",
		"Glendale",
		"Sadler",
		"Pagasi Jarelhaagis",
		"Pagasi Jarelhaagis",
		"Trepihaagis",
		"Boxville",
		"Jarelhaagis",
		"Jarelhaagis"
};



Re: Error on one line - smeti - 06.02.2010

pawn Код:
#include <a_samp>

new Soidukid[][] =
{
        "Landstalker",
        "Bravura",
        "Buffalo",
        "Linerunner",
        "Pereniel",
        "Sentinel",
        "Kallur",
        "Tuletorje Auto",
        "Prugiauto",
        "Limusiin",
        "Manana",
        "Infernus",
        "Voodoo",
        "Pony",
        "Mule",
        "Cheetah",
        "Kiirabiauto",
        "Leviathan",
        "Moonbeam",
        "Esperanto",
        "Takso",
        "Washington",
        "Bobcat",
        "Jaatiseauto",
        "BF Injection",
        "Hunter",
        "Premier",
        "LVP Buss",
        "Securicar",
        "Banshee",
        "LVP Paat",
        "Buss",
        "Rhino",
        "Barracks",
        "Hotknife",
        "Jarelhaagis",
        "Previon",
        "Buss",
        "Takso",
        "Stallion",
        "Rumpo",
        "RC Bandit",
        "Romero",
        "Packer",
        "Monster Truck",
        "Admiral",
        "Squalo",
        "Seasparrow",
        "Pizzaroller",
        "Tramm",
        "Jarelhaagis",
        "Turismo",
        "Speeder",
        "Reefer",
        "Tropic",
        "Flatbed",
        "Yankee",
        "Caddy",
        "Solair",
        "RC Kaubik",
        "Skimmer",
        "PCJ-600",
        "Faggio",
        "Freeway",
        "RC Baron",
        "RC Raider",
        "Glendale",
        "Oceanic",
        "Sanchez",
        "Sparrow",
        "Patriot",
        "Quad",
        "LV Piirivalve",
        "Dinghy",
        "Hermes",
        "Sabre",
        "Rustler",
        "ZR-350",
        "Walton",
        "Regina",
        "Comet",
        "BMX",
        "Burrito",
        "Vagunelamu",
        "Marquis",
        "Pagasi Vedaja",
        "Buldooser",
        "Maverick",
        "LV Uudistekopter",
        "Rancher",
        "KaPo Rancher",
        "Virgo",
        "Greenwood",
        "Jetmax",
        "Hotring",
        "Sandking",
        "Blista Compact",
        "LVP Helikopter",
        "Boxville",
        "Benson",
        "Mesa",
        "RC Goblin",
        "Hotring Racer",
        "Hotring Racer",
        "Bloodring Banger",
        "Rancher",
        "Super GT",
        "Elegant",
        "Journey",
        "Ratas",
        "Magiratas",
        "Beagle",
        "Cropdust",
        "Trikilennuk",
        "Veoauto",
        "Veoauto",
        "Nebula",
        "Majestic",
        "Buccaneer",
        "Shamal",
        "Hydra",
        "FCR-900",
        "NRG-500",
        "HPV1000",
        "Veoauto",
        "Puksiir",
        "Fortune",
        "Cadrona",
        "KaPo Veok",
        "Willard",
        "Tostuk",
        "Traktor",
        "Kombain",
        "Feltzer",
        "Remington",
        "Slamvan",
        "Blade",
        "Freight",
        "Streak",
        "Vortex",
        "Vincent",
        "Bullet",
        "Clover",
        "Sadler",
        "Tuletorje Auto",
        "Hustler",
        "Intruder",
        "Primo",
        "Cargobob",
        "Tampa",
        "Sunrise",
        "Merit",
        "Kaubik",
        "Nevada",
        "Yosemite",
        "Windsor",
        "Monster Truck",
        "Monster Truck",
        "Uranus",
        "Jester",
        "Sultan",
        "Stratum",
        "Elegy",
        "Raindance",
        "RC Tiger",
        "Flash",
        "Tahoma",
        "Savanna",
        "Bandito",
        "Freight",
        "Jarelhaagis",
        "Kart",
        "Niidumasin",
        "Dune",
        "Tanavapuhastaja",
        "Broadway",
        "Tornado",
        "AT-400",
        "DFT-30",
        "Huntley",
        "Stafford",
        "BF-400",
        "LV Uudistekaubik",
        "Tug",
        "Jarelhaagis",
        "Emperor",
        "Wayfarer",
        "Euros",
        "Hotdog",
        "Club",
        "Jarelhaagis",
        "Jarelhaagis",
        "Andromada",
        "Dodo",
        "RC Cam",
        "Launch",
        "LSP Patrullauto",
        "SFP Patrullauto",
        "LVP Patrullauto",
        "LVP Maastur",
        "Picador",
        "S.W.A.T.",
        "Alpha",
        "Phoenix",
        "Glendale",
        "Sadler",
        "Pagasi Jarelhaagis",
        "Pagasi Jarelhaagis",
        "Trepihaagis",
        "Boxville",
        "Jarelhaagis",
        "Jarelhaagis"
};

new String[128];

#define List(%0) Soidukid[%0-400]

public OnFilterScriptInit() { return 1; }

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
      format(String, sizeof(String), "%s",List(GetVehicleModel(GetPlayerVehicleID(playerid))));
      GameTextForPlayer(playerid,String,2500,1);
    }
    return 1;
}

public OnFilterScriptExit() { return 1; }



Re: Error on one line - Mechscape - 06.02.2010

Nope that Game Text, ONLY TEXTDRAW...

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
		new String[64];
		//format(String, sizeof(String), "%s", List(GetVehicleModel(GetPlayerVehicleID(playerid))));
		format(String, sizeof(String), "%s",List(GetVehicleModel(GetPlayerVehicleID(playerid))));
		TextDrawSetString(Soiduk, String);
		TextDrawShowForPlayer(playerid, Soiduk);
		format(String, sizeof(String), "%d KM/H", SaaSoidukiKiirus(playerid));
		TextDrawSetString(KM, String);
		TextDrawShowForPlayer(playerid, KM);
    TextDrawShowForPlayer(playerid, Liiklusvahend);
    TextDrawShowForPlayer(playerid, Kiirus);
	}
	else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
	{
		TextDrawHideForPlayer(playerid, Kiirus);
		TextDrawHideForPlayer(playerid, KM);
		TextDrawHideForPlayer(playerid, Liiklusvahend);
		TextDrawHideForPlayer(playerid, Soiduk);
	}
	return 1;
}
Код:
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : error 028: invalid subscript (not an array or too many subscripts): "Soidukid"
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : warning 215: expression has no effect
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : error 001: expected token: ";", but found "]"
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : error 029: invalid expression, assumed zero
C:\Program Files\SAMP\gamemodes\erp.pwn(1552) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Код:
format(String, sizeof(String), "%s",List(GetVehicleModel(GetPlayerVehicleID(playerid))));