Jump to content
  • 0

Ajutor, masina personala


Question

20 answers to this question

Recommended Posts

  • 0

Salutare,

Trebuie sa vedem o parte din cod, comanda /lock si partea de verificare unde intra in masina la onplayerstatechange sau onplayerentervehicle depinde cum e facut sistemul.

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to post
Share on other sites
  • 0

Incearca sa pui la onplayerentervehicle urmatorul cod
 


new carid = FindSpawnID(vehicleid);
if(CarInfo[carid][Userid] == PlayerInfo[playerid][pSQLID])
{
   new objective;
   GetVehicleParamsEx(vehicleid,objective,objective,objective,objective,objective,objective,objective);
   SetVehicleParamsForPlayer(vehicleid,objective,0);
}

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to post
Share on other sites
  • 0
Acum 6 minute, Mister a spus:

Incearca sa pui la onplayerentervehicle urmatorul cod
 


new carid = FindSpawnID(vehicleid);
if(CarInfo[carid][Userid] == PlayerInfo[playerid][pSQLID])
{
   new objective;
   GetVehicleParamsEx(vehicleid,objective,objective,objective,objective,objective,objective,objective);
   SetVehicleParamsForPlayer(vehicleid,objective,0);
}

 

Nu functioneaza, tot trebuie sa deschid masina ca sa pot intra in ea.

Link to post
Share on other sites
  • 0

nu a pus el cum trebuie, schimba linia cu setvehicleparamsforplayer in asta:

SetVehicleParamsForPlayer(vehicleid, playerid, objective, 0);
  • Upvote 1
Link to post
Share on other sites
  • 0
Acum 49 minute, NERS a spus:

nu a pus el cum trebuie, schimba linia cu setvehicleparamsforplayer in asta:

SetVehicleParamsForPlayer(vehicleid, playerid, objective, 0);

Tot nu functioneaza, toata treaba aia doar imi pune deasupra masinii un checkpoint galben, atat.
Eu vreau pur si simplu sa te lase sa intri in masina fara sa o mai deschizi atunci cand este masina ta personala.

Link to post
Share on other sites
  • 0

new carid = FindSpawnID(playerid);

if(VehicleKey[playerid] != 0 && VehicleKey[playerid] == carid) {

     SetVehicleParamsForPlayer(carid, playerid, 0, 0);

}

Link to post
Share on other sites
  • 0
new carid = FindSpawnID(vehicleid);

if(CarInfo[carid][Userid] == PlayerInfo[playerid][pSQLID])
    SetVehicleParamsForPlayer(vehicleid, playerid, 0, 0);
Link to post
Share on other sites
  • 0
Acum 18 ore, MiritaXD a spus:
new carid = FindSpawnID(vehicleid);

if(CarInfo[carid][Userid] == PlayerInfo[playerid][pSQLID])
    SetVehicleParamsForPlayer(vehicleid, playerid, 0, 0);

 

Acum 19 ore, hanako a spus:

new carid = FindSpawnID(playerid);

if(VehicleKey[playerid] != 0 && VehicleKey[playerid] == carid) {

     SetVehicleParamsForPlayer(carid, playerid, 0, 0);

}

Nu a functionat niciuna din astea 2...Habar nu am dc nu merge. Cand e masina deschisa pot intra in ea, logic, dar cand e inchisa nu..

Link to post
Share on other sites
  • 0

Neoanele nu au treaba cu ce ti-am dat eu, acolo ai modificat tu, vezi functia de spawnare a vehiculelor, eu doar ti-am dezactivat parametrii

SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);

Si la intrarea in vehicul ti se facea o verificare daca esti owner ca sa te poata lasa sa intrii in vehicul, atat, in rest tu stii ce ai facut

Link to post
Share on other sites
  • 0
Acum 2 ore, iSkull a spus:

Neoanele nu au treaba cu ce ti-am dat eu, acolo ai modificat tu, vezi functia de spawnare a vehiculelor, eu doar ti-am dezactivat parametrii

SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);

Si la intrarea in vehicul ti se facea o verificare daca esti owner ca sa te poata lasa sa intrii in vehicul, atat, in rest tu stii ce ai facut

Nu am modificat nimic, dar nu merge ce mi-ai dat. Cred ca nu se verifica bine daca este masina ta personala pentru ca nu te mai baga deloc in masina nici daca e inchisa nici daca e deschisa.

Link to post
Share on other sites
  • 0
Acum 16 minute, optimus27 a spus:

Nu am modificat nimic, dar nu merge ce mi-ai dat. Cred ca nu se verifica bine daca este masina ta personala pentru ca nu te mai baga deloc in masina nici daca e inchisa nici daca e deschisa.

