12.10.2015, 16:48
I am making teargas system for a tdm server, it works but i got a problem with the choking animation.
When an enemy teargases someone, the player who got teargas'ed can see the animation but not others.
Here's the code for the teargas system
I tried loading the animlib like this
But it's still not working, what am i doing wrong here?
When an enemy teargases someone, the player who got teargas'ed can see the animation but not others.
Here's the code for the teargas system
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(pressed(KEY_FIRE))
{
if(GetPlayerWeapon(playerid) == 17)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(i, 7.0, x, y, z))
{
if(i == playerid) continue;
if(GetPVarInt(i, "mask") == 0)
{
if(pInfo[i][pTeam] == pInfo[playerid][pTeam]) continue;
ApplyAnimation(i, "ped", "gas_cwr", 4.1, 0, 0, 0, 0, 5000, 0);
}
}
}
}
}
}
return 1;
}
PHP код:
PreloadAnimLib(playerid, animlib[])
{
ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
public OnPlayerSpawn(playerid)
{
PreloadAnimLib(playerid, "ped");
return 1;
}