help please
#6

Note you will need a function to check if the player is in an airplane for this to work. You will need to do something like this,
pawn Код:
#include <a_samp>

AirPay( playerid );

new airTimers[ MAX_PLAYERS ];

public OnPlayerDisconnect(playerid, reason)
{
    KillTimer( airTimers[ playerid ] );//kill timer when they disconnect
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if( IsAirPlane ( vehicleid ))//you will need to find/create this function.
        airTimers[ playerid ] = SetTimerEx( "AirPay", 60*1000, true, "i", playerid );//timer to give score/money

    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(IsInAirPlane( playerid ))//you will need to find/create this function too.
        KillTimer( airTimers[ playerid ] );//kill the timer when they leave
       
    return 1;
}

public AirPay( playerid )
{
    if(IsInAirPlane( playerid ))
    {
        GivePlayerMoney( playerid, 1000);
        SetPlayerScore( playerid, GetPlayerScore( playerid ) +1 );
    }
    else
        KillTimer( airTimers[ playerid ] );
}
Reply


Messages In This Thread
help please - by jejemonerz123 - 29.03.2011, 10:15
Re: help please - by Medal Of Honor team - 29.03.2011, 10:22
Re: help please - by Gamer_Z - 29.03.2011, 10:23
Re: help please - by jejemonerz123 - 29.03.2011, 12:24
Re: help please - by jejemonerz123 - 29.03.2011, 12:26
Re: help please - by iggy1 - 29.03.2011, 12:38

Forum Jump:


Users browsing this thread: 5 Guest(s)