SA-MP Forums Archive
force animations - 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: force animations (/showthread.php?tid=424149)



force animations - Chrillzen - 20.03.2013

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;



Re: force animations - Scenario - 20.03.2013

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.


Re: force animations - Chrillzen - 20.03.2013

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.