Personal Car
#1

I have a problem with the Dealershop i found on internet, in implemented him in the gamemode but when i buy a car and use /v locate1 it shows me not a random car, a car from a house, when i restart the server it shows me the car that i bought so straight forward When i buy i car from dealership i have to restart the server to make it work or else i will control a house car. and after i restart the server and give me the car that i bought when i buy another one it give me the exact car that gave me before when i bought 1st car , so is not random at all and i dunno why . here is the code if you need more codes tell me , i really need help..
Код:
  	if(dialogid == DIALOGID+3)// DealerShip
	{
     	new model = DSModele[IDDS[playerid]][1];
		new pret = DSModele[IDDS[playerid]][2];
	    if(response)
		{
            SetPlayerPos(playerid,2125.5842,-1151.8530,23.9997);
            DestroyVehicle(IDMasina[playerid]);
			SetPlayerVirtualWorld(playerid, 0);
			TogglePlayerControllable(playerid, 1);
			SetCameraBehindPlayer(playerid);
			if(GetPlayerMoney(playerid) < DSModele[IDDS[playerid]][2]) return SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}ServeR: Nu ai suficienti bani pentru a cumpara aceasta masina!");
			if(vehSlots[model] <= 0) return SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}ServeR: Nu sunt suficiente modele in stok!");
			GivePlayerMoney(playerid,- DSModele[IDDS[playerid]][2]);
			format(string,sizeof(string),"{33CCFF}ServeR: Ai cumparat un %s pentru %d.",vehName[DSModele[IDDS[playerid]][1]-400],DSModele[IDDS[playerid]][2]);
			SendClientMessage(playerid,COLOR_WHITE,string);
		    created++;
			format(CarInfo[created][cLicense], 32 ,"DealerShip");
			CarInfo[created][cOwned] = 1; CarInfo[created][cModel] = model; CarInfo[created][cColorOne] = 3; CarInfo[created][cColorTwo] = 3;
			CarInfo[created][cLocationx] = 1649.6346; CarInfo[created][cLocationy] = -1080.1403; CarInfo[created][cLocationz] = 23.5273; CarInfo[created][cAngle] = 88.5238;
			CarInfo[created][cValue] = pret; CarInfo[created][cLock] = 0; CarInfo[created][paintjob] = -1; LoadComponents(created);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			strmid(CarInfo[created][cOwner], sendername, 0, strlen(sendername), 999);
			SaveCarCoords();
      		new MasinaPers = CreateVehicle(CarInfo[created][cModel],CarInfo[created][cLocationx],CarInfo[created][cLocationy],CarInfo[created][cLocationz],CarInfo[created][cAngle],CarInfo[created][cColorOne],CarInfo[created][cColorTwo],-1);
      		SetVehicleNumberPlate(MasinaPers,CarInfo[created][cLicense]);
			if(PlayerInfo[playerid][pPcarkey] == 0) { PlayerInfo[playerid][pPcarkey] = created; }
		    else if(PlayerInfo[playerid][pPcarkey2] == 0) { PlayerInfo[playerid][pPcarkey2] = created; }
		    else if(PlayerInfo[playerid][pPcarkey3] == 0) { PlayerInfo[playerid][pPcarkey3] = created; }
		    vehSlots[model] --;
		    SaveVehModels();
		    SavePlayerData(playerid);
        }
        else
		{
	  		SetPlayerPos(playerid,2125.5842,-1151.8530,23.9997);
	        DestroyVehicle(IDMasina[playerid]);
			SetPlayerVirtualWorld(playerid, 0);
			TogglePlayerControllable(playerid, 1);
			SetCameraBehindPlayer(playerid);
			SendClientMessage(playerid,COLOR_YELLOW,"{33CCFF}ServeR: Ai parasit Magazinul!");
		}
	}
Reply
#2

Bump, I found out that is setting the vehicle to ID:1 that's why it give me a house car
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)