SA-MP Forums Archive
PlayerSound - Kick - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayerSound - Kick (/showthread.php?tid=573940)



PlayerSound - Kick - Zloto - 11.05.2015

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 ?


Re: PlayerSound - Kick - Abagail - 11.05.2015

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.


Re: PlayerSound - Kick - Zloto - 11.05.2015

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


Re: PlayerSound - Kick - JaydenJason - 11.05.2015

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..


Re: PlayerSound - Kick - Zloto - 11.05.2015

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 ?


Re: PlayerSound - Kick - MP2 - 11.05.2015

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


Re: PlayerSound - Kick - Abagail - 11.05.2015

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;
}



Re: PlayerSound - Kick - Zloto - 11.05.2015

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