Detect if player is running
#2

I have this on my gamemode:
Код:
stock IsPlayerRunning(playerid)
{
    if(!IsPlayerConnected(playerid) || IsPlayerInAnyVehicle(playerid)) return 0;
    new keys, updown, leftright;
    GetPlayerKeys(playerid, keys, updown, leftright);
    if(keys & KEY_SPRINT && GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_USEJETPACK) return 1;
    if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32], animname[32];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        if(!strcmp(animlib, "PED"))
        {
			new const names[8][] = { "run_fat", "run_fatold", "run_old", "swat_run", "woman_run", "WOMAN_runbusy", "woman_runpanic", "WOMAN_runsexy" };
			for(new i; i < sizeof(names); i++)
			{
			    if(!strcmp(animname, names[i])) return 1;
			}
        }
    }
    return 0;
}
Reply


Messages In This Thread
Detect if player is running - by Dodo9655 - 11.08.2013, 16:17
Re: Detect if player is running - by ExTaZZ69 - 16.09.2016, 12:00

Forum Jump:


Users browsing this thread: 1 Guest(s)