Jump to content
  • 0

Problem vehicle slot


hidd3n

Question

Problema intalnita (descriere): Am un sistem de premium si daca imi iau premium de ex. pentru un an, mi se pun cele 4 sloturi, dar merge sa cumpar doar 2 masini apoi imi zice ca am maximul de masini, dar daca tastez "/v", respectiv "/cars" am 2 sloturi libere. 
Ero(area / rile) / warning-(ul / urile): nu am nicio eroare/warning
Liniile de cod / sursa / script-ul(obligatoriu): 

Quote
function insertcar(playerid)
	{
	new string[232];
	
							SetPlayerVirtualWorld(playerid,0);
							TogglePlayerControllable(playerid,1);
							
							if(PlayerData[playerid][vModel][1] == -1)
							{
										PlayerData[playerid][vModel][1] = DealerData[IDDS[playerid]][dModel];
										PlayerData[playerid][vValue][1] = DealerData[IDDS[playerid]][dPret];
										PlayerData[playerid][vLocX][1] = 2315.9238+random(10);
										PlayerData[playerid][vLocY][1] = 1460.6024+random(10);
										PlayerData[playerid][vLocZ][1] = 42.8203+random(3);
										PlayerData[playerid][vLock][1] = 0;
										PlayerData[playerid][vExp][1] = 0;
										PlayerData[playerid][vAngle][1] = 0.0;
										PlayerData[playerid][pPcarkey] = CreateVehicle(PlayerData[playerid][vModel][1], PlayerData[playerid][vLocX][1], PlayerData[playerid][vLocY][1], PlayerData[playerid][vLocZ][1], PlayerData[playerid][vAngle][1], PlayerData[playerid][vCuloare1][1], PlayerData[playerid][vCuloare2][1], -1);
										format(string,128,"Ai cumparat un %s din categoria %s, te-a costat: $%d",ArIsim[DealerData[IDDS[playerid]][dModel]-400],DealerData[IDDS[playerid]][dCat],DealerData[IDDS[playerid]][dPret]);
										SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
										SendClientMessage(playerid, COLOR_WHITE, "Pentru a vedea comenzile disponibile scrie /carhelp!");
										DealerData[IDDS[playerid]][dSlot] --;
										format(string, sizeof(string), "UPDATE dealer SET Slot='%d' WHERE id=%d", DealerData[IDDS[playerid]][dSlot], IDDS[playerid]);
										mysql_query(string);
										SetVehiclePos(PlayerData[playerid][pPcarkey],1530.3772,-1024.0398,23.9983);
										PutPlayerInVehicle(playerid, PlayerData[playerid][pPcarkey],0);
										Gas[PlayerData[playerid][pPcarkey]] = 99;
										GivePlayerCash(playerid,-DealerData[IDDS[playerid]][dPret]);
									
										return 1;
								}
							if(PlayerData[playerid][vModel][2] == -1)
							{
										PlayerData[playerid][vModel][2] = DealerData[IDDS[playerid]][dModel];
										PlayerData[playerid][vValue][2] = DealerData[IDDS[playerid]][dPret];
										PlayerData[playerid][vLocX][2] = 2315.9238+random(10);
										PlayerData[playerid][vLocY][2] = 1460.6024+random(10);
										PlayerData[playerid][vLocZ][2] = 42.8203+random(3);
										PlayerData[playerid][vLock][2] = 0;
										PlayerData[playerid][vExp][2] = 0;
										PlayerData[playerid][vAngle][2] = 0.0;
										PlayerData[playerid][pPcarkey2] = CreateVehicle(PlayerData[playerid][vModel][2], PlayerData[playerid][vLocX][2], PlayerData[playerid][vLocY][2], PlayerData[playerid][vLocZ][2], PlayerData[playerid][vAngle][2], PlayerData[playerid][vCuloare1][2], PlayerData[playerid][vCuloare2][2], -1);
										format(string,128,"Ai cumparat un %s din categoria %s, te-a costat: $%d",ArIsim[DealerData[IDDS[playerid]][dModel]-400],DealerData[IDDS[playerid]][dCat],DealerData[IDDS[playerid]][dPret]);
										SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
										SendClientMessage(playerid, COLOR_WHITE, "Pentru a vedea comenzile disponibile scrie /carhelp!");
										DealerData[IDDS[playerid]][dSlot] --;
										format(string, sizeof(string), "UPDATE dealer SET Slot='%d' WHERE id=%d", DealerData[IDDS[playerid]][dSlot], IDDS[playerid]);
										mysql_query(string);
										SetVehiclePos(PlayerData[playerid][pPcarkey2],1530.3772,-1024.0398,23.9983);
										PutPlayerInVehicle(playerid, PlayerData[playerid][pPcarkey2],0);
										Gas[PlayerData[playerid][pPcarkey2]] = 99;
										GivePlayerCash(playerid,-DealerData[IDDS[playerid]][dPret]);
									
										return 1;
								}
								
							if(PlayerData[playerid][vModel][3] == -1)
							{
							if(PlayerData[playerid][pDonateRank] == 1)
								{
								return 1;
								}
										PlayerData[playerid][vModel][3] = DealerData[IDDS[playerid]][dModel];
										PlayerData[playerid][vValue][3] = DealerData[IDDS[playerid]][dPret];
										PlayerData[playerid][vLocX][3] = 2315.9238+random(10);
										PlayerData[playerid][vLocY][3] = 1460.6024+random(10);
										PlayerData[playerid][vLocZ][3] = 42.8203+random(3);
										PlayerData[playerid][vLock][3] = 0;
										PlayerData[playerid][vExp][3] = 0;
										PlayerData[playerid][vAngle][3] = 0.0;
										PlayerData[playerid][pPcarkey3] = CreateVehicle(PlayerData[playerid][vModel][3], PlayerData[playerid][vLocX][3], PlayerData[playerid][vLocY][3], PlayerData[playerid][vLocZ][3], PlayerData[playerid][vAngle][3], PlayerData[playerid][vCuloare1][3], PlayerData[playerid][vCuloare2][3], -1);
										format(string,128,"Ai cumparat un %s din categoria %s, te-a costat: $%d",ArIsim[DealerData[IDDS[playerid]][dModel]-400],DealerData[IDDS[playerid]][dCat],DealerData[IDDS[playerid]][dPret]);
										SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
										SendClientMessage(playerid, COLOR_WHITE, "Pentru a vedea comenzile disponibile scrie /carhelp!");
										DealerData[IDDS[playerid]][dSlot] --;
										format(string, sizeof(string), "UPDATE dealer SET Slot='%d' WHERE id=%d", DealerData[IDDS[playerid]][dSlot], IDDS[playerid]);
										mysql_query(string);
										SetVehiclePos(PlayerData[playerid][pPcarkey3],1530.3772,-1024.0398,23.9983);
										PutPlayerInVehicle(playerid, PlayerData[playerid][pPcarkey3],0);
										Gas[PlayerData[playerid][pPcarkey3]] = 99;
										GivePlayerCash(playerid,-DealerData[IDDS[playerid]][dPret]);
								
										return 1;
								}
							if(PlayerData[playerid][vModel][4] == -1)
							{
								if(PlayerData[playerid][pDonateRank] == 1)
								{
								return 1;
								}
										PlayerData[playerid][vModel][4] = DealerData[IDDS[playerid]][dModel];
										PlayerData[playerid][vValue][4] = DealerData[IDDS[playerid]][dPret];
										PlayerData[playerid][vLocX][4] = 2315.9238+random(10);
										PlayerData[playerid][vLocY][4] = 1460.6024+random(10);
										PlayerData[playerid][vLocZ][4] = 42.8203+random(3);
										PlayerData[playerid][vLock][4] = 0;
										PlayerData[playerid][vExp][4] = 0;
										PlayerData[playerid][vAngle][4] = 0.0;
										PlayerData[playerid][pPcarkey4] = CreateVehicle(PlayerData[playerid][vModel][4], PlayerData[playerid][vLocX][4], PlayerData[playerid][vLocY][4], PlayerData[playerid][vLocZ][4], PlayerData[playerid][vAngle][4], PlayerData[playerid][vCuloare1][4], PlayerData[playerid][vCuloare2][4], -1);
										format(string,128,"Ai cumparat un %s din categoria %s, te-a costat: $%d",ArIsim[DealerData[IDDS[playerid]][dModel]-400],DealerData[IDDS[playerid]][dCat],DealerData[IDDS[playerid]][dPret]);
										SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
										SendClientMessage(playerid, COLOR_WHITE, "Pentru a vedea comenzile disponibile scrie /carhelp!");
										DealerData[IDDS[playerid]][dSlot] --;
										format(string, sizeof(string), "UPDATE dealer SET Slot='%d' WHERE id=%d", DealerData[IDDS[playerid]][dSlot], IDDS[playerid]);
										mysql_query(string);
										SetVehiclePos(PlayerData[playerid][pPcarkey4],1530.3772,-1024.0398,23.9983);
										PutPlayerInVehicle(playerid, PlayerData[playerid][pPcarkey4],0);
										Gas[PlayerData[playerid][pPcarkey4]] = 99;
										GivePlayerCash(playerid,-DealerData[IDDS[playerid]][dPret]);
									
										return 1;
								
							} else{SendClientMessage(playerid,COLOR_LIGHTRED,"* Ai deja maximul de masini personale.");return 1;}
							
							}


Imagini / Video (optional): nu e nevoie
Ati incercat sa rezolvati singur?: Am cautat in GM problema, dar chiar nu imi dau seama. 

Daca mai aveti nevoie de alte script-uri sau coduri lasati reply. 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.