Question and help ,i give rep + 1 thanks.
#6

Quote:
Originally Posted by HY
Посмотреть сообщение
Setting a Timer, first:

pawn Код:
SetTimer("WantedLevel", 100000, false);
- I setted it at 100 seconds, change it, with your time wich you want to decrease level !

- Then we need to make a new public, from WantedLevel Timer;

pawn Код:
forward WantedLevel();

public WantedLevel()
{
    new playerid;
    SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
}
1. WTF !!! you define new variable "playerid" ! and set his wanted ? and i ask you... who is playerid ?!!!
you have to make a loop between players !!!!!
2.and pay attention that if someone has 0 wanted and you use : SetPlayerWantedLevel(playerid,GetPlayerWantedLevel (playerid)-1);
it will be set his wanted to 255 !

and help

you can use PVars and GetTickCount!

To give you an example (using zcmd and foreach, you can use other command processors and other loops):

pawn Код:
SetTimer("Wanted",1800000,1);

forward Wanted();
public Wanted()
{
 foreach(Player, i)
 {
  SetPVarInt(i, "WantedTime", GetTickCount());
  if(GetPlayerWantedLevel(i) > 1) SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)-1);
 }
  return 1;
}

CMD:wantedtime(playerid, params[])
{
 new string[260];
 new t = GetTickCount() - GetPVarInt(playerid, "WantedTime");
 format(string,sizeof(string),"You have to wait %d seconds to loose another wanted star.",t/1000);
 SendClientMessage(playerid,-1,string);
 return 1;
}
i writed it to fast so don't copy and paste it ! if you got errors tell me !
Good Luck.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)