#include <a_samp>
new bonuscar,bonusplayer = INVALID_PLAYER_ID,bonustimer;
public OnFilterScrintInit()
{
bonuscar = CreateVehicle(560,0.0,0.0,3.0,0.0,1,1,60);
bonustimer = SetTimer(\"BonusPay\",60000,true);
return 1;
}
public OnFilterScrintExit()
{
KillTimer(bonustimer);
return 1;
}
forward BonusPay();
public BonusPay()
{
if(!IsPlayerConnected(bonusplayer)) { return 1; }
GivePlayerMoney(bonusplayer,1000);
return 1;
}
public OnPlayerDisconnect(playerid)
{
if(bonusplayer == playerid) { bonusplayer = INVALID_PLAYER_ID; }
return 1;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == bonuscar) { bonusplayer = playerid; }
else if(oldstate == PLAYER_STATE_DRIVER && bonusplayer == playerid) { bonusplayer = INVALID_PLAYER_ID; }
return 1;
}