Jump to content
  • 0

Problema /lock


Bogdan's

Question

Problema intalnita (descriere): Am facut cateva schimbari in gamemode,dar nu am umblat deloc la sistemul de dealership.Si vad ca acum nu ma mai lasa sa dau /lock la masina,/engine ma lasa,dar /lock nu.Si cand dau restart la server,masina nu ramane salvata.
Ero(area / rile) / warning-(ul / urile): Nu avem.
Liniile de cod / sursa / script-ul(obligatoriu): 

if(strcmp(cmd, "/lock", true) == 0)
	{
	    new name[20];
	    GetPlayerName(playerid, name, sizeof(name));
	    new counter = 0;
		new result;
	    for(new i; i != MAX_VEHICLES; i++)
		{
			new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
			if(dist)
			{
				result = i;
			    counter++;
			}
		}
		switch(counter)
		{
			case 0:
			{
				SendClientMessage(playerid, COLOR_GREY, "   Nici o masina in zona");
			}
			case 1:
			{
			    if(IsAnOwnableCar(result))
               	{
               		if(strcmp(name, CarInfo[result][cOwner], true) == 0) { }
               		else
               		{
			        	SendClientMessage(playerid, COLOR_GREY, "  Nu ai cheile de la vehicul !");
			            return 1;
					}
			    }
			    else
			    {
			        SendClientMessage(playerid, COLOR_GREY, "  Nu ai cheile de la vehicul !");
			        return 1;
			    }
				GetPlayerName(playerid, sendername, sizeof(sendername));
				if(CarInfo[result][cLock] == 1)
			    {
			    	for(new i = 0; i < MAX_PLAYERS; i++)
					{
						if (IsPlayerConnected(i))
						{
						    SetVehicleParamsEx(result, -1, -1, -1, 0, -1, -1, -1);
						}
					}
					format(string, sizeof(string), "~w~Vehicul~n~~g~Deschis");
					GameTextForPlayer(playerid, string, 4000, 3);
					CarInfo[result][cLock] = 0;
					format(string, sizeof(string), "* %s a deschis vehiculul", name);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					OnPropUpdate();
					return 1;
				}
				else if(CarInfo[result][cLock] == 0)
				{
					for(new i = 0; i < MAX_PLAYERS; i++)
					{
						if (IsPlayerConnected(i))
						{
						    SetVehicleParamsEx(result, -1, -1, -1, 1, -1, -1, -1);
						}
					}
					format(string, sizeof(string), "~w~Vehicul~n~~r~Inchis");
					GameTextForPlayer(playerid, string, 4000, 3);
					CarInfo[result][cLock] = 1;
					format(string, sizeof(string), "* %s a inchis vehiculul", name);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					OnPropUpdate();
					return 1;
				}
			}
			default:
			{
				SendClientMessage(playerid, COLOR_GREY, "   Prea multe masini in zona");
			    return 1;
			}
		}
		return 1;
	}


Imagini / Video (optional): Daca e neovie pun.
Ati incercat sa rezolvati singur?: Da,am incercat dar nu am vazut nimic neobisnuit.

Edited by Bogdan's
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

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.