SA-MP Forums Archive
Animationen in 0.3b - 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: Animationen in 0.3b (/showthread.php?tid=188334)



Animationen in 0.3b - Psycho77 - 07.11.2010

Hey

I have only 1 Animation.
but this only 1 dosent work.

If a player dies he will be seriously injured and do an animation.
But the player dies an he is only freezed.

Here My Animation:

Код:
ApplyAnimation(playerid,"CRACK","crckdeth2",3.0,1,1,1,1,0);



Re: Animationen in 0.3b - Johndaonee - 07.11.2010

Have you preloaded the anim when the player spawns?
pawn Код:
PreloadAnimLib(playerid,"CRACK");



Re: Animationen in 0.3b - Celson - 07.11.2010

Quote:
Originally Posted by Johndaonee
Посмотреть сообщение
Have you preloaded the anim when the player spawns?
pawn Код:
PreloadAnimLib(playerid,"CRACK");
I'm having trouble locating that function on the wiki. What does it actually do?


Re: Animationen in 0.3b - Psycho77 - 07.11.2010

Should i only write this funktion under OnPlayerSpawn?


Re: Animationen in 0.3b - Johndaonee - 07.11.2010

It preloads the anim for the player, if you have the problem where you have to type an animation command twice, then this fixes it.
And yes only put it once it loads all the anims in that category for him than.
Remember there are more categories than "CRACK"


Re: Animationen in 0.3b - Psycho77 - 07.11.2010

so i write it under OnPlayerSpawn.

i get this:

Код:
C:\Users\Simon Siggelkow\Desktop\Server 3b\gamemodes\RL.pwn(2281) : error 017: undefined symbol "PreloadAnimLib"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Animationen in 0.3b - Biesmen - 07.11.2010

Psycho77, please learn the basic before starting to code. I can see you didn't learn the basic at all. Do you even know how to code?

https://sampwiki.blast.hk/wiki/Scripting_Basics <- Learn that before doing anything.

undefined symbol "PreloadAnimLib".

Define it for sake! That's easy.

But I don't get why you should be using PreloadAnimLib as you have to make that function on your own..

Use
Код:
ClearAnimations(playerid);
at OnPlayerDisconnect and OnPlayerDeath.


Re: Animationen in 0.3b - Psycho77 - 07.11.2010

all this i have already! i never heard the function "PreloadAnimLib" before!
and i already have define it but in doesnґt work.


Re: Animationen in 0.3b - Biesmen - 07.11.2010

No, you don't have
pawn Код:
ClearAnimations(playerid);
or else it would work.
And no, there is no function like PreloadAnimLib.


Re: Animationen in 0.3b - Psycho77 - 07.11.2010

ahh i see you know my script.

here:

Код:
public OnPlayerSpawn(playerid)
{
    ClearAnimations(playerid);
    PreloadAnimLib(playerid,"CRACK");
    if(Spieler[playerid][Verletzt] == 1)
    {
        KillTimer(todtimer1[playerid]);
        KillTimer(todtimer2[playerid]);
        SetPlayerPos(playerid,Spieler[playerid][posx],Spieler[playerid][posy],Spieler[playerid][posz]);
        SetPlayerInterior(playerid, Spieler[playerid][interior]);
        SetPlayerVirtualWorld(playerid,Spieler[playerid][virtualw]);
        freeze(playerid);
        todtimer1[playerid] = SetTimerEx("tot1",180000,0,"i",playerid);
        Spieler[playerid][Spawn]--;
        ApplyAnimation(playerid,"CRACK","crckdeth2",3.0,1,1,1,1,0);
    }    
    if(Spieler[playerid][Tot] == 1)
    {
        KillTimer(todtimer1[playerid]);
        KillTimer(todtimer2[playerid]);
        SetPlayerPos(playerid,Spieler[playerid][posx],Spieler[playerid][posy],Spieler[playerid][posz]-120);
        SetPlayerInterior(playerid,Spieler[playerid][interior]);
	SetPlayerInterior(playerid,Spieler[playerid][interior]);
	SetPlayerVirtualWorld(playerid,Spieler[playerid][virtualw]);
	todtimer2[playerid] = SetTimerEx("tot2",60000,0,"i",playerid);
	Spieler[playerid][Verletzt] = 0;
	Spieler[playerid][Tot] = 1;
	SetPlayerCameraPos(playerid,Spieler[playerid][posx],Spieler[playerid][posy],Spieler[playerid][posz]+75);
	SetPlayerCameraLookAt(playerid,Spieler[playerid][posx],Spieler[playerid][posy],Spieler[playerid][posz]);
	Spieler[playerid][Spawn]--;
        freeze(playerid);
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	ClearAnimations(playerid);
        SendClientMessage(playerid,0xFF9190FF,"Du bist schwerverletzt, rufe mit /service einen Notarzt!");
	GetPlayerPos(playerid,Spieler[playerid][posx],Spieler[playerid][posy],Spieler[playerid][posz]);
	Spieler[playerid][interior] = GetPlayerInterior(playerid);
	Spieler[playerid][virtualw] = GetPlayerVirtualWorld(playerid);
        Spieler[playerid][Verletzt] = 1;
        return 1;
}

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