Jump to content
  • 0

Problema /park


StyLe

Question

Problema intalnita (descriere): Am un sistem de mașini personale merge tot sistemu înafară de comanda /park ... Când tastezi /park îmi zice „You don't own a car” Eu pot intra în mașină dar altcineva nu că zice că este a mea dar comanda /park zice altceva...
Ero(area / rile) / warning-(ul / urile): Nu este nici o eroare și nici un warning
Liniile de cod / sursa / script-ul(obligatoriu): 

if(strcmp(cmd, "/park", true) == 0 ) 
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pCar] == 9999)
			{
				SendClientMessage(playerid, COLOR_GREY, "You don't own a car."); // Aici cred.
				return 1;
			}
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				new carid = GetPlayerVehicleID(playerid);
				if(carid == PlayerInfo[playerid][pCar] || carid == PlayerInfo[playerid][pCar2] || PlayerInfo[playerid][pAdmin] >= 1338)
				{
					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), "{FFFFFF}Masina ta a fost salvata {FF3333}Tine minte !Dupa restart va fi spawnata aici!");
					SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
					SaveCar(carid); LoadComponents(carid);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "You're not in your car.");
					return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "You're not in a car.");
				return 1;
			}
		}
		return 1;
	}
	

Imagini / Video (optional): 30di784.png
Ati incercat sa rezolvati singur?: Nu , n-am încercat...

Edited by StyLe
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
if(strcmp(cmd, "/park", true) == 0 ) 
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				new carid = GetPlayerVehicleID(playerid);
				if(carid == PlayerInfo[playerid][pCar] || carid == PlayerInfo[playerid][pCar2] || PlayerInfo[playerid][pAdmin] >= 1338)
				{
					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), "{FFFFFF}Masina ta a fost salvata {FF3333}Tine minte !Dupa restart va fi spawnata aici!");
					SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
					SaveCar(carid); LoadComponents(carid);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "You're not in your car.");
					return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "You're not in a car.");
				return 1;
			}
		}
		return 1;
	}

242086.png

Link to comment
Share on other sites

  • 0
if(strcmp(cmd, "/park", true) == 0 ) 
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				new carid = GetPlayerVehicleID(playerid);
				if(carid == PlayerInfo[playerid][pCar] || carid == PlayerInfo[playerid][pCar2] || PlayerInfo[playerid][pAdmin] >= 1338)
				{
					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), "{FFFFFF}Masina ta a fost salvata {FF3333}Tine minte !Dupa restart va fi spawnata aici!");
					SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
					SaveCar(carid); LoadComponents(carid);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "You're not in your car.");
					return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "You're not in a car.");
				return 1;
			}
		}
		return 1;
	}

Bun ... acum îmi zice Masina ta a fost salvata .Tine minte !Dupa restart va fi spawnata aici! Încă o întrebare ... cum fac să o parcheze pe loc nu după restart

Link to comment
Share on other sites

  • 0
  • 0
Dupa
CarInfo[carid][cAngle] = a;
adauga
SetVehicleToRespawn(carid);
apoi
DestroyVehicle(carid);
si
CreateVehicle(carid, x, y, z, culoare1, culoare2);
In loc de culoare1 si culoare2 poti folosi functia cu care salvezi culoarea... Nu sunt sigur ca functioneaza, dar incearca. Edited by NoNamed
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.