13.09.2012, 19:53
What am I doing wrong?
OnPlayerSpawn:
So my question is, why won't this work?
Everything but the animations work, but the thing is, once the player has died once, the animations work.
OnPlayerSpawn:
pawn Code:
if(! plAnimationsPreLoaded [ playerid ] ) {
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
plAnimationsPreLoaded [ playerid ] = 1;
}
pawn Code:
PreloadAnimLib(playerid, animlib[])
{
ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
So my question is, why won't this work?
pawn Code:
if( plJustDied [ playerid ] == true )
{
SetPlayerPos( playerid, plDeathPosition [ playerid ] [ 0 ], plDeathPosition [ playerid ] [ 1 ], plDeathPosition [ playerid ] [ 2 ] - 0.95 );
SetPlayerFacingAngle( playerid, plDeathPosition [ playerid ] [ 3 ] );
SetPlayerInterior( playerid, plDeathInterior [ playerid ] );
SetPlayerVirtualWorld( playerid, plDeathVirtualWorld [ playerid ] );
TogglePlayerControllable( playerid, false );
ApplyAnimation( playerid, "SWAT", "Rail_fall_crawl", 4.1, 1, 1, 1, 1, 0, 1 );
ApplyAnimation( playerid, "SWAT", "Rail_fall_crawl", 4.1, 1, 1, 1, 1, 0, 1 );
SendClientMessage( playerid, -1, "* You have been severely injured. Roleplay your injuries and then type "#Int_RankOrange"/acceptdeath "#Int_White"to be transported to a hospital." );
}