20.10.2013, 02:45
(
Последний раз редактировалось bzwski; 20.10.2013 в 11:05.
)
Hi guys, I'm trying to make the player remain with the animation while he types e.g. being sit. However, it stands up and does the chat animation.
Sit animation:
Chat:
Sit animation:
Код:
COMMAND:sit(playerid, params[]) { new style; if(PlayerStat[playerid][Tased] == 1 || PlayerStat[playerid][Cuffed] == 1) { SendClientMessage(playerid, GREY, "No puedes usar esta animaciуn ahora."); } if(sscanf(params,"d", style))return SendClientMessage(playerid, GREY, "USO: /sit [style 1-2]"); switch(style) { case 1: ApplyLoopingAnimation(playerid, "PED", "SEAT_idle", 4.0, 1, 0, 0, 0, 0); case 2: ApplyLoopingAnimation(playerid, "BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); } return 1; }
Код:
public OnPlayerText(playerid, text[]) { IRC_GroupSayEx(gGroupID, IRC_AECHO_CHANNEL, "7[chat] 3%s (%d): %s", pNick(playerid), playerid, text); new str[128]; if(PlayerStat[playerid][Logged] == 0) { SendClientMessage(playerid, GREY, "Tienes que estar logeado."); return 0; } if(Server[CurrentGMX] >= 1) { SendClientMessage(playerid, GREY, "Espera a que el servidor se haya reinciado por completo."); return 0; } if(PlayerStat[playerid][FullyRegistered] == 0) { SendClientMessage(playerid, GREY, "Tienes que aсadir informaciуn de tu personaje."); return 0; } if(PlayerStat[playerid][Spawned] == 0) { SendClientMessage(playerid, GREY, "Tienes que estar dentro del servidor para hablar."); return 0; } if(PlayerStat[playerid][Muted] == 1) { format(str, sizeof(str), "No puedes hablar, estбs muteado, tienes que esperar %d segundos.", PlayerStat[playerid][MuteTime]); SendClientMessage(playerid, GREY, str); return 0; } else { format(str, sizeof(str), "%s dice: %s", GetICName(playerid), text); SendNearByMessage(playerid, WHITE, str, 5); ICLog(str); new Length = strlen(text); new TalkTime = Length*100; ApplyAnimation(playerid,"PED","IDLE_chat", 4.1, 0, 0, 0, 1, 1); KillTimer(Server[StopTalkingAnimation]); Server[StopTalkingAnimation] = SetTimerEx("StopTalkingAnim", TalkTime, 0, "d", playerid); } return 0; }