Jump to content

Question

Posted

Problema intalnita (descriere): Cand ma urc in orice masina , am permisul ma da afara .
Ero(area / rile) / warning-(ul / urile): 0
Liniile de cod / sursa / script-ul(obligatoriu): 0
Imagini / Video (optional): Nu am dar merge greu cand filmez si in imagini nu arata.
Ati incercat sa rezolvati singur?: Nustiu cum.

8 answers to this question

Recommended Posts

  • 0
Posted (edited)

Nu gasesc nimic doar asta

public OnPlayerExitVehicle(playerid, vehicleid) {
	#if defined DEBUG
	    printf("[debug] OnPlayerExitVehicle(%d, %d)", playerid, vehicleid);
	#endif
	StopAudioStreamForPlayer(playerid);

	if( vehicleVariables[ vehicleid ][ vVehicleJob ] == 5 )
	{
		DisablePlayerCheckpoint( playerid );
		RemovePlayerFromVehicle( playerid );
		CP[ playerid ] = 0;
		if( pTrailer[ playerid ] )
		{
			SetVehicleToRespawn( vehicleid );
			DestroyVehicle( pTrailer[ playerid ] );
			SendClientMessage( playerid, -1, "Job has been failed !" );
		}
	}
		
	if (  vehicleVariables[vehicleid][vVehicleGroup] == 1 && COPRadar [ playerid ] != -1 )
	{
		    COPRadar [ playerid ] = -1 ;
		    SCM ( playerid , -1 , "You destroyed the radar in this area" ) ;
		   	TogglePlayerControllable ( playerid , false ) ;
	}

  	TakingLesson[playerid] = 0;
	if(IsADmvCar(vehicleid))
	{
		TextDrawHideForPlayer(playerid, DMV2[playerid]);
		TextDrawHideForPlayer(playerid, DMV1[playerid]);
	    DisablePlayerRaceCheckpoint(playerid);
		TakingLesson[playerid] = 0;
		if(GetPlayerState(playerid) == 2)
		{
		    SendClientMessage(playerid, COLOR_WHITE, "You left the vehicle and lost the test.");
		    SetVehicleToRespawn(vehicleid);
		}
	}
	return SetPlayerArmedWeapon(playerid, 0);
}

 

Edited by marian2001
  • 0
Posted

Callback-ul asta e cand un player iese din vehicul.Cauta din nou OnPlayerEnterVehicle

cum au zis Reflex si WopsS

  • 0
Posted (edited)

Nu este in gamemode de loc

Cauta la OnPlayerStateChange 

 

Edited by ..::STeFaNN::..
  • 0
Posted
public OnPlayerStateChange(playerid, newstate, oldstate) {
	#if defined DEBUG
	    printf("[debug] OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate);
	#endif


	if(newstate == PLAYER_STATE_DRIVER)
	{
		
		
		// God of Cars
		if ( GetTickCount ( ) - EnterCarTime [ playerid ] < 1000 )
		{
	        EnterCarHack [ playerid ] += 1 ;
	        if ( EnterCarHack [ playerid ] > 2 )
			{
			    new string[ 128 ];
	            format ( string , sizeof ( string ) , "{FF0000}[Anti-Cheat]: %s has detected possible Spam Hack Car." , playerVariables[ playerid ][ pNormalName ] ) ;
	            submitToHelpersAndAdmins( string , -1 ) ;
	            Kick ( playerid ) ;
	        }
	    }

		EnterCarTime [ playerid ] = GetTickCount ( ) ;
		 //
	    
		if(playerVariables[playerid][pFirstPerson] == 1)
		{
			new p = GetPlayerVehicleID(playerid);
			pObj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
			AttachPlayerObjectToVehicle(playerid,pObj[playerid],p,-0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000);
			AttachCameraToPlayerObject(playerid,pObj[playerid]);
		}
	}
	else if(playerVariables[playerid][pFirstPerson] == 0)
	{
		SetCameraBehindPlayer(playerid);
		DestroyPlayerObject(playerid,pObj[playerid]);
	}
	if(newstate == PLAYER_STATE_ONFOOT)
	{
		if(playerVariables[playerid][pFirstPerson] == 1)
		{
			SetCameraBehindPlayer(playerid);
			DestroyPlayerObject(playerid,pObj[playerid]);
		}
	}
	new vID = GetPlayerVehicleID( playerid );
	if( oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT )
	{
	  	if ( vehicleVariables[vID][vVehicleGroup] == 1 && COPRadar [ playerid ] != -1 )
		{
			    COPRadar [ playerid ] = -1 ;
			    SCM ( playerid , -1 , "You destroyed the radar in this area" ) ;
			   	TogglePlayerControllable ( playerid , false ) ;
			   	return 1;
		}
	}
	foreach(Player, x)
	{
		if(playerVariables[x][pSpectating] != INVALID_PLAYER_ID && playerVariables[x][pSpectating] == playerid)
		{
			if(newstate == 2 && oldstate == 1 || newstate == 3 && oldstate == 1)
			{
				new string[500];
				new Float: health;
				GetPlayerHealth(playerid, health);

				new Float:health2;
		    	new veh = GetPlayerVehicleID(playerid);
		    	GetVehicleHealth(veh, health2);

		    	new Speed = GetSpeed(playerid);


				format(string, 500,"%s [~r~%i~w~] - L ~r~%i~w~", playerVariables[playerid][pNormalName], playerid,playerVariables[playerid][pLevel]);
				TextDrawSetString(info[x], string);

				format(string, 500,"Health: ~r~%.0f~w~", health);
				TextDrawSetString(viata[x], string);

				format(string, 500,"W: ~r~%d~w~ - Jail: ~r~%d~w~ minutes", playerVariables[playerid][pWarrants], playerVariables[playerid][pPrisonTime] / 60);
				TextDrawSetString(wantedjail[x], string);

				format(string, 500,"Car ~r~%d~w~ [~r~%.0f~w~ HP]", GetPlayerVehicleID(playerid), health2);
				TextDrawSetString(carinfo[x], string);

				format(string, 500,"Speed: ~g~%d KM/H~w~", Speed);
				TextDrawSetString(carspeed[x], string);

				TextDrawShowForPlayer(x, info[x]);
				TextDrawShowForPlayer(x, carspeed[x]);
				TextDrawShowForPlayer(x, carinfo[x]);
				TextDrawShowForPlayer(x, viata[x]);
				TextDrawShowForPlayer(x, wantedjail[x]);

				PlayerSpectateVehicle(x, GetPlayerVehicleID(playerid));
			}
		

 

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.