Jump to content
  • 0

TowCar-MasinileCaselor


ProAeXel

Question

1.

Problema intalnita (descriere): Atunci cand folosesc /towcar imi spawneaza masina default de la casa peste cea cumparata
Ero(area / rile) / warning-(ul / urile): Nu am erori la compilare
Liniile de cod / sursa / script-ul:

if(strcmp(cmd, "/towcar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			new house = PlayerInfo[playerid][pPhousekey];
			GetPlayerName(playerid, playername, sizeof(playername));
			if (house != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
			{
				if(SBizzInfo[8][sbProducts] == 100)
				{
					GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
					return 1;
				}
				if(CarTow(house+1))
				{
					GameTextForPlayer(playerid, "~w~Car~n~~g~Towed Home~n~~r~$-1000", 5000, 1);
					GivePlayerMoney(playerid,-1000);
					PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					SBizzInfo[8][sbTill] += 1000;//towcar buisness
					ExtortionSBiz(8, 1000);
					SBizzInfo[8][sbProducts]--;
				}
				else
				{
					GameTextForPlayer(playerid, "~w~Car is~n~in ~r~use", 5000, 1);
				}
			}
			else
			{
				GameTextForPlayer(playerid, "~w~You are not a home owner", 5000, 1);
			}
		}
		return 1;
	

Ati incercat sa rezolvati singur?: Da,dar cunostintele mele in domeniul scriptingului nu sunt atat de dezvoltate.

2.

Problema intalnita (descriere):Masinile de la casa sunt blocate mereu si nici proprietarul nu poate urca in ele chiar daca foloseste comanda /unlock /lock ,etc ,iar aceste masini nu sunt private,le poate conduce oricine
Ero(area / rile) / warning-(ul / urile): Nu am erori la compilare
Liniile de cod / sursa / script-ul: Nu prea stiu pe unde sunt:|

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

Daca sterg tot ce tine de functia respectiva,nu inseamna ca sterg absolut toate masinile de la case?

Nu vreau sa sterg masinile default de la case,vreau doar sa nu se mai spawneze peste  masina cumparata la folosirea comenzii /towcar

Link to comment
Share on other sites

  • 0

Daca sterg tot ce tine de functia respectiva,nu inseamna ca sterg absolut toate masinile de la case?

Nu vreau sa sterg masinile default de la case,vreau doar sa nu se mai spawneze peste  masina cumparata la folosirea comenzii /towcar

 

Vezi sa nu ai definita de doua ori functia housecarspawns , daca o ai de doua ori sterge una din ele .

Edited by NoNamed
Link to comment
Share on other sites

  • 0
new Float:HouseCarSpawns[170][4] = {
{-2637.2544,165.0454,4.2919,179.9976},//House 2
{2064.4,-1694.4,13.1,271.1561},//House 1
{-2712.7625,870.3005,70.5348,89.1608},//House 2
{1109.8,-968.0,42.7,0.0},//house 3
{2497.6274,-2025.6306,13.2521,355.4281}, // House 4
{2645.0,-1990.8,13.1,180.0},//House - 5
{-2724.8965,914.8384,67.4253,110.1072},//house 6
{1910.5149,-1120.5304,25.4493,177.8350},//house 7
{828.8,-887.0,68.5,230.7095},//House 8
{2149.6,-1610.9,14.0,90.7904},//House 9
{760.1,-1687.8,4.3,180.6},//House 10 ETC.....
_____________________________________________________________________________________________________

PUBLIC: CarTow(carid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerInVehicle(i, carid) || HireCar == carid)
			{
				gLastDriver[carid] = 255;
				return 0;
			}
		}
	}
	SetVehiclePos(carid,HouseCarSpawns[carid-1][0], HouseCarSpawns[carid-1][1], HouseCarSpawns[carid-1][2]);
	SetVehicleZAngle(carid, HouseCarSpawns[carid-1][3]);
	return 1;
}

_____________________________________________________________________________________________________________________

if(PlayerInfo[pLocal] != 255 && PlayerInfo[pInt] != 0)
			{
				new house = PlayerInfo[pLocal];
				GetPlayerPos(i, oldposx, oldposy, oldposz);
				if(oldposz != 0.0)
				{
					if(oldposz < 600.0)
					{
						if(house > 10000)
						{
							new tmpcar = GetPlayerVehicleID(i);
							if (!PlayerToPoint(6, i,1040.6,-1021.0,31.7) && house == 10001 ||!PlayerToPoint(6, i,-2720.5,217.5,4.1) && house == 10002 ||!PlayerToPoint(6, i,2644.6,-2044.9,13.3) && house == 10003)
							{
								if (GetPlayerState(i) == 2)
								{
									SetVehiclePos(tmpcar, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
									SetVehicleZAngle(tmpcar, HouseCarSpawns[tmpcar-1][3]);
								}
								else
								{
									SetPlayerPos(i, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
								}
								new oldcash = gSpentCash;
								new Total = GetPlayerMoney(i) - oldcash;
								printf("Total %d = GetPlayerMoney(playerid) %d - oldcash %d",Total,GetPlayerMoney(i),oldcash);
								new name[MAX_PLAYER_NAME];
								GetPlayerName(i, name, sizeof(name));
								format(string,128,"<< %s has left the homemodshop with $%s >>",name,Bani(Total));
								PayLog(string);
								gSpentCash = 0;
								TelePos[0] = 0.0;
								TelePos[1] = 0.0;
								PlayerInfo[pLocal] = 255;
								SetPlayerInterior(i,0);
								PlayerInfo[pInt] = 0;
								Spectate = 255;
							}
						}

___________________________________________________________________________________________________________________

	for(new h = 0; h < sizeof(HouseInfo); h++)
	{
		AddStaticVehicleEx(HouseInfo[h][hVec], HouseCarSpawns[h][0], HouseCarSpawns[h][1], HouseCarSpawns[h][2], HouseCarSpawns[h][3], HouseInfo[h][hVcol1], HouseInfo[h][hVcol2], 60000);
		gCarLock[h+1] = 1;
	} 

Astea sunt toate liniile de cod ce contin housecarspawns

Edited by ProAeXel
Link to comment
Share on other sites

  • 0

Nu ,dar am /v park pentru masinile cumparate de la dealership.

Atunci cand imi setez masina casei,imi da un mesaj ca va fi schimbata in decursul a 48 de ore (bine,in joc dureaza mai putin) iar cand e spawnata,nu ma pot urca in ea pentru ca e blocata ,iar daca ma fac admin si dau /unlockcars sa deblochez toate masinile de pe server ,deabia atunci merge si poate fi condusa si de altcineva.

Tot nu inteleg de ce imi spawneaza masina default a casei la comanda /towcar  din moment ce playerul isi schimba masina cu un infernus de exemplu.

Link to comment
Share on other sites

  • 0

Masinile de pe server se incurca cu cele personale banuiesc . Daca ai carsonserver, numara-ti toate masinile din gamemode si le treci la carsonserver din nou, atatea cate sunt, eventual +1 daca ai sistemul de masini al lui Im_BanK ...

Link to comment
Share on other sites

  • 0

Am mai adaugat eu 2 nrg-uri private pentru 2 jucatori ,acum mi'am adus aminte,probabil de la asta o fi? sa pun la carsonserver pe langa numarul pe care il am acolo +2?

Edited by ProAeXel
Link to comment
Share on other sites

  • 0

Poi fi atent care e problema : daca tu le aveai deja o data numarate in gm si trecut la carsonserver inseamna ca era deja adaugata +1 , deci aduni numarul ala care era acolo cu masinile adaugate de tine si doar atat, nu mai adaugi 1 in plus decat daca ai creat tu carsonserver .

Link to comment
Share on other sites

  • 0

Am numarat sunt 756 masini pe server,am pus carsonserver=757; tot nu merge,cand dau prima oara /towcar imi aduce o masina cu acelasi model ,adica o duba,iar duba care era deja la casa ramane acolo,nu pot urca in ea nimic,in rest cu cealalta merge,ii pot da /towcar si nu se mai dubleaza.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.