I need an idea and example for an training system [ REP + ]
#1

Hey guys,

i am working on my gamemode but how can i do this:

Player will write /training and it will set him animation for 1 minute, also an timer. After the 1 minute animation stops and the player receives +1 point to his training skills. Thanks guys!
Reply
#2

pawn Код:
new
    gPoints[ MAX_PLAYERS char ], // too keep track of the points
    gTraining[ MAX_PLAYERS char ] // set to true if the player is training
;

CMD:training( playerid, params[ ] )
{
    if( gTraining{ playerid } ) // if the player is already training
        return SendClientMessage( playerid, -1, "You're already training!" );

    gTraining{ playerid } = true; // setting it to true so the player is training
    // ApplyAnimation( your_animation_data ); // change this to your animation stuff
    SetTimerEx( "OnPlayerFinishTraining", 60000, false, "i", playerid ); // setting the timer
    return 1;
}

forward OnPlayerFinishTraining( playerid );
public OnPlayerFinishTraining( playerid )
{
    gPoints{ playerid }++; // increasing the points
    gTraining{ playerid } = false; // setting it back to false so the player can train again
    ClearAnimations( playerid ); // clear the animations
    SendClientMessage( playerid, -1, "You've finished you training and gained 1 point!" ); // sending le message
    return 1;
}
Reply
#3

Thank you brother, but there is an problem. I setted the animation also to 60000 but the animation ends like 3 seconds before the actual training. So the animation stops like 3 seconds before it ends so.. it is just loosing that profesionallity. If you know what i mean.

And there is one more problem.. when i use the command FOR THE FIRST time i join on server, the animation is just not playing.. i need to type the command 2 times to start the animation. Which is weird.

Thanks for help brother, anyways i REPPED you + but.. if someone help me with this, i will rep him also.
Reply
#4

post the animation code that you used.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)