[SOLVED]Animation Preloading
#1

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

Reply
#2

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
Reply
#3

how did u solve?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)