force animations
#1

When I force my animations it's not working. When the player goes to the hospital he's supposed to play an animation but he does not.

pawn Код:
SetTimerEx("DeathTimer", 15000, false, "i", playerid);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 4099.4790,-184.1868,59.8823);
        SetPlayerFacingAngle(playerid, 90.7286);
        SetPlayerCameraPos(playerid, 4096.7334,-186.8211,59.2456);
        SetPlayerCameraLookAt(playerid, 4099.4790,-184.1868,59.8823);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 0, 0, 0, 0, 0, 1);
        SendClientMessage(playerid, COLOR_LIGHTRED, "You're being treated at the hospital...");
        SetPlayerHealth(playerid, 10);
        AtHospital[playerid] = 1;
Reply
#2

Add these lines under OnPlayerSpawn:

pawn Код:
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,"PED");
    PreloadAnimLib(playerid,"MISC"); PreloadAnimLib(playerid,"OTB");
    PreloadAnimLib(playerid,"BD_Fire"); PreloadAnimLib(playerid,"BENCHPRESS");
    PreloadAnimLib(playerid,"KISSING"); PreloadAnimLib(playerid,"BSKTBALL");
    PreloadAnimLib(playerid,"MEDIC"); PreloadAnimLib(playerid,"SWORD");
    PreloadAnimLib(playerid,"POLICE"); PreloadAnimLib(playerid,"SUNBATHE");
    PreloadAnimLib(playerid,"FAT"); PreloadAnimLib(playerid,"WUZI");
    PreloadAnimLib(playerid,"SWEET"); PreloadAnimLib(playerid,"ROB_BANK");
    PreloadAnimLib(playerid,"GANGS"); PreloadAnimLib(playerid,"RIOT");
    PreloadAnimLib(playerid,"GYMNASIUM"); PreloadAnimLib(playerid,"CAR");
    PreloadAnimLib(playerid,"CAR_CHAT"); PreloadAnimLib(playerid,"GRAVEYARD");
    PreloadAnimLib(playerid,"POOL");
Add this anywhere in your script (outside of a callback/function):

pawn Код:
stock PreloadAnimLib(playerid, animlib[]) ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
These functions basically load the animation before you try to apply it IIRC.
Reply
#3

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Add these lines under OnPlayerSpawn:

pawn Код:
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,"PED");
    PreloadAnimLib(playerid,"MISC"); PreloadAnimLib(playerid,"OTB");
    PreloadAnimLib(playerid,"BD_Fire"); PreloadAnimLib(playerid,"BENCHPRESS");
    PreloadAnimLib(playerid,"KISSING"); PreloadAnimLib(playerid,"BSKTBALL");
    PreloadAnimLib(playerid,"MEDIC"); PreloadAnimLib(playerid,"SWORD");
    PreloadAnimLib(playerid,"POLICE"); PreloadAnimLib(playerid,"SUNBATHE");
    PreloadAnimLib(playerid,"FAT"); PreloadAnimLib(playerid,"WUZI");
    PreloadAnimLib(playerid,"SWEET"); PreloadAnimLib(playerid,"ROB_BANK");
    PreloadAnimLib(playerid,"GANGS"); PreloadAnimLib(playerid,"RIOT");
    PreloadAnimLib(playerid,"GYMNASIUM"); PreloadAnimLib(playerid,"CAR");
    PreloadAnimLib(playerid,"CAR_CHAT"); PreloadAnimLib(playerid,"GRAVEYARD");
    PreloadAnimLib(playerid,"POOL");
Add this anywhere in your script (outside of a callback/function):

pawn Код:
stock PreloadAnimLib(playerid, animlib[]) ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
These functions basically load the animation before you try to apply it IIRC.
Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)