Jump to content
  • 0

Problema /park


Question

Posted (edited)

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

7 answers to this question

Recommended Posts

  • 0
Posted
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

  • 0
Posted
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

  • 0
  • 0
Posted

Se refera la respawn masina acolo

Mi-o parchează mașina dar numai când s-a restartat server-ul atat și nu vreau așa... vreau câns tastează /park să o pună pe loc

  • 0
Posted (edited)
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
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.