Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Question

2 answers to this question

Recommended Posts

  • 0
Posted

Salut @NERS,

Iti ofer mai jos un exemplu:

new Float: X, Float: Y, Float: Z;
if( IsPlayerInRangeOfPoint( playerid, raza_zonei, x_zona, y_zona, z_zona ) ) {
	if( IsPlayerInAnyVehicle( playerid ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) {
		DisableRemoteVehicleCollisions( playerid, true );
		Collisions_ON[ playerid ] = true;
	}
}

Practic, detectezi daca un jucator se afla in zona respectiva, daca se afla intr-un vehicul si daca este soferul unui vehicul, iar mai apoi, ii dezactiveaza coliziunile.

Dupa care vei avea de detectat daca jucatorul a iesit din zona respectiva, si daca are coliziunile activate. Deci va trebui sa creezi o noua variabila (ex: Collisions_ON[ playerid ]), si sa i le dezactivezi.

new Float: X, Float: Y, Float: Z;
if( !IsPlayerInRangeOfPoint( playerid, raza_zonei, x_zona, y_zona, z_zona ) && Collisions_ON[ playerid ] ) {
	if( IsPlayerInAnyVehicle( playerid ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) {
		DisableRemoteVehicleCollisions( playerid, false );
		Collisions_ON[ playerid ] = false;
	}
}

Cam asta ar fi. Va trebui sa adaugi totul intr-un timer global.

Daca te-am ajutat =>

spacer.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.