14.12.2012, 14:52
you used the same function twice. instead just use
pawn Код:
#include <a_samp>
#define FILTERSCRIPT
new vienasTickCount;
new wincashTimer;
new duTickCount;
new wincashTimer;
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(vehicleid) == 572) //MoonBeam
{
if(GetPlayerScore(playerid) < 5)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,0xAA3333AA,"* Reikia turлti 5 XP norint vairuoti рi transporta");
}
vienasTickCount = tickcount();
wincashTimer = SetTimerEx("wincash", 60000, true, "i", playerid);
}
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
KillTimer(wincashTimer);
if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(vehicleid) == 448) //MoonBeam
{
if(GetPlayerScore(playerid) < 60)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,0xAA3333AA,"* Reikia turлti 60 XP norint vairuoti рi transporta");
}
duTickCount = tickcount();
wincashTimer = SetTimerEx("wincash", 60000, true, "i", playerid);
}
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
KillTimer(wincashTimer);
return 1;
}
forward wincash(playerid);
public wincash(playerid)
{
if(( tickcount() - duTickCount ) > 60000 )
GivePlayerMoney( playerid, 12 );
return 1;
}