SA-MP Forums Archive
error4 (CarName) - 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: error4 (CarName) (/showthread.php?tid=75552)



error4 (CarName) - RenisiL - 02.05.2009

*


Re: error4 (CarName) - Weirdosport - 02.05.2009

Try adding this to the script (at the bottom):

pawn Код:
new CarName[212][] = {
    "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
    "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
    "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
    "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
    "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
    "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
    "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
    "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
    "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
    "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
    "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
    "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
    "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
    "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
    "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
    "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
    "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
And changing the "i" to "playerid"


Re: error4 (CarName) - RenisiL - 03.05.2009

now error

Quote:

D:\VISKAS~1\Serveris\Serveris\Serveris\Server1\FIL TER~1\Untitled.pwn(56) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Quote:

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new Text:IC;
new String[256];
format(String, sizeof(String), "~p~Car ID:~r~%d ~p~Car name:~r~%s", vehicleid, CarName[GetVehicleModel(GetPlayerVehicleID(i)-400]);
IC = TextDrawCreate(260, 398, String);
TextDrawAlignment(IC,0);
TextDrawBackgroundColor(IC,0x000000ff);
TextDrawFont(IC,1);
TextDrawLetterSize(IC,0.699999,1.600000);
TextDrawColor(IC,0xffffffff);
TextDrawSetOutline(IC,1);
TextDrawSetProportional(IC,1);
TextDrawSetShadow(IC,1);
TimeTextForPlayer(playerid,IC, 8000);//8 secunde
return 1;
}




Re: error4 (CarName) - GTA_Rules - 03.05.2009

Try this:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  for(new i = 0; i < MAX_PLAYERS; i++ )
    {
      new Text:IC;
      new String[256];
      format(String, sizeof(String), "~p~Car ID:~r~%d ~p~Car name:~r~%s", vehicleid, CarName[GetVehicleModel(GetPlayerVehicleID(i)-400]);
      IC = TextDrawCreate(260, 398, String);
      TextDrawAlignment(IC,0);
      TextDrawBackgroundColor(IC,0x000000ff);
      TextDrawFont(IC,1);
      TextDrawLetterSize(IC,0.699999,1.600000);
      TextDrawColor(IC,0xffffffff);
      TextDrawSetOutline(IC,1);
      TextDrawSetProportional(IC,1);
      TextDrawSetShadow(IC,1);
      TimeTextForPlayer(playerid,IC, 8000);//8 secunde
    }
return 1;
}



Re: error4 (CarName) - HB - 03.05.2009

Quote:
Originally Posted by Matthias™
Try this:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  for(new i = 0; i < MAX_PLAYERS; i++ )
    {
      new Text:IC;
      new String[256];
      format(String, sizeof(String), "~p~Car ID:~r~%d ~p~Car name:~r~%s", vehicleid, CarName[GetVehicleModel(GetPlayerVehicleID(i)-400]);
      IC = TextDrawCreate(260, 398, String);
      TextDrawAlignment(IC,0);
      TextDrawBackgroundColor(IC,0x000000ff);
      TextDrawFont(IC,1);
      TextDrawLetterSize(IC,0.699999,1.600000);
      TextDrawColor(IC,0xffffffff);
      TextDrawSetOutline(IC,1);
      TextDrawSetProportional(IC,1);
      TextDrawSetShadow(IC,1);
      TimeTextForPlayer(playerid,IC, 8000);//8 secunde
    }
return 1;
}
Dude, that isn't going to work. There is a "i" which is not defined. Test your scripts before you help someone, because imo you're posting bullshit now on several topics.

Simply change the "i" to playerid, because "i" probably was coded as a loop in another script. In this loop it is ment to gather all the connected players, so what you're trying to do here is trying to get all players vehicle ID. Change it on the format rule.

Edit: Also note that new String[256]; is unessesary because it will never reach 256 characters. Use 126 characters instead.


Re: error4 (CarName) - GTA_Rules - 03.05.2009

Oh fuck me :<, sorry I wasn't reading his whole code lol. I'm incredibly tired :<


Re: error4 (CarName) - RenisiL - 03.05.2009

eror 1 here script all

http://pastebin.com/m5fce806


Re: error4 (CarName) - HB - 03.05.2009

Код:
gamemodes\rensildude.pwn(57) : error 001: expected token: ",", but found "]"
gamemodes\rensildude.pwn(69) : warning 217: loose indentation
First error means pawno wants to see a "," but didn't see one. Second error means you didn't use the tabbing properly.

Код:
format(String, sizeof(String), "~p~Car ID:~r~%d ~p~Car name:~r~%s", vehicleid, CarName[GetVehicleModel(GetPlayerVehicleID(i)-400]);
The error has to be in here, search a bit. I can say you this: You forgot to end the format function with a ).

By the way, why aren't you changing the character format of String?