Jump to content
  • 0

Intrebare GM Burned.


SupremAngel

Question

Salut,

Deci, nici mie nu imi vine sa cred, ca pun astfel de intrebare, dar.. se mai intampla :)). 

Deci, folosesc sistemul de masini personale din GM-ul Burned. Problema este, cand te deconectezi de pe server, nu dispar masiniile. 

functia pentru despawnare este: DestroyPlayerCar, din cate am inteles eu. Daca stie cineva solutia, as aprecia mult daca ma poate ajuta.

Multumesc anticipat!

Edited by Hudson.
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Din cate stiu la sistemul de vehicule de la burned este buguit

A 2-a problema ti se respawneaza vehiculele la 2 minute , chit ca este vehiculul ocupat chit ca nu .

Functiile pentru vehicule sunt acestea .

function DespawnVehicle(carid) {
	new dbid = FindSpawnID(carid);
	if(CarInfo[dbid][Spawned] != 0) DestroyPlayerCar(dbid);
	printf("Vehicle %d despawned. [db: %d]", carid, dbid);
	return 1;
}
stock DestroyPlayerCar(dbid) {
	if(CarInfo[dbid][Spawned] == 0) return 1;
	
	VehicleOwned[CarInfo[dbid][Spawned]] = 0;
	VehicleSQL[CarInfo[dbid][Spawned]] = 0;
		
	new Float: Pos[3];
	GetVehiclePos(CarInfo[dbid][Spawned], Pos[0], Pos[1], Pos[2]);
	if(CarInfo[dbid][cNeon] != 0) {
		DestroyDynamicObject(neon[0][CarInfo[dbid][Spawned]]);
		DestroyDynamicObject(neon[1][CarInfo[dbid][Spawned]]);
		neon[0][CarInfo[dbid][Spawned]] = 0;
		neon[1][CarInfo[dbid][Spawned]] = 0;	
	}
	if(strlen(CarInfo[dbid][cText]) >= 3) DestroyDynamicObject(nameobject[CarInfo[dbid][Spawned]]);
	CarInfo[dbid][cFuel] = Gas[CarInfo[dbid][Spawned]];
	new query[256];
	format(query, sizeof(query), "UPDATE `cars` SET `Fuel`='%d' WHERE `ID`='%d'", CarInfo[dbid][cFuel], dbid);
	mysql_query(SQL, query);
	
	CarInfo[dbid][cLastPos][0] = Pos[0];
	CarInfo[dbid][cLastPos][1] = Pos[1];
	CarInfo[dbid][cLastPos][2] = Pos[2];	
		
	DestroyVehicle(CarInfo[dbid][Spawned]);
	CarInfo[dbid][Spawned] = 0;
	new string[180];
	mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[dbid][Spawned], dbid);
	mysql_tquery(SQL, string, "", "");
	return 1;
}

 

Edited by Marlboro

 

vldgIri.png

YouTube : Click Redirect Channel

Discord : Arabu#9330

Canal Discord : Click To Join

Facebook : Click Facebook

Instagram : Click Instagram

Skype : Mita.Official

Respectă și vei fi respectat !

Link to comment
Share on other sites

  • 0

          

Citat

A 2-a problema ti se respawneaza vehiculele la 2 minute , chit ca este vehiculul ocupat chit ca nu .

 pentru problema asta, stergi randurile astea.

new carid = FindSpawnID(gLastCar[playerid]);
 if(carid != 0) VehicleTimer[gLastCar[playerid]] = SetTimerEx("DespawnVehicle", 60000*20, 0, "d", gLastCar[playerid]);

 

------------------------------------------

Am folosit la OnPlayerDisconect:

new cars = ?
DespawnVehicle(cars);

 

Edited by Hudson.
Link to comment
Share on other sites

  • 0
	if(PlayerInfo[playerid][pCarKey][0] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][0]);
	if(PlayerInfo[playerid][pCarKey][1] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][1]);
	if(PlayerInfo[playerid][pCarKey][2] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][2]);
	if(PlayerInfo[playerid][pCarKey][3] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][3]);
	if(PlayerInfo[playerid][pCarKey][4] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][4]);
	if(PlayerInfo[playerid][pCarKey][5] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][5]);
	if(PlayerInfo[playerid][pCarKey][6] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][6]);
	if(PlayerInfo[playerid][pCarKey][7] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][7]);
	if(PlayerInfo[playerid][pCarKey][8] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][8]);
	if(PlayerInfo[playerid][pCarKey][9] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][9]);

asta e si eu am avut aceasta problema si mi-o mers si ca sa nu se despawneze masinile in timp ce mergi:

ilocuiesti funcita ta cu asta

}
function DespawnVehicle(carid) {
	new dbid = FindSpawnID(carid);
	if(IsVehicleOccupied(CarInfo[carid][Spawned])) return 1;
	if(CarInfo[dbid][Spawned] != 0) DestroyPlayerCar(dbid);
	printf("Vehicle %d despawned. [db: %d]", carid, dbid);
	return 1;
}

practic ce e adaugat e verificarea ca daca masina e ocupata sa nu se despawneze nu iti recomand sa stergi timerul!

 

Link to comment
Share on other sites

  • 0
Acum 1 minut, caltabos a spus:
	if(PlayerInfo[playerid][pCarKey][0] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][0]);
	if(PlayerInfo[playerid][pCarKey][1] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][1]);
	if(PlayerInfo[playerid][pCarKey][2] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][2]);
	if(PlayerInfo[playerid][pCarKey][3] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][3]);
	if(PlayerInfo[playerid][pCarKey][4] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][4]);
	if(PlayerInfo[playerid][pCarKey][5] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][5]);
	if(PlayerInfo[playerid][pCarKey][6] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][6]);
	if(PlayerInfo[playerid][pCarKey][7] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][7]);
	if(PlayerInfo[playerid][pCarKey][8] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][8]);
	if(PlayerInfo[playerid][pCarKey][9] != 0) DestroyPlayerCar(PlayerInfo[playerid][pCarKey][9]);

astea le pui la onplayerdisconnect

Edited by caltabos
Link to comment
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.