Preloading animation libs only for ID 0
#10

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Are you resetting the variable?

Maybe this would help (Not sure), remove the if(!gPlayerLoadedAnimLibs[playerid]) and then just add this instead:
pawn Код:
for(new i = 0; i < 129; i++)
{
    ApplyAnimation(playerid, AnimLibraies[i], "null", 0.0, 0, 0, 0, 0, 0);
}
gPlayerLoadedAnimLibs[playerid] = true;
(Yes it is your code)

Players will never have them loaded when they connected, so no need to check, it might be bugging it.
Yeah, I'm resetting a player's data upon connection before executing the rest.
I'll try it out and I will edit this post with the result. Thank you in advance.

Quote:
Originally Posted by MicroD
Посмотреть сообщение
From Kalcor's gl_actions
Код:
new gPlayerAnimLibsPreloaded[MAX_PLAYERS];

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


public OnPlayerSpawn(playerid)
{
	if(!gPlayerAnimLibsPreloaded[playerid]) 
	{
   		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,"FOOD");
		gPlayerAnimLibsPreloaded[playerid] = 1;
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
        gPlayerAnimLibsPreloaded[playerid] = 0;
	return 1;
}
Thanks for the reply.
I don't want to place the preload code under OnPlayerSpawn since the classes in the class selection also perform animations.

EDIT: Stinged, it didn't work. Same problem.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)