-
Прогрузка анимации.
Здравствуйте пользователи портала Pro-Pawn.
Думаю все сталкивались с такой проблемой, когда вводишь какую-либо команду, например: /s (Кричать), текст выходит, а анимация с первого раза не показалась.
При помощи этого кода, мы исправляем эту проблему, то есть теперь любая анимация которая есть в Samp будет действовать с первого ввода команды или чего либо.
В OnPlayerSpawn
PHP код:
if(!GetPVarInt(playerid, "Animations")) PreloadAnimLib(playerid);
Конец мода
PHP код:
stock PreloadAnimLib(playerid)
{
ApplyAnimation(playerid,"BOMBER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"RAPPING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SHOP","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"BEACH","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SMOKING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ON_LOOKERS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"DEALER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRACK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"COP_AMBIENT","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PARK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"INT_HOUSE","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRIB","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ROB_BANK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"JST_BUISNESS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PED","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"OTB","null",0.0,0,0,0,0,0);
SetPVarInt(playerid, "Animations", 1);
}
Ну вот и всё, мы успешно сделали прогрузку анимаций.
Доработчик: DeimoS
-
-
Цитата:
Сообщение от
Mike
Молодец!
Благодарю.
-
-
PHP код:
#define PreloadAnimLib(%1, %2) ApplyAnimation(%1, %2, "null",0.0,0,0,0,0,0)
Не?
-
OnPlayerSpawn
PHP код:
if(!GetPVarInt(playerid, "Animations")) PreloadAnimLib(playerid);
Конец мода
PHP код:
stock PreloadAnimLib(playerid)
{
ApplyAnimation(playerid,"BOMBER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"RAPPING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SHOP","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"BEACH","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SMOKING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ON_LOOKERS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"DEALER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRACK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"COP_AMBIENT","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PARK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"INT_HOUSE","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRIB","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ROB_BANK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"JST_BUISNESS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PED","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"OTB","null",0.0,0,0,0,0,0);
SetPVarInt(playerid, "Animations", 1);
}
Не?
-
Цитата:
Сообщение от
DeimoS
OnPlayerSpawn
PHP код:
if(!GetPVarInt(playerid, "Animations")) PreloadAnimLib(playerid);
Конец мода
PHP код:
stock PreloadAnimLib(playerid)
{
ApplyAnimation(playerid,"BOMBER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"RAPPING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SHOP","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"BEACH","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SMOKING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ON_LOOKERS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"DEALER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRACK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"COP_AMBIENT","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PARK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"INT_HOUSE","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRIB","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ROB_BANK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"JST_BUISNESS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PED","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"OTB","null",0.0,0,0,0,0,0);
SetPVarInt(playerid, "Animations", 1);
}
Не?
PHP код:
public OnPlayerSpawn(playerid){
ApplyAnimation(playerid,"BOMBER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"RAPPING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SHOP","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"BEACH","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SMOKING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ON_LOOKERS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"DEALER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRACK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"COP_AMBIENT","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PARK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"INT_HOUSE","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRIB","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ROB_BANK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"JST_BUISNESS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PED","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"OTB","null",0.0,0,0,0,0,0);
return true;
}
не?
-
Цитата:
Сообщение от
Seregamil
PHP код:
public OnPlayerSpawn(playerid){
ApplyAnimation(playerid,"BOMBER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"RAPPING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SHOP","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"BEACH","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SMOKING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ON_LOOKERS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"DEALER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRACK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"COP_AMBIENT","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PARK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"INT_HOUSE","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRIB","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ROB_BANK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"JST_BUISNESS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PED","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"OTB","null",0.0,0,0,0,0,0);
return true;
}
не?
Я предпочитаю хранить подобный код в стоках, а стоки в инклюдах, дабы в pwn был лишь "активный" код (тот, который в будущем может быть отредактирован. А тут уже нечего редактировать).
-
Цитата:
Сообщение от
Seregamil
PHP код:
public OnPlayerSpawn(playerid){
ApplyAnimation(playerid,"BOMBER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"RAPPING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SHOP","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"BEACH","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"SMOKING","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ON_LOOKERS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"DEALER","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRACK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"COP_AMBIENT","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PARK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"INT_HOUSE","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"CRIB","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"ROB_BANK","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"JST_BUISNESS","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"PED","null",0.0,0,0,0,0,0);
ApplyAnimation(playerid,"OTB","null",0.0,0,0,0,0,0);
return true;
}
не?
Будет срабатывать при каждом спавне, а анимки не прогружаются вроде только после коннекта, возможно ошибаюсь :)
-