SA-MP Forums Archive
walk and run - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: walk and run (/showthread.php?tid=473450)



walk and run - kbalor - 02.11.2013

Is it possible to make a command with run and walk?

So when I use /walk it will walk like you are pressing alt and if I use /walk again it will do normal run.


Re: walk and run - SAMProductions - 03.11.2013

Try This One,

New Variable,
Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
Enum,
Код:
enum pInfo
{
    bool:WalkingStyle
};
OnPlayerConnect Callback:
pawn Код:
public OnPlayerConnect(playerid)
{
        PlayerInfo[playerid][WalkingStyle] = false;
}
OnPlayerDisconnect Callback:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
        PlayerInfo[playerid][WalkingStyle] = false;
}
Command's Code,
pawn Код:
CMD:walk(playerid, params[])
{
    new string[300];
    if(PlayerInfo[playerid][WalkingStyle] == false)
    {
        ApplyAnimation(playerid,"PED","WALK_civi",4.1,1,1,1,1,1);
        format(string, sizeof(string), "{FF0000}<!> {EEEEEE}You've Enabled Walking Style.");
        SendClientMessage(playerid, -1, string);
        PlayerInfo[playerid][WalkingStyle] = true;
    }
    else if(PlayerInfo[playerid][WalkingStyle] == true)
    {
        ClearAnimations(playerid);
        ApplyAnimation(playerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
        format(string, sizeof(string), "{FF0000}<!> {EEEEEE}You've Disabled Walking Style.");
        SendClientMessage(playerid, -1, string);
        PlayerInfo[playerid][WalkingStyle] = false;
    }
    return 1;
}



Re: walk and run - kbalor - 03.11.2013

Now my pawno stop from reponsind (Not Responding) Ihave waiting for almost 5 minutes