SA-MP Forums Archive
Car Mechanic - 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: Car Mechanic (/showthread.php?tid=138117)



Car Mechanic - Mechscape - 31.03.2010

Код:
C:\Documents and Settings\Kasutaja\My Documents\San Andreas Multiplayer Server\gamemodes\sg.pwn(40124) : error 017: undefined symbol "cars"
C:\Documents and Settings\Kasutaja\My Documents\San Andreas Multiplayer Server\gamemodes\sg.pwn(40125) : error 017: undefined symbol "cars"
C:\Documents and Settings\Kasutaja\My Documents\San Andreas Multiplayer Server\gamemodes\sg.pwn(40127) : error 017: undefined symbol "h"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Код:
	if(strcmp(cmd, "/leiaauto", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(Funktsioonmehaanikauto[playerid] == 0)
	    {
			  if(PlayerInfo[playerid][pJob] != 7)
			  {
			    SendClientMessage(playerid, COLOR_GREY, "[TЦЦ] Sa ei ole mehaanik!");
			    return 1;
			  }
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "[KASUTAMINE] /leiaauto [sхiduki ID]");
					return 1;
				}
				tmp = strtok(cmdtext, idx);
				cars = strval(tmp); 
				if(cars < 184 || cars > 330) { SendClientMessage(playerid, COLOR_GREY, "[FUNKTSIOON] Sхiduki ID peab olema 81 kuni 330!"); return 1; }
				//AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
				SetPlayerCheckpoint(playerid,CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz],8.0);
				SendClientMessage(playerid, COLOR_WHITE, "[MEHAANIK] Auto asukoht on mдrkitud radaril. (Punane)");
				Funktsioonmehaanikauto[playerid] = 1;
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "[FUNKTSIOON] Sa oled juba teinud! Mine punase markeri juurde!");
			  return 1;
			}
		}
		return 1;
	}
(40124)
Код:
cars = strval(tmp);
This will be: If you write /leiaauto (carid) then Car ID position will be showen and Mechanic must be go that marker (Reach it)


Re: Car Mechanic - Carlton - 31.03.2010

Change
pawn Код:
cars = strval(tmp);
to
pawn Код:
new cars = strval(tmp);
Change all the h-es in CarInfo to cars.


Re: Car Mechanic - Mechscape - 31.03.2010

Quote:
Originally Posted by Carlton
Change
pawn Код:
cars = strval(tmp);
to
pawn Код:
new cars = strval(tmp);
Change all the h-es in CarInfo to cars.
Why? OnGameModeInit there's:

Код:
	for(new h = 184; h < sizeof(CarInfo); h++)
	{
		AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
	}



Re: Car Mechanic - Carlton - 31.03.2010

Because it's looping through all the vehicles and adding them. But in your mechanical script you're going for specific cars.


Re: Car Mechanic - Mechscape - 31.03.2010

Carlton, thanks.


Re: Car Mechanic - rabit7 - 31.03.2010

paste numbers of lines with errors


Re: Car Mechanic - Carlton - 31.03.2010

Quote:
Originally Posted by rabit7
paste numbers of lines with errors
Ok, stop posting in topics you know nothing about. For the past 15 minutes, you've been posting in topics that have already been answered, or information was given that you asked for, like your blind your something. Stop trying to increase your post count.


Re: Car Mechanic - rabit7 - 31.03.2010

Quote:
Originally Posted by Carlton
Quote:
Originally Posted by rabit7
paste numbers of lines with errors
Ok, stop posting in topics you know nothing about. For the past 15 minutes, you've been posting in topics that have already been answered, or information was given that you asked for, like your blind your something. Stop trying to increase your post count.
Language is a barrier and I'm rarely on this forum ... lock topic ;]


Re: Car Mechanic - Mechscape - 01.04.2010

Now, theres 1 mistakes.

Cars 184-330 (minium <> maxium)

I type /leiaauto 280 and says it "Must be id 184 <-> 330", it doenst work.


Re: Car Mechanic - Thrarod - 01.04.2010

AddStaticVehicleEx or AddStaticVehicle doesnt work during the game, try CreateVehicle