Рекомендованные сообщения



2 posts in this topic

Спойлер

}
CMD:alock(playerid, params[]) {
	if(PI[playerid][pAdmin] < 1 || dostup[playerid] == 0) return true;
	GetVehicleParamsEx(GetNearestVehicle(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
	PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
	switch(doors) {
	    case 0: GameTextForPlayer(playerid, "~r~LOCK", 5000, 3), doors_status(GetNearestVehicle(playerid), playerid);
		case 1: GameTextForPlayer(playerid, "~g~UNLOCK", 5000, 3), doors_status(GetNearestVehicle(playerid), playerid);
	}
	return true;

 

 

Share this post


Link to post
Share on other sites

@Drummer1993, если неважно, на каком месте он сидит:

Спойлер

CMD:alock(playerid, params[]) {
	if(PI[playerid][pAdmin] < 1 || dostup[playerid] == 0) return true;
	if(!IsPlayerInAnyVehicle(playerid)) return true; // может быть ваше действие
	GetVehicleParamsEx(GetNearestVehicle(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
	PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
	switch(doors) {
	    case 0: GameTextForPlayer(playerid, "~r~LOCK", 5000, 3), doors_status(GetNearestVehicle(playerid), playerid);
		case 1: GameTextForPlayer(playerid, "~g~UNLOCK", 5000, 3), doors_status(GetNearestVehicle(playerid), playerid);
	}
	return true;

 

 

Если должен быть обязательно водителем:

Спойлер

CMD:alock(playerid, params[]) {
	if(PI[playerid][pAdmin] < 1 || dostup[playerid] == 0) return true;
	if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return true; // может быть ваше действие
	GetVehicleParamsEx(GetNearestVehicle(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
	PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
	switch(doors) {
	    case 0: GameTextForPlayer(playerid, "~r~LOCK", 5000, 3), doors_status(GetNearestVehicle(playerid), playerid);
		case 1: GameTextForPlayer(playerid, "~g~UNLOCK", 5000, 3), doors_status(GetNearestVehicle(playerid), playerid);
	}
	return true;

 

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0