22.09.2014, 16:07
please help me in my server when we are robbing killing then our wanted level not decreasing how can i decrease the wanted level ? please
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
SetTimerEx("WantedLevel",60000*2,1,"d",playerid);
forward WantedLevel(playerid);
public WantedLevel(playerid)
{
if(GetPlayerWantedLevel(playerid) >= 5)
{
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
}
return 1;
}
// OnPlayerConnect:
ReduceTimer[playerid] = -1;
// OnPlayerUpdate:
if(GetPlayerWantedLevel(playerid) >= 1 && ReduceTimer[playerid] == -1)
{
ReduceTimer[playerid] = SetTimerEx("ReduceWantedLevel", 120000, false, "i", playerid);// And btw. 1 minute = 60000
ReduceTimer[playerid] = 0;
}
forward ReduceWantedLevel(playerid);
public ReduceWantedLevel(playerid)
{
if (GetPlayerWantedLevel(playerid) >= 1) SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) -1);
else
{
KillTimer(ReduceTimer[playerid]);
ReduceTimer[playerid] = -1;
}
}
forward WantedLevel(playerid);
public WantedLevel(playerid)
{
if(GetPlayerWantedLevel(playerid) != 0)
{
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
}
return 1;
}