OnPlayerKeyStateChange Help
#1

Hello I need help with this command
Код:
dcmd_jail(playerid, params[])
{
  //---------------------------------------|
  TestPrint("dcmd_jail(playerid, params[])");
  //---------------------------------------|
  if(IsPlayerConnected(playerid))
	{
	  if(strlen(params) > 11) return SendClientMessage(playerid, B_BILA, "[ ! ] Љpatnэ přнkaz!");
  	new zatykany = strval(params),string[250];
		if(Zamestnani[playerid] == T_POLICIE || Zamestnani[playerid] == T_SWAT)
		{
			if(!strlen(params)) SendClientMessage(playerid, B_BILA, "[ ! ] Pouћitн: /jail [ID]");
			else if(!IsPlayerConnected(zatykany)) SendClientMessage(playerid, B_BILA, "[ ! ] Hrбč nenн připojenej.");
			else if(Informace[zatykany][Vezeni] > 0) SendClientMessage(playerid, B_BILA, "[ ! ] Hrбč uћ je zatknutej.");
			else if(playerid == zatykany) SendClientMessage(playerid, B_BILA, "[ ! ] Nemůћeљ se sбm zatknout.");
			else if(GetPlayerWantedLevel(zatykany) == 0) SendClientMessage(playerid, B_BILA, "[ ! ] Hrбč nemб dostatečnou ъroveň hledanosti.");
			else if(DistanceBTWPlayers(playerid, zatykany) > 10) SendClientMessage(playerid, B_BILA, "[ ! ] Hrбč je přнliљ daleko.");
			else
			{
			format(string, 250, "[ ! ] Policista %s zatknul hrбče %s.", Jmeno(playerid),Jmeno(zatykany));
			SendClientMessage(playerid, B_BILA, "[ ! ] Zatknul si kriminбlnнka, dostбvбs +1 Policejni ZK a odměnu 5000$.");
			SendClientMessageToAll(GetPlayerColor(playerid), string);
			GivePlayerMoney(playerid, 5000);
			SetPlayerInterior(zatykany,3);
			SetPlayerPos(zatykany,198.3797,160.8905,1003.0300);
			SetPlayerColor(zatykany, 0xFFFFFF00);
			Informace[playerid][PolicejniZK]++;
			ResetPlayerWeapons(zatykany);
			if(GetPlayerWantedLevel(zatykany) > 5) Informace[zatykany][Vezeni] = 220;
			else Informace[zatykany][Vezeni] = GetPlayerWantedLevel(zatykany) * 30;
			}
		}
	}
  return 1;
}
To ''give'' to OnPlayerKeyStateChange
So when Player press some button on Keyboard it will jail the nearest player(With WL)
Reply
#2

We need more information. What button?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)