Jump to content
  • 0

problema sistem masini personale


crazyzee

Question

Salut am gasit si eu un script de vehicule personale intr-un gm dupa net si l-am pus la mine . Aici la mine pe server se compuleaza perfect insa in game dupa ce creez masina /v create nrg 1 1 mi-o spawneaza insa cand dau /v park sau /v color 1 1 imi da mesaju " Youu are not in your car " .

Precizez ca in GM-u de unde am scos sistemu merge perfect .

RPG.VIBEPLAY.RO

Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!

Link to comment
Share on other sites

23 answers to this question

Recommended Posts

Noi de unde sa stim ce sistem ai. Dane comanda aia.

[pawn]if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By LordMan

{

    if(IsPlayerConnected(playerid))

    {

        if(gPlayerLogged[playerid] == 0)

        {

            SendClientMessage(playerid, COLOR_GREY, "  You need to login first ! ");

            return 1;

        }

if(PlayerInfo[playerid][pCarBan] == 1)

{

SendClientMessage(playerid, COLOR_GREY, "    You'r banned to use /v commands ! ");

return 1;

}

if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 36)

        {

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, "Available names: park, color, create");

return 1;

}

else if(strcmp(x_nr,"park",true) == 0)

{

if(PlayerInfo[playerid][pCar] == 9999)

{

SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");

return 1;

}

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

new carid = GetPlayerVehicleID(playerid);

if(carid == PlayerInfo[playerid][pCar])

{

new Float:x,Float:y,Float:z;

new Float:a;

GetPlayerName(playerid, playername, sizeof(playername));

GetVehiclePos(carid, x, y, z);

GetVehicleZAngle(carid, a);

CarInfo[carid][cLocationx] = x;

CarInfo[carid][cLocationy] = y;

CarInfo[carid][cLocationz] = z;

CarInfo[carid][cAngle] = a;

format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

SaveCar(carid);

}

else

{

SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");

return 1;

}

return 1;

}

else if(strcmp(x_nr,"color",true) == 0)

{

if(PlayerInfo[playerid][pCar] == 9999)

{

SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray.");

return 1;

}

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");

return 1;

}

new color1;

color1 = strval(tmp);

if(color1 < 0 && color1 > 126)

{

SendClientMessage(playerid, COLOR_GREY, "  Wrong color id!");

return 1;

}

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");

return 1;

}

new color2;

color2 = strval(tmp);

if(color2 < 0 && color2 > 126)

{

SendClientMessage(playerid, COLOR_GREY, "  Wrong color id!");

return 1;

}

if(GetPlayerMoney(playerid) < 50000)

{

SendClientMessage(playerid, COLOR_GREY, "  Nu ai suficienti bani!");

return 1;

}

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

new vehid = GetPlayerVehicleID(playerid);

if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar])

{

CarInfo[vehid][cColorOne] = color1;

CarInfo[vehid][cColorTwo] = color2;

ChangeVehicleColor(vehid, color1, color2);

GivePlayerMoney(playerid, -50000);

SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!");

SaveCar(vehid);

}

else

{

SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");

return 1;

}

return 1;

}

else if(strcmp(x_nr,"create",true) == 0)

{

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]");

return 1;

}

new color1;

color1 = strval(tmp);

if(color1 < 0 && color1 > 126)

{

SendClientMessage(playerid, COLOR_GREY, "  Wrong color id!");

return 1;

}

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]");

return 1;

}

new color2;

color2 = strval(tmp);

if(color2 < 0 && color2 > 126)

{

SendClientMessage(playerid, COLOR_GREY, "  Wrong color id!");

return 1;

}

new car = 0;

if(PlayerInfo[playerid][pCar] == 9999) { }

else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!");

for(new h = 760; h < sizeof(CarInfo); h++)

{

if(CarInfo[h][cOwned] == 0)

{

car = h;

h = 1300;

}

}

new Float:AX,Float:AY,Float:AZ,Float:Angle;

GetPlayerPos(playerid, AX,AY,AZ);

GetPlayerFacingAngle(playerid, Angle);

format(string, 128, "cars/%d.ini", car);

new playername2[MAX_PLAYER_NAME];

playername2 = PlayerName(playerid);

if(dini_Exists(string))

{

CarInfo[car][cID] = car;

CarInfo[car][cOwned] = 1;

strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999);

CarInfo[car][cLocationx] = AX;

CarInfo[car][cLocationy] = AY;

