PlayerSound - Kick
#1

Can someone tell me what is the ID of some sound that is near to KICK or DECLINE or DENY (I dont know how to explain it) The idea is if he enters a car and rejecet a player message to kick him out with sound. And my other question is how can i kick him out with animation directly to stand next to the car not to animate how he is getting out of it ?
Reply
#2

You can use RemovePlayerFromVehicle to show the animation of a player exiting a vehicle. 1138 is a good sound for a notification, however I believe there are better sounds for a denial.
Reply
#3

I dont want to show the animation of player getting out. I want to kick him directly next to the driver's door.
Reply
#4

24600 is the sound id of the car door its handle being pulled, but can't manage to open it.

You can use ClearAnimations(playerid); to stop any animations, making the player stand still, so here's this:
Код:
(Using "PlayerPlaySound(playerid, soundid, Float:x, Float:y, Float:z)"
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetPlayerVehicleID(playerid) == THEVEHIDLEIDOFTHECARTHEPLAYERCANTENTER)
	{
		ClearAnimations(playerid);
		SendClientMessage(playerid, -1, "{FF0000}You can not enter this vehicle!");
		PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
	}
	return 1;
}
To make it a little better, you could try getting the player pos and changing the 3 "0.0"'s to the players position, isn't needed but yeah..
Reply
#5

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
24600 is the sound id of the car door its handle being pulled, but can't manage to open it.

You can use ClearAnimations(playerid); to stop any animations, making the player stand still, so here's this:
Код:
(Using "PlayerPlaySound(playerid, soundid, Float:x, Float:y, Float:z)"
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetPlayerVehicleID(playerid) == THEVEHIDLEIDOFTHECARTHEPLAYERCANTENTER)
	{
		ClearAnimations(playerid);
		SendClientMessage(playerid, -1, "{FF0000}You can not enter this vehicle!");
		PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0.0);
	}
	return 1;
}
To make it a little better, you could try getting the player pos and changing the 3 "0.0"'s to the players position, isn't needed but yeah..
This is perfect. But I have a dialog on car enter and if he declines the dialog it kicks him. But can i delay the dialog a little bit untill he enters the car and sit it in? Because if he declines the dialog before enterin it's not kicking him ?
Reply
#6

Use OnPlayerStateChange. That is called when a player has entered the vehicle, while OnPlayerEnterVehicle is called when a player STARTS to enter a vehicle.
Reply
#7

Also he doesn't want ClearAnimations, he want's the animation of someone leaving the vehicle which is RemovePlayerFromVehicle. e.g:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) {
     if(newstate == PLAYER_STATE_DRIVER && G_iAccess[GetPlayerVehicleID(playerid)] == 0) {
            RemovePlayerFromVehicle(playerid);
            PlayerPlaySound(playerid, 24600, 0.0, 0.0, 0);
     }

     return 1;
}
Reply
#8

@JaydenJason and @MP2 you helped a lot thanks. And yes I needed OnPlayerStateChange - So now it works perfect Thanks a lot guys.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)