[Help] CJ 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: [Help] CJ Run (
/showthread.php?tid=313166)
[Help] CJ Run -
BlackSA - 24.01.2012
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.
Re: [Help] CJ Run -
Konstantinos - 24.01.2012
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;
}
Re: [Help] CJ Run -
vassilis - 24.01.2012
Edit:the guy was faster sorry
Re: [Help] CJ Run -
BlackSA - 24.01.2012
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.
Re: [Help] CJ Run -
henry jiggy - 24.01.2012
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...
Re: [Help] CJ Run -
Konstantinos - 24.01.2012
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).