Animations and Class Selection - 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: Animations and Class Selection (
/showthread.php?tid=499044)
Animations and Class Selection -
AwokenNeoX - 06.03.2014
I want to make Animations and Class Selection with Music how can I do it like this:
[ame]http://www.youtube.com/watch?v=-Ea2CLAz3cc[/ame]
Re: Animations and Class Selection -
XK - 06.03.2014
make under OnGameModeInit..
pawn Код:
AddPlayerClass(skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
and same for the other skins...float x means when player chooses this skin,this will be the position x of his spawn,and same for y and z
and
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, x,y,z); //when player wants to select a skin,where do you want him to look at,,in the video it's alhambra..
SetPlayerFacingAngle(playerid, angle); //same for the pos but this means where do you want him to look at,north or ..
SetPlayerCameraPos(playerid, x,y,z); //where do you want his camera's pos at
SetPlayerCameraLookAt(playerid, x,y,z); //where do you want his camera to look at
return 1;
}
and to make him do animation use:
pawn Код:
if(classid == 1) //lets say you added few classes using AddPlayerClass,and the first skin you set is for example 299,then this one should be:if he chose skin id 299
{
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,1,1); //to do chatting animation for example...
return 0;
}
and under OnPlayerSpawn
pawn Код:
ClearAnimations(playerid); //to stop the animation