[Pomoc] Slot za auto


Započeo Lemi_Zero, Septembar 03, 2011, 18:41:18 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Lemi_Zero

Skripta koju koristim: Ravens 3.0 R5 (ja prevodim mod...)
Detaljan opis problema: Posto na ovom modu Ravens 3.0 R5 ima samo dva slota za auta ja zelim da ubacim vise, da mogu imati vise slotova naprimer pet auta, a ne samo dva...
Dio skripte:

if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By LordMan
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   Prvo se moras ulogovati ! ");
	            return 1;
	        }
	        new x_nr[64];
	        x_nr = strtok(cmdtext, idx);
	        if(!strlen(x_nr))
	        {
	            SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
	            SendClientMessage(playerid, COLOR_WHITE, "parkiraj, zakljucaj(1,2), prodajvozilo(ownership), prodaj(igracu),boja ,paintjob, setcode");
	            return 1;
	        }
	        if(strcmp(x_nr,"prodajvozilo",true) == 0)
	        {
	            if(IsAtDealership(playerid))
	            {
	                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
	                {
	                    new ownvehkey;
	                    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
                        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
	                    else { return 1; }
	                    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
	                    {
	                        new carsellprice = GetVehiclePrice(ownvehkey) / 4 * 3;
	                        SafeGivePlayerMoney(playerid,carsellprice);

							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

							format(string, sizeof(string), "~w~Prodao si vozilo za: ~n~~g~$%d", carsellprice);
	                        GameTextForPlayer(playerid, string, 10000, 3);
	                        
	                        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey])
								PlayerInfo[playerid][pPcarkey] = 9999;
							else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
								 PlayerInfo[playerid][pPcarkey2] = 9999;

							SafeRemovePlayerFromVehicle(playerid);
							CarInfo[ownvehkey][cOwned] = 0;
							DestroyVehicle(ownvehkey);

	                        TogglePlayerControllable(playerid, 1);
	                        
	                        format(string, sizeof(string),"LARP/Vehicles/%d.ini",ownvehkey);
         					fremove(string);
	                        
	                        OnPlayerUpdateEx(playerid);
	                        return 1;
	                    }
	                }
	                else
	                {
	                    SendClientMessage(playerid, COLOR_GREY, "  Moras biti u svojem vozilu da bi ga prodao! ");
	                    return 1;
	                }
	            }
	            else
	            {
	                SendClientMessage(playerid, COLOR_GREY, "Nisi kod dealership-a");
	                return 1;
	            }
	        }
	        else if(strcmp(x_nr,"prodaj",true) == 0)
	        {
				if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
				{
				    new ownvehkey;
	                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
	                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
	                else { return 1; }
				    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
				    {
						tmp = strtok(cmdtext, idx);
						if(!strlen(tmp))
						{
						    SendClientMessage(playerid, COLOR_WHITE, "HINT: /v prodaj(igracu) [playerid/PartOfName] [cena]");
						    return 1;
						}
						giveplayerid = ReturnUser(tmp);
						if(IsPlayerConnected(giveplayerid))
						{
							if(giveplayerid != INVALID_PLAYER_ID)
							{
							    if(ProxDetectorS(8.0, playerid, giveplayerid))
       							{
							    	if(PlayerInfo[giveplayerid][pPcarkey] == 9999)
							    	{
							            tmp = strtok(cmdtext, idx);
							            if(!strlen(tmp))
							            {
							                SendClientMessage(playerid, COLOR_WHITE, "HINT: /v prodaj(igracu) [playerid/PartOfName] [cena]");
							                return 1;
							            }
							            new price;
							            price = strval(tmp);
							            if(price < 1 || price > 1500000)
							            {
							                SendClientMessage(playerid, COLOR_GREY, "  Cena nesme biti ispod 1$ ili vise od 1500000$. ");
							                return 1;
							            }
							            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							       		format(string, sizeof(string), "* Ponudio si igracu %s da kupi tvoje vozilo za $%d .", giveplayer, price);
					        			SendClientMessage(playerid, COLOR_WHITE, string);
					        			format(string, sizeof(string), "* Vlasnik vozila %s ti je ponudio/la da kupis njegovo/njeno vozilo za $%d (/accept ownablecar) da kupis.", playername, price);
					        			SendClientMessage(giveplayerid, COLOR_WHITE, string);
					        			OwnableCarOffer[giveplayerid] = playerid;
					        			OwnableCarID[giveplayerid] = ownvehkey;
					        			OwnableCarPrice[giveplayerid] = price;
					        			return 1;
							        }
							    }
							    else if(PlayerInfo[giveplayerid][pPcarkey2] == 9999)
							    {
							        tmp = strtok(cmdtext, idx);
							        if(!strlen(tmp))
							        {
							            SendClientMessage(playerid, COLOR_WHITE, "HINT: /v prodaj(igracu) [playerid/PartOfName] [cena]");
							            return 1;
							        }
							        new price;
							        price = strval(tmp);
			        				if(price < 1 || price > 1500000)
				           			{
	       	 							SendClientMessage(playerid, COLOR_GREY, "  Cena nesme biti ispod 1$ ili vise od 1500000$. ");
	                					return 1;
				         			}
							        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							       	format(string, sizeof(string), "* Ponudio si igracu %s da kupi tvoje vozilo za $%d .", giveplayer, price);
					        		SendClientMessage(playerid, COLOR_WHITE, string);
					        		format(string, sizeof(string), "* Vlasnik vozila %s ti je ponudio/la da kupis njegovo/njeno vozilo za $%d (/accept ownablecar) da kupis.", playername, price);
					        		SendClientMessage(giveplayerid, COLOR_WHITE, string);
					        		OwnableCarOffer[giveplayerid] = playerid;
					        		OwnableCarID[giveplayerid] = ownvehkey;
					        		OwnableCarPrice[giveplayerid] = price;
					        		return 1;
							    }
							    else
							    {
							        SendClientMessage(playerid, COLOR_GREY, "   Igrac mora biti blizu tebe! ");
							        return 1;
							    }
							}
						}
				    }
				    else
				    {
				        SendClientMessage(playerid, COLOR_GREY, "  Ovo nije tvoje vozilo");
				        return 1;
				    }
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "  Moras biti u vozilu da bi ga prodao");
				    return 1;
				}
	        }
	        else if(strcmp(x_nr,"parkiraj",true) == 0)
	        {
	            new Float:x,Float:y,Float:z;
				new Float:a;
				new carid;
				new getcarid;
				if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
				else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
				else { return 1; }
				getcarid = GetPlayerVehicleID(playerid);
				GetPlayerName(playerid, playername, sizeof(playername));
				GetVehiclePos(carid, x, y, z);
				//GetPlayerFacingAngle(playerid, a);
				GetVehicleZAngle(carid, a);
				if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
				{
			   		if(PlayerInfo[playerid][pPcarkey] == 9999  && PlayerInfo[playerid][pPcarkey2] == 9999)
					{
						SendClientMessage(playerid, COLOR_GREY, "Neposedujes vozilo.");
						return 1;
					}
					if(getcarid == carid)
					{
						CarInfo[carid][cLocationx] = x;
						CarInfo[carid][cLocationy] = y;
						CarInfo[carid][cLocationz] = z;
						CarInfo[carid][cAngle] = a;
						new area[35];
						GetPlayer2DZone(playerid, area, sizeof(area));
						format(string, sizeof(string), "~w~Parkirali ste vozilo na ovoj lokaciji ~n~~n~~b~(%s).",area);
						GameTextForPlayer(playerid, "Parkirali ste svoje vozilo na ovom mestu. Od sada ce se stvarati ovde.", 10000, 3);
						format(string, sizeof(string), "Parkirali ste svoje vozilo na poziciji %f.01, %f.01, %f.01 (%s), Zapamti ovde ce se stvarati!",x,y,z,area);
						SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
						OnPropUpdate(4,carid);
						OnPlayerUpdateEx(playerid);
						DestroyVehicle(carid);
						ownedcar[carid] = CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
                        if(CarInfo[carid][cPaintjob] != 999)
						{
							ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]);
						}
						SetVehicleVirtualWorld(carid, CarInfo[carid][cVirWorld]);
						SetVehicleModifications(carid);
						TogglePlayerControllable(playerid, 1);
						PutPlayerInVehicle(playerid, carid, 0);
						return 1;
   					}
				}
	        }
	        else if(strcmp(x_nr,"setcode",true) == 0)
	        {
	            new carid;
				if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
				else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
				else { return 1; }
				if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
				{
			   		tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "HINT: /v setcode [code]");
						SendClientMessage(playerid, COLOR_WHITE, "Izmedju 1 i 2 cifre , svaka cifra ce vas kostati 3000");
						SendClientMessage(playerid, COLOR_WHITE, "Izmedju 3 i 4 cifre , svaka cifra ce vas kostati 6000");
						SendClientMessage(playerid, COLOR_WHITE, "Izmedju 5 i 7 cifara, svaka cifra ce vas kostati 8000");
						SendClientMessage(playerid, COLOR_WHITE, "Izmedju 4 i 7, svaka ce vas kostati 6000");
						SendClientMessage(playerid, COLOR_WHITE, "I kod sa 8 cifara ce vas kostati 80000$");
						return 1;
					}
					new price;
					price = strval(tmp);
					
					Digits = GetDigits(strval(tmp));
					
					if(Digits <= 0 && Digits >= 11) return SendClientMessage(playerid,COLOR_GREY,"* Security code mora imati izmedju 1 i 12 slova");
					
					new FinalPrice;
					if(Digits >= 1 && Digits <= 2)
					{
					    FinalPrice = 3000*Digits;
					}
					else if(Digits >= 3 && Digits <= 4)
					{
					    FinalPrice = 6000*Digits;
					}
					else if(Digits >= 5 && Digits <= 7)
					{
					    FinalPrice = 8000*Digits;
					}
					else if(Digits == 8)
					{
					    FinalPrice = 10000*Digits;
					}
					if(GetPlayerMoney(playerid) < FinalPrice)
					{
						format(string, sizeof(string),"Nemas toliko novca ($%d)!",FinalPrice);
					    SendClientMessage(playerid, COLOR_GREY,string);
					    return 1;
					}
					
					SafeGivePlayerMoney(playerid, -FinalPrice);
					CarInfo[carid][cCode] = price;
					
					OnPropUpdate(4,carid);
					
					format(string, sizeof(string),"* Novi security cod je %d, platili ste ga $%d!!", price, FinalPrice);
					SendClientMessage(playerid, COLOR_GREY, string);
				}
	        }
	        else if(strcmp(x_nr,"zakljucaj1",true) == 0)
	        {
                new keycar = PlayerInfo[playerid][pPcarkey];
                if(keycar != 9999)
                {
                    new Float:X,Float:Y,Float:Z;
                    GetVehiclePos(keycar,X,Y,Z);
					if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z))
					{
	                    new locked[128];
	                    locked = strtok(cmdtext, idx);
	                    if(CarInfo[keycar][cLock] == 1)
	                    {
							format(string, sizeof(string), "~w~Vozilo~n~~g~Otkljucano");
							GameTextForPlayer(playerid, string, 4000, 3);
							CarInfo[keycar][cLock] = 0;
							OnPropUpdate(4,keycar);
							return 1;
						}
						else if(CarInfo[keycar][cLock] == 0)
						{
							format(string, sizeof(string), "~w~Vozilo~n~~r~Zakljucano");
							GameTextForPlayer(playerid, string, 4000, 3);
							CarInfo[keycar][cLock] = 1;
							OnPropUpdate(4,keycar);
							return 1;
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY,"* Moras biti u vozilu ili blizu vozila da bi ga zakljucao/la!");
					    return 1;
					}
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "* Nemas vozilo na slotu 1");
                    return 1;
                }
	        }
	        else if(strcmp(x_nr,"zakljucaj2",true) == 0)
	        {
                new keycar = PlayerInfo[playerid][pPcarkey2];
                if(keycar != 9999)
                {
                    new Float:X,Float:Y,Float:Z;
                    GetVehiclePos(keycar,X,Y,Z);
					if(IsPlayerInRangeOfPoint(playerid, 25,X,Y,Z))
					{
	                    new locked[128];
	                    locked = strtok(cmdtext, idx);
	                    if(CarInfo[keycar][cLock] == 1)
	                    {
							format(string, sizeof(string), "~w~Vozilo~n~~g~Otkljucano");
							GameTextForPlayer(playerid, string, 4000, 3);
							CarInfo[keycar][cLock] = 0;
							OnPropUpdate(4,keycar);
							return 1;
						}
						else if(CarInfo[keycar][cLock] == 0)
						{
							format(string, sizeof(string), "~w~Vozilo~n~~r~Zakljucano");
							GameTextForPlayer(playerid, string, 4000, 3);
							CarInfo[keycar][cLock] = 1;
							OnPropUpdate(4,keycar);
							return 1;
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY,"* Moras biti u vozilu ili blizu vozila da bi ga zakljucao/la!");
					    return 1;
					}
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "  Nemas vozilo na slotu 2");
                    return 1;
                }
	        }
	        else if(strcmp(x_nr,"boja",true) == 0)
	        {
	            if(PlayerInfo[playerid][pPcarkey] == 9999 && PlayerInfo[playerid][pPcarkey2] == 9999)
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"* Nemas vozilo da bi ga obojio.");
	            	return 1;
	        	}
				if(!IsAtDealership(playerid) && !IsAtPaySpray(playerid))
				{
				    SendClientMessage(playerid, COLOR_GREY,"* Moras biti kod Dealership-a ili Pay n Spray-a da bi obojio vozilo!");
				    return 1;
				}
	        	if(GetPlayerMoney(playerid) < 1000)
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"* Nemas dovoljno novca da bi obojio vozilo.");
	            	return 1;
	        	}
	        	tmp = strtok(cmdtext, idx);
	        	if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v boja [ColorOneID] [ColorTwoID]");
					return 1;
				}
				new color1;
				color1 = strval(tmp);
				if(color1 < 0 && color1 > 126)
				{
			    	SendClientMessage(playerid, COLOR_GREY, "   Pogresan ID boje!");
			    	return 1;
				}
				tmp = strtok(cmdtext, idx);
	        	if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v boja [ColorOneID] [ColorTwoID]");
					return 1;
				}
				new color2;
				color2 = strval(tmp);
				if(color2 < 0 && color2 > 126)
				{
			    	SendClientMessage(playerid, COLOR_GREY, "   Pogresan ID boje!");
			    	return 1;
				}

				new vehid;
				if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
				else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
				else { return 1; }
	        	if(IsPlayerInVehicle(playerid, vehid))
	        	{
         			CarInfo[vehid][cColorOne] = color1;
	                CarInfo[vehid][cColorTwo] = color2;
	                new Float:x,Float:y,Float:z;
	                GetPlayerPos(playerid, x,y,z);
	                ChangeVehicleColor(vehid, color1, color2);
	                SafeGivePlayerMoney(playerid, -1000);
	                GameTextForPlayer(playerid, "~w~Racun za boju vozila~n~~r~-$1000", 5000, 1);
	                ChangeVehicleColor(vehid, color1, color2);
	                OnPropUpdate(4,vehid);
					OnPlayerUpdateEx(playerid);
					return 1;
    			}
	        	else
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"   Niste u svom vozilu.");
	            	return 1;
	        	}
	        }
	        else if(strcmp(x_nr,"buy",true) == 0)
	        {
	            new car = 1;
	            new model = GetVehicleModel(idcar);
	            if(IsASalesVehicle(idcar))
	            {
	                if(PlayerInfo[playerid][pLevel] < 2)
			    	{
                    	SendClientMessage(playerid, COLOR_GREY, "Moras biti level 2 da bi kupio vozilo!");
                    	return 1;
			    	}
			    	if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999) { }
			    	else return SendClientMessage(playerid, COLOR_GREY,"* Vec imas dva vozila!");
					if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
					{
					    if(PlayerInfo[playerid][pCarLic] == 1)
					    {
							for(new h = 1; h < sizeof(CarInfo); h++)
							{
								if(CarInfo[h][cOwned] == 0)
								{
									car = h;
									h = 9999;
								}
							}
							format(string, sizeof(string),"LARP/Vehicles/%d.ini",car)
							dini_Create(string);
							
							if(PlayerInfo[playerid][pPcarkey] != 9999) { PlayerInfo[playerid][pPcarkey2] = car; }
							else { PlayerInfo[playerid][pPcarkey] = car; }
							CarInfo[car][cOwned] = 1;
							strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
							SafeGivePlayerMoney(playerid,-GetVehiclePrice(idcar));
							if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
							{
								CarInfo[car][cLocationx] = 1432.6451;
								CarInfo[car][cLocationy] = 1378.7216;
								CarInfo[car][cLocationz] = 11.5507;
								CarInfo[car][cAngle] = 359.2072;
								SendClientMessage(playerid, COLOR_YELLOW2, "Your Aircraft has been deliveried to Las Venturas Airport, you can get it there!");
								SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
								SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
								GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~Las Venturas Airport!", 5000, 3);
							}
							else if(IsModelABoat(idcar))
							{
							    CarInfo[car][cLocationx] = -1568.9614;
								CarInfo[car][cLocationy] = 169.0118;
								CarInfo[car][cLocationz] = -0.6016;
								CarInfo[car][cAngle] = 208.7506;
								SendClientMessage(playerid, COLOR_YELLOW2, "Your Boat has been deliveried to San Fierro Docks, you can get it there!");
								SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
								SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
								GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
							}
							else
							{
                                CarInfo[car][cLocationx] = -1589.2644;
								CarInfo[car][cLocationy] = 106.9119;
								CarInfo[car][cLocationz] = 3.5495;
								CarInfo[car][cAngle] = 317.1649;
								SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle has been deliveried to San Fierro Docks, you can get it there!");
								SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
								SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
								GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
							}
							CarInfo[car][cModel] = model;
							CarInfo[car][cVirWorld] = 0;
							CarInfo[car][cPaintjob] = 999;
							
							CarInfo[car][cColorOne] = 1;
							CarInfo[car][cColorTwo] = 1;
							
							CarInfo[car][cComponent0] = 0;
							CarInfo[car][cComponent1] = 0;
							CarInfo[car][cComponent2] = 0;
							CarInfo[car][cComponent3] = 0;
							CarInfo[car][cComponent4] = 0;
							CarInfo[car][cComponent5] = 0;
							CarInfo[car][cComponent6] = 0;
							CarInfo[car][cComponent7] = 0;
							CarInfo[car][cComponent8] = 0;
							CarInfo[car][cComponent9] = 0;
							CarInfo[car][cComponent10] = 0;
							CarInfo[car][cComponent11] = 0;
							CarInfo[car][cComponent12] = 0;
							CarInfo[car][cComponent13] = 0;
							
							DestroyVehicle(car);
							ownedcar[car] = CreateVehicle(CarInfo[car][cModel],CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],90.0,1,1,30000);
							PlayerPlayMusic(playerid);
							SendClientMessage(playerid, COLOR_GRAD2, "Cestitamo na vasoj novoj kupnji!");
							SendClientMessage(playerid, COLOR_GRAD2, "Kucaj /vehiclehelp da vidis pomoc oko vozila!");
							gEngine[playerid] = 0;
							engineOn[GetPlayerVehicleID(playerid)] = false;
							SendClientMessage(playerid, COLOR_GREY, "Zapamti da stavis security cod za vozilo!");
							new pass[24];
							format(pass, sizeof(pass),"%d%d%d",random(9),random(9),random(9));
							CarInfo[car][cCode] = strval(pass);
							OnPropUpdate(4,car);
							OnPlayerUpdateEx(playerid);
						}
						else
						{
							SendClientMessage(playerid, COLOR_WHITE, "* Iz bezbednosnih razloga ,vozacka dozvola je potrebna da bi kupio auto.!");
							return 1;
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "  Nemate dovoljno novca kod sebe! ");
					    return 1;
					}
	            }
	        }
	        else if(strcmp(x_nr,"paintjob",true) == 0)
	        {
	            if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999)
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"   Nemas vozilo da bi ga obojio.");
	            	return 1;
	        	}
	        	if(!IsAtDealership(playerid) && !IsAtPaySpray(playerid))
				{
				    SendClientMessage(playerid, COLOR_GREY,"* Moras biti kod dealership-a ili u Pay n Spray-u da bi obojio vozilo!");
				    return 1;
				}
	        	if(GetPlayerMoney(playerid) < 5000)
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"   Nemas dovoljno novca da bi obojio vozilo.");
	            	return 1;
	        	}
	        	tmp = strtok(cmdtext, idx);
	        	if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v paintjob [paintjob(0-3)]");
					return 1;
				}
				new color1;
				color1 = strval(tmp);
				if(color1 < 0 && color1 > 3)
				{
			    	SendClientMessage(playerid, COLOR_GREY, "   Pogresan ID boje!");
			    	return 1;
				}
				new vehid;
				if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
				else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
				else { return 1; }
	        	if(IsPlayerInVehicle(playerid, vehid))
	        	{
         			CarInfo[vehid][cPaintjob] = color1;
	                SafeGivePlayerMoney(playerid, -5000);
	                GameTextForPlayer(playerid, "~w~Racun za boju vozila~n~~r~-$5000", 5000, 1);
	                ChangeVehiclePaintjob(vehid, color1);
	                OnPropUpdate(4,vehid);
					OnPlayerUpdateEx(playerid);
					return 1;
    			}
	        	else
	        	{
	            	SendClientMessage(playerid, COLOR_GREY,"   Nisi u svom vozilu.");
	            	return 1;
	        	}
	        }
	        else
	        {
	            SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
	            SendClientMessage(playerid, COLOR_WHITE, "Available names: parkiraj, zakljucaj(1,2), prodaj(ownership), prodaj(igracu), boja, paintjob");
	            return 1;
	        }
	        
	    }
	    return 1;
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno):[/code]
Moderator : Stavljaj u
[code]code
[/code]
by L84S
Poslednja Izmena: Septembar 03, 2011, 18:44:49 POSLE PODNE od [TG]$--L84S--$

Samo dodajes jos
Kod: c
PlayerInfo[playerid][pPcarkey3]

ako hoces 4 onda 
Kod: c
PlayerInfo[playerid][pPcarkey4]