Dupa cum am spus, verifica functia de spawnare a vehiculelor personale, trebuie sa ai ceva legat de SetVehicleParamsEx, codul pe care ti l-am dat eu e bun, problema nu e de acolo

Link to post
Share on other sites
  • 0

Cauta codul: 

Gas[CarInfo[dbid][Spawned]] = CarInfo[dbid][cFuel];
		GetVehicleParamsEx(CarInfo[dbid][Spawned],engine,lights,alarm,doors,bonnet,boot,objective);
		SetVehicleParamsEx(CarInfo[dbid][Spawned],0,lights,alarm,CarInfo[dbid][cLock],bonnet,boot,objective);
		new carid = CarInfo[dbid][Spawned];

Si modifici astfel:

Gas[CarInfo[dbid][Spawned]] = CarInfo[dbid][cFuel];
		new carid = CarInfo[dbid][Spawned];

 

Edited by iSkull
Link to post
Share on other sites
  • 0
Acum 24 minute, iSkull a spus:

Cauta codul: 

Gas[CarInfo[dbid][Spawned]] = CarInfo[dbid][cFuel];
		GetVehicleParamsEx(CarInfo[dbid][Spawned],engine,lights,alarm,doors,bonnet,boot,objective);
		SetVehicleParamsEx(CarInfo[dbid][Spawned],0,lights,alarm,CarInfo[dbid][cLock],bonnet,boot,objective);
		new carid = CarInfo[dbid][Spawned];

Si modifici astfel:

Gas[CarInfo[dbid][Spawned]] = CarInfo[dbid][cFuel];
		new carid = CarInfo[dbid][Spawned];

 

Ok, acum a functionat, dar cand inchid si deschid masina textul cu LOCKED UNLOCKED de jos nu se modifica. Indiferent ca deschid sau inchid masina ramane neschimbat in UNLOCKED.

Link to post
Share on other sites
  • 0

Nu stiu cum ti-ai lasat codul de la lock car, dar e o problema de variabila

 

Edit:

Daca ai: 

if(CarInfo[idd][cLock] == 0) {
		CarInfo[idd][cLock] = 1;
		//SetVehicleParamsEx(car,engine,lights,alarm,1,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~r~Inchis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
	}
	else {
		CarInfo[idd][cLock] = 0;
		//SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~g~Deschis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
	}

Schimba astfel:

if(CarInfo[idd][cLock] == 0) {
		CarInfo[idd][cLock] = 1;
		//SetVehicleParamsEx(car,engine,lights,alarm,1,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~r~Inchis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
		return 1;
	}
	else {
		CarInfo[idd][cLock] = 0;
		//SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~g~Deschis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
		return 1;
	}

SAU

if(CarInfo[idd][cLock] == 0) {
		CarInfo[idd][cLock] = 1;
		//SetVehicleParamsEx(car,engine,lights,alarm,1,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~r~Inchis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
	}
	else if(CarInfo[idd][cLock] == 1) {
		CarInfo[idd][cLock] = 0;
		//SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~g~Deschis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
	}

Din cauza ca la prima varianta pe care o ai tu, mereu va ramane deschis cu acel else, daca e incuiata, ea va deveni descuiata

Edited by iSkull
Link to post
Share on other sites
  • 0
Chiar acum, optimus27 a spus:

L-am lasat cum mi l-ai dat.

Am dat edit la ultimul reply

 

Acum 3 minute, iSkull a spus:

Nu stiu cum ti-ai lasat codul de la lock car, dar e o problema de variabila

 

Edit:

Daca ai: 

if(CarInfo[idd][cLock] == 0) {
		CarInfo[idd][cLock] = 1;
		//SetVehicleParamsEx(car,engine,lights,alarm,1,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~r~Inchis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
	}
	else {
		CarInfo[idd][cLock] = 0;
		//SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~g~Deschis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
	}

Schimba astfel:

if(CarInfo[idd][cLock] == 0) {
		CarInfo[idd][cLock] = 1;
		//SetVehicleParamsEx(car,engine,lights,alarm,1,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~r~Inchis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
		return 1;
	}
	else {
		CarInfo[idd][cLock] = 0;
		//SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~g~Deschis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
		return 1;
	}

SAU

if(CarInfo[idd][cLock] == 0) {
		CarInfo[idd][cLock] = 1;
		//SetVehicleParamsEx(car,engine,lights,alarm,1,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~r~Inchis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
	}
	else if(CarInfo[idd][cLock] == 1) {
		CarInfo[idd][cLock] = 0;
		//SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);
		format(string, sizeof(string), "~w~%s~n~~g~Deschis",aVehicleNames[GetVehicleModel(car)-400]);
		GameTextForPlayer(playerid, string, 5000, 4);
	}

Din cauza ca la prima varianta pe care o ai tu, mereu va ramane deschis cu acel else, daca e incuiata, ea va deveni descuiata

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.