CarInfo[car][cLocationz] = AZ;

CarInfo[car][cAngle] = Angle;

CarInfo[car][cModel] = 522;

CarInfo[car][cColorOne] = color1;

CarInfo[car][cColorTwo] = color2;

SaveCar(car);

}

else

{

dini_Create(string);

CarInfo[car][cID] = car;

CarInfo[car][cOwned] = 1;

strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999);

CarInfo[car][cLocationx] = AX;

CarInfo[car][cLocationy] = AY;

CarInfo[car][cLocationz] = AZ;

CarInfo[car][cAngle] = Angle;

CarInfo[car][cModel] = 522;

CarInfo[car][cColorOne] = color1;

CarInfo[car][cColorTwo] = color2;

SaveCar(car);

}

PlayerInfo[playerid][pCar] = car;

ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300);

SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");

SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!");

GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3);

}

else

{

SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");

SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create");

return 1;

}

        }

else

{

SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 3 si 36 ore pe server!");

return 1;

}

    }

    return 1;

}[/pawn]

RPG.VIBEPLAY.RO

Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!

Link to comment
Share on other sites

Hai sa-ti spun Dar sistemul pe care il ai tu este doar pentru nrg nu este pentru toate masinile

Uite aici Sistemul meu si la mn merge si park si tot si la rr se distrug nrg-urile automat

  if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You need to login first ! ");
	            return 1;
	        }
			if(PlayerInfo[playerid][pCarBan] == 1)
			{
				SendClientMessage(playerid, COLOR_GREY, "    You'r banned to use /v commands ! ");
				return 1;
			}
			if(PlayerInfo[playerid][pLevel] >= 5 && PlayerInfo[playerid][pConnectTime] >= 0)
	        {
				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, "Available names: park, color, create");
					return 1;
				}
				else if(strcmp(x_nr,"park",true) == 0)
				{
					if(PlayerInfo[playerid][pCar] == 9999)
					{
						SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
						return 1;
					}
					if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
					{
						new carid = GetPlayerVehicleID(playerid);
						if(carid == PlayerInfo[playerid][pCar])
						{
							new Float:x,Float:y,Float:z;
							new Float:a;
							GetPlayerName(playerid, playername, sizeof(playername));
							GetVehiclePos(carid, x, y, z);
							GetVehicleZAngle(carid, a);
							CarInfo[carid][cLocationx] = x;
							CarInfo[carid][cLocationy] = y;
							CarInfo[carid][cLocationz] = z;
							CarInfo[carid][cAngle] = a;
							format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							SaveCar(carid);
						}
						else
						{
							SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
							return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");
						return 1;
					}
					return 1;
				}
				else if(strcmp(x_nr,"color",true) == 0)
				{
					if(PlayerInfo[playerid][pCar] == 9999)
					{
						SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray.");
						return 1;
					}
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");
						return 1;
					}
					new color1;
					color1 = strval(tmp);
					if(color1 < 0 && color1 > 126)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
						return 1;
					}
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");
						return 1;
					}
					new color2;
					color2 = strval(tmp);
					if(color2 < 0 && color2 > 126)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
						return 1;
					}
					if(GetPlayerMoney(playerid) < 50000)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Nu ai suficienti bani!");
						return 1;
					}
					if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
					{
						new vehid = GetPlayerVehicleID(playerid);
						if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar])
						{
							CarInfo[vehid][cColorOne] = color1;
							CarInfo[vehid][cColorTwo] = color2;
							ChangeVehicleColor(vehid, color1, color2);
							GivePlayerMoney(playerid, -50000);
							SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!");
							SaveCar(vehid);
						}
						else
						{
							SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
							return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");
						return 1;
					}
					return 1;
				}
				else if(strcmp(x_nr,"create",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]");
						return 1;
					}
					new color1;
					color1 = strval(tmp);
					if(color1 < 0 && color1 > 126)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
						return 1;
					}
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]");
						return 1;
					}
					new color2;
					color2 = strval(tmp);
					if(color2 < 0 && color2 > 126)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
						return 1;
					}
					new car = 0;
					if(PlayerInfo[playerid][pCar] == 9999) { }
					else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!");
					for(new h = 721; h < sizeof(CarInfo); h++)
					{
						if(CarInfo[h][cOwned] == 0)
						{
							car = h;
							h = 1300;
						}
					}
					new Float:AX,Float:AY,Float:AZ,Float:Angle;
					GetPlayerPos(playerid, AX,AY,AZ);
					GetPlayerFacingAngle(playerid, Angle);

					format(string, 128, "cars/%d.ini", car);
					new playername2[MAX_PLAYER_NAME];
					playername2 = PlayerName(playerid);

					if(dini_Exists(string))
					{
						CarInfo[car][cID] = car;
						CarInfo[car][cOwned] = 1;
						strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999);
						CarInfo[car][cLocationx] = AX;
						CarInfo[car][cLocationy] = AY;
						CarInfo[car][cLocationz] = AZ;
						CarInfo[car][cAngle] = Angle;
						CarInfo[car][cModel] = 522;
						CarInfo[car][cColorOne] = color1;
						CarInfo[car][cColorTwo] = color2;

						SaveCar(car);
					}
					else
					{
						dini_Create(string);
						CarInfo[car][cID] = car;
						CarInfo[car][cOwned] = 1;
						strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999);
						CarInfo[car][cLocationx] = AX;
						CarInfo[car][cLocationy] = AY;
						CarInfo[car][cLocationz] = AZ;
						CarInfo[car][cAngle] = Angle;
						CarInfo[car][cModel] = 522;
						CarInfo[car][cColorOne] = color1;
						CarInfo[car][cColorTwo] = color2;

						SaveCar(car);
					}

					PlayerInfo[playerid][pCar] = car;
					ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300);
					SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
					SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!");
					GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3);
				}
				else
				{
					SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
					SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create");
					return 1;
				}
	        }
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 5 pe server!");
				return 1;
			}
	    }
	    return 1;
	}
  

