Animations by ID
#2

Example:
PHP код:
#include a_samp
#include zcmd
new gPlayerUsingLoopingAnim[MAX_PLAYERS];
new 
Text:txtAnimHelper;
CMD:wank(playeridparams[])
{
    new 
player1;
    if(!
IsNumeric(params)) player1 ReturnPlayerID(params);
    else 
player1 strval(params);
    if(
isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /wank [playerid]");
    
PlayAnimEx(player1"PAULNMAC""wank_loop"4.0100001);
    return 
1;
}
PlayAnimEx(playeridanimlib[], animname[], Float:fDeltalooplockxlockyfreezetimeforcesync)
{
    
gPlayerUsingLoopingAnim[playerid] = 1;
    
ApplyAnimation(playeridanimlibanimnamefDeltalooplockxlockyfreezetimeforcesync);
    
TextDrawShowForPlayer(playerid,txtAnimHelper);
}
stock IsNumeric(string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;
}
stock ReturnPlayerID(PlayerName[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
strfind(pName(i),PlayerName,true)!=-1) return i;
        }
    }
    return 
INVALID_PLAYER_ID;
}
stock pName(playerid)
{
  new 
plname[MAX_PLAYER_NAME];
  
GetPlayerName(playeridplnamesizeof(plname));
  return 
plname;

if you mean /playanimation animationid
PHP код:
#include a_samp
#include zcmd
CMD:playanimation(playeridparams[])
{
    new 
animation strval(params);
    if(
isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /playanimation [animationid]");
       
SetPlayerSpecialAction(playeridanimation);
    return 
1;
}
stock IsNumeric(string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;
}
stock ReturnPlayerID(PlayerName[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
strfind(pName(i),PlayerName,true)!=-1) return i;
        }
    }
    return 
INVALID_PLAYER_ID;
}
stock pName(playerid)
{
  new 
plname[MAX_PLAYER_NAME];
  
GetPlayerName(playeridplnamesizeof(plname));
  return 
plname;

if you wana play animation for other player:
PHP код:
#include a_samp
#include zcmd
CMD:playpanimation(playeridparams[])
{
    new 
player1;
    if(!
IsNumeric(params)) player1 ReturnPlayerID(params);
    else 
player1 strval(params);
    new 
animation strval(params);
    if(
isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /playpanimation [playerid] [animationid]");
       
SetPlayerSpecialAction(player1animation);
    return 
1;
}
stock IsNumeric(string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;
}
stock ReturnPlayerID(PlayerName[])
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
strfind(pName(i),PlayerName,true)!=-1) return i;
        }
    }
    return 
INVALID_PLAYER_ID;
}
stock pName(playerid)
{
  new 
plname[MAX_PLAYER_NAME];
  
GetPlayerName(playeridplnamesizeof(plname));
  return 
plname;

Reply


Messages In This Thread
Animations by ID - by martoivanov - 16.08.2015, 11:31
Re: Animations by ID - by jlalt - 16.08.2015, 11:39
Re: Animations by ID - by iTakelot - 16.08.2015, 11:50

Forum Jump:


Users browsing this thread: 1 Guest(s)