29.03.2011, 10:15
i wanna make a score and money giver you get money and score if you are in the aircrafts like shamal
#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 ] );
}