Link to comment
Share on other sites

Tot la fel este extazy si cu comanda de la tine , problema nu cred sa fie de la comanda pentru ca eu am dat comanda mea la un prieten care are si el server si a puso la el in GM fara nici o problema si a functionat ca pe roate .

Problema este la mine in GM , la mine nu merge si nici vreo eroare nu imi da nicaieri ...... nu stiu de ce , va rog sa ma ajutati :(

RPG.VIBEPLAY.RO

Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!

Link to comment
Share on other sites

Da , cand sunt in masina creata si dau /v park sau /v color imi apare mesaju ala " You are not in your car " !

Inca odata pecizez ca , comanda merge perfect pe serveru unui prieten ...

RPG.VIBEPLAY.RO

Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!

Link to comment
Share on other sites

Pai trebuie sa o cumperi de aia.

Nu merge sa o cumpar .... adica sistemu nu permite cumpararea pur si simplu un player Ex. level 3 isi creeaza singur masina cu , comanda /v create nrg color color .

Ai incercat dupa ce creezi Vehiculul personal sa vezi daca este personal? dupa ce creezi vehiculul date /aod si vezi daca zice ca e personal .

Da am incercat acum cu /aod si nu zice nimic , adica nu o face personala insa in filterscript/cars imi salveaza coordonatele astea :

[pawn]Model=522

ID=760

Location_X=2033.609130

Location_Y=1917.738891

Location_Z=12.179710

Angle=273.939331

Color_1=0

Color_2=1

Owner=Lordx

Owned=1

[/pawn]

Deci chiar ciudat , pe alt gm care este aproape identic ca al meu merge fara probleme si la mine nu merge , desi nu da nici o eroare la compilare ....

RPG.VIBEPLAY.RO

Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!

Link to comment
Share on other sites

Da am incercat acum cu /aod si nu zice nimic , adica nu o face personala insa in filterscript/cars imi salveaza coordonatele astea 

Dai /destroycars si fa din nou masina personala daca nici asa nu merge dai iar destroy  si ai sa vezi ca dupa ce creezei 2x ,3x Vehicule o sa apara ca sunt personale daca nu te descurci Dami pm si te ajut eu (cunosc scriptul)

Link to comment
Share on other sites

if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By LordMan
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You need to login first ! ");
	            return 1;
	        }
			if(PlayerInfo[playerid][pCarBan] == 1)
			{
				SendClientMessage(playerid, COLOR_GREY, "    You'r banned to use /v commands ! ");
				return 1;
			}
			if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 36)
	        {
				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, "Available names: park, color, create");
					return 1;
				}
				else if(strcmp(x_nr,"park",true) == 0)
				{
				    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
					if(PlayerInfo[playerid][pCar] == 9999)
					{
						SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
						return 1;
					}
					if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
					{
						new carid = GetPlayerVehicleID(playerid);
						if(carid == PlayerInfo[playerid][pCar])
						{
							new Float:x,Float:y,Float:z;
							new Float:a;
							GetPlayerName(playerid, playername, sizeof(playername));
							GetVehiclePos(carid, x, y, z);
							GetVehicleZAngle(carid, a);
							CarInfo[carid][cLocationx] = x;
							CarInfo[carid][cLocationy] = y;
							CarInfo[carid][cLocationz] = z;
							CarInfo[carid][cAngle] = a;
							format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							SaveCar(carid);
						}
					}
					return 1;
				}
				else if(strcmp(x_nr,"color",true) == 0)
				{
					if(PlayerInfo[playerid][pCar] == 9999)
					{
						SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray.");
						return 1;
					}
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");
						return 1;
					}
					new color1;
					color1 = strval(tmp);
					if(color1 < 0 && color1 > 126)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
						return 1;
					}
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE{FFFFFF}: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");
						return 1;
					}
					new color2;
					color2 = strval(tmp);
					if(color2 < 0 && color2 > 126)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
						return 1;
					}
					if(GetPlayerMoney(playerid) < 50000)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Nu ai suficienti bani!");
						return 1;
					}
					if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
					if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
					{
						new vehid = GetPlayerVehicleID(playerid);
						if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar])
						{
							CarInfo[vehid][cColorOne] = color1;
							CarInfo[vehid][cColorTwo] = color2;
							ChangeVehicleColor(vehid, color1, color2);
							GivePlayerMoney(playerid, -50000);
							SendClientMessage(playerid, COLOR_WHITE, "Ti-ai modificat culoarea!");
							SaveCar(vehid);
						}
					}
					return 1;
				}
				else if(strcmp(x_nr,"create",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]");
						return 1;
					}
					new color1;
					color1 = strval(tmp);
					if(color1 < 0 && color1 > 126)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
						return 1;
					}
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [color1] [color2]");
						return 1;
					}
					new color2;
					color2 = strval(tmp);
					if(color2 < 0 && color2 > 126)
					{
						SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
						return 1;
					}
					new car = 0;
					if(PlayerInfo[playerid][pCar] == 9999) { }
					else return SendClientMessage(playerid, COLOR_GREY,"* You already own a car!");
					for(new h = 760; h < sizeof(CarInfo); h++)
					{
						if(CarInfo[h][cOwned] == 0)
						{
							car = h;
							h = 1300;
						}
					}
					new Float:AX,Float:AY,Float:AZ,Float:Angle;
					GetPlayerPos(playerid, AX,AY,AZ);
					GetPlayerFacingAngle(playerid, Angle);

					format(string, 128, "cars/%d.ini", car);
					new playername2[MAX_PLAYER_NAME];
					playername2 = PlayerName(playerid);

					if(dini_Exists(string))
					{
						CarInfo[car][cID] = car;
						CarInfo[car][cOwned] = 1;
						strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999);
						CarInfo[car][cLocationx] = AX;
						CarInfo[car][cLocationy] = AY;
						CarInfo[car][cLocationz] = AZ;
						CarInfo[car][cAngle] = Angle;
						CarInfo[car][cModel] = 522;
						CarInfo[car][cColorOne] = color1;
						CarInfo[car][cColorTwo] = color2;

						SaveCar(car);
					}
					else
					{
						dini_Create(string);
						CarInfo[car][cID] = car;
						CarInfo[car][cOwned] = 1;
						strmid(CarInfo[car][cOwner], playername2, 0, strlen(playername2), 999);
						CarInfo[car][cLocationx] = AX;
						CarInfo[car][cLocationy] = AY;
						CarInfo[car][cLocationz] = AZ;
						CarInfo[car][cAngle] = Angle;
						CarInfo[car][cModel] = 522;
						CarInfo[car][cColorOne] = color1;
						CarInfo[car][cColorTwo] = color2;

						SaveCar(car);
					}

					PlayerInfo[playerid][pCar] = car;
					ownedcar[car] = CreateVehicle(522,CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300);
					SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
					SendClientMessage(playerid, COLOR_GRAD2, "Type /vehicle to view the vehicle manual!");
					GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget where you placed you'r new ~b~car!", 5000, 3);
				}
				else
				{
					SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
					SendClientMessage(playerid, COLOR_WHITE, "Available names: color, park, create");
					return 1;
				}
	        }
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Trebuie sa ai level 3 si 36 ore pe server!");
				return 1;
			}
	    }
	    return 1;
	}

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.