[Help] CJ Run
#1

Hello guys,

I want to make something that some pepole will be able to run with CJ run and the other not,
I mean who will get the permission will be able to done it.
How do I'm doing it?

Thanks advance.
Reply
#2

Untested.
pawn Код:
#include < a_samp >
#include < zcmd >
#include < sscanf2 >
#include < foreach >

new
    CJ_RUN[ MAX_PLAYERS ];

main( )
{ }

public OnGameModeInit( )
{
    foreach(Player, i )
    {
        if( CJ_RUN[ i ] == 1 )
        {
            UsePlayerPedAnims( );
        }
    }
    return 1;
}

CMD:run( playerid, params[ ] )
{
    new
        id;

    if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You are not Admin!" );
    CJ_RUN[ id ] = 1;
    return 1;
}
CMD:disablerun( playerid, params[ ] )
{
    new
        id;

    if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You are not Admin!" );
    CJ_RUN[ id ] = 0;
    return 1;
}
Reply
#3

Edit:the guy was faster sorry
Reply
#4

It's not working, as I guess.
I don't know how to place animation for the player that he will be able to run like CJ,
I've tried to do it with ApplyAnimation, it was unsuccessfull.
Reply
#5

EnablePlayerPedAnims() is used to enable it for all of them(i u dont use it it will remain disabled). never heard of any function that adds it only to 1 player...
Reply
#6

Quote:
Originally Posted by BlackSA
Посмотреть сообщение
It's not working, as I guess.
I don't know how to place animation for the player that he will be able to run like CJ,
I've tried to do it with ApplyAnimation, it was unsuccessfull.
There isn't animation for applying CJ's running/walking.
Of course, it was unsuccessfull because it's never used like that.
Are you sure, did you had the commands too and enable it for you by /run id.
Also, forgot to add the sscanf
pawn Код:
// Replace the commands To:
CMD:run( playerid, params[ ] )
{
    new
        id;

    if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You are not Admin!" );
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /run <ID/Part Of Name>" );
    CJ_RUN[ id ] = 1;
    return 1;
}
CMD:disablerun( playerid, params[ ] )
{
    new
        id;

    if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "You are not Admin!" );
    if( sscanf( params, "r", id ) ) return SendClientMessage( playerid, -1, "Usage: /run <ID/Part Of Name>" );
    CJ_RUN[ id ] = 0;
    return 1;
}
Quote:
Originally Posted by henry jiggy
Посмотреть сообщение
EnablePlayerPedAnims() is used to enable it for all of them(i u dont use it it will remain disabled). never heard of any function that adds it only to 1 player...
There is function that placed only OnGameModeInit( ) Callback
pawn Код:
public OnGameModeInit( )
{
    UsePlayerPedAnims( );
    return 1;
}
Uses standard player walking animation (animation of CJ).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)