Jump to content
  • 0

[BUG]CAR DAYS


PhaRaoH.

Question

Descrierea problemei:Exemplu:Astazi cumpar un bullet de la DS, il tin 2-3-10 zile...In a 10-a zi cand vand respectiva masina si cumpar alta, primesc sa zicem, la masina noua, cele 10 zile sau cate avea masina veche...
Liniile de cod / sursa / script-ul(obligatoriu): M-am uitat la comanda :buycar, insa nimic.Totul pare in reg.
Imagini / Video (optional): Nu este nevoie.
Alte detalii:Multumesc

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

@Adrian Petre este gresit cum ai spus tu.

Poti face in felul urmator.

Te duci la 

stock DestroyPlayerVehicle

Si mai jos adaugi 

mysql_format(handle,szMessage, 256,"UPDATE playeraccounts SET playerCar1Days = 0 WHERE playerID = %d", playerVariables[playerid][pInternalID]);

Asta este pentru masina de pe Slot-ul 1. Pentru restu iei model si faci cum ti-am zis.

Edited by EquiNox
  • Upvote 1

j3V8Znq.png

5IGyOAw.png

Link to comment
Share on other sites

  • 0
CMD:sellcar(playerid, params[])
{
	if(playerVariables[playerid][pCarModel1] >= 1 || playerVariables[playerid][pCarModel2] >= 1 || playerVariables[playerid][pCarModel3] >= 1 || playerVariables[playerid][pCarModel4] >= 1 )
	{
	    if(IsPlayerInRangeOfPoint(playerid, 10.0, 329.3534,-1511.9949,36.0391))
	    {
			if(IsPlayerInRangeOfVehicle(playerid, playerVariables[playerid][pCarID1], 5.0))
			{
				playerVariables[playerid][pMoney] += vehPrice[playerVariables[playerid][pCarModel1]] / 2;
			    vehSlots[playerVariables[playerid][pCarModel1]] += 1;
			    SaveVehModels();
				DestroyPlayerVehicle(playerid);
				SendClientMessage(playerid, COLOR_GREY, "You have sold your vehicle for 1/2$ from vehicle price!");

			}
			else if(IsPlayerInRangeOfVehicle(playerid, playerVariables[playerid][pCarID2], 5.0))
			{
				playerVariables[playerid][pMoney] += vehPrice[playerVariables[playerid][pCarModel2]] / 2;
			    vehSlots[playerVariables[playerid][pCarModel2]] += 1;
			    SaveVehModels();
			    DestroyPlayerVehicle2(playerid);
				SendClientMessage(playerid, COLOR_GREY, "You have sold your vehicle for 1/2$ from vehicle price!");
			}
			else if(IsPlayerInRangeOfVehicle(playerid, playerVariables[playerid][pCarID3], 5.0))
			{
			    playerVariables[playerid][pMoney] += vehPrice[playerVariables[playerid][pCarModel3]] / 2;
			    vehSlots[playerVariables[playerid][pCarModel3]] += 1;
			    SaveVehModels();
			    DestroyPlayerVehicle3(playerid);
				SendClientMessage(playerid, COLOR_GREY, "You have sold your vehicle for 1/2$ from vehicle price!");
			}
			else if(IsPlayerInRangeOfVehicle(playerid, playerVariables[playerid][pCarID4], 5.0))
			{
			    playerVariables[playerid][pMoney] += vehPrice[playerVariables[playerid][pCarModel4]] / 2;
			    vehSlots[playerVariables[playerid][pCarModel4]] += 1;
			    SaveVehModels();
			    DestroyPlayerVehicle4(playerid);
				SendClientMessage(playerid, COLOR_GREY, "You have sold your vehicle for 1/2$ from vehicle price!");
			}
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "You don't own any vehicle.");
	return 1;
}

 

Link to comment
Share on other sites

  • 0

Salut,din cate vad kilometrii se salveaza per masina playerului,asa ca indiferent de ce masina ai cumpara iti va aparea ca masina ta are X zile cand tu ai luat-o acum 5 minute.

Sfatul meu: Faci o functie,la carsInfo si faci un timer de 24 de ore adica,odata la 24h sa se reseteze timerul.

Si sa se adauge un PlayerInfo[playerid][pDaysCar] = +1;

Si cand vinzi acea masina sa pui in comanda PlayerInfo[playerid][pDaysCar] = 0;

Ok,am facut asta,acum trebuie sa faci o verificare daca playerul are o masina,faci verificarea dupa care testezi si vezi daca iti iese.

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.