SA-MP Forums Archive
[SOLVED]Animation Preloading - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED]Animation Preloading (/showthread.php?tid=124184)



[SOLVED]Animation Preloading - V1ceC1ty - 29.01.2010

I've been trying for hours now to preload this animation on an NPC but it seems to be getting nowhere.

heres the code, why wont it work. The NPC just stands there.
pawn Code:
#include <a_samp>

new RandomVeh;
new Loaded[MAX_PLAYERS];

public OnGameModeInit()
{
    RandomVeh = AddStaticVehicle(457,1402.7024,2816.2568,10.4394,89.0047,13,1);
    ConnectNPC("Stripper","stripper");
    return 1;
}

public OnPlayerConnect(playerid)
{
  Loaded[playerid] = 0;
  return 1;
}

public OnPlayerSpawn(playerid)
{
  if(!Loaded[playerid])
    {
        PreloadAnimLib(playerid,"DANCING");
        Loaded[playerid] = 1;
    }
   
  if(!IsPlayerNPC(playerid)) return 0;

    new playername[64];
    GetPlayerName(playerid,playername,64);

    if(!strcmp(playername,"Stripper",true)) {
    SetSpawnInfo( playerid, 0, 87, 1203.9446,16.5226,1000.9219, 344.9598, 0, 0, 0, 0, 0, 0 );
    PutPlayerInVehicle(playerid, RandomVeh, 0);
    ApplyAnimation(playerid,"DANCING","DAN_Loop_A",4.1,1,1,1,1,0);
    }
  return 1;
}

stock PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}




Re: Animation Preloading - wangdata - 29.01.2010

I added general command
Code:
if(!strcmp(cmdtext, "/work", true))
  {
 		PutPlayerInVehicle(0, RandomVeh, 0);
    ApplyAnimation(0,"DANCING","DAN_Loop_A",4.1,1,1,1,1,0);
    return 1;
Teleport to location stripper out of car not dancing, on /work command stripper dances but doesn't get in the car. Might help


Re: [SOLVED]Animation Preloading - wangdata - 30.01.2010

how did u solve?