disable chat help!
#1

Can someone can put here for me code for disable chat i wanna when player get jailed to disable player chat! here is code for jail system, i just put freeze but when he in jail he still can use tele commands for go out from jail! Please help me

Код:
dcmd_jail(playerid, params[])
{
  if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
	{
	  new tmp[256], tmp2[256], Index;
		tmp = strtok(params,Index), tmp2 = strtok(params,Index);

		if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /jail [ID] [razlog]");

		new kohde;
		kohde = strval(tmp);

		if(!strlen(tmp2)) return SendClientMessage(playerid, red, "Napisi: /jail [ID] [razlog]");

		if(IsPlayerNPC(kohde)) return SendClientMessage(playerid, COLOR_RED, "Nemozes botove zatvarati!");

		if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");


    TogglePlayerControllable(kohde, 0);
		new string[128];
		format(string, sizeof(string), "Admin je zatvorio %s u zatvor (Razlog: %s)", PlayerName(kohde), params[2]);
	  SendClientMessageToAll(COLOR_RED, string);

		PlayerInfo[kohde][Jailed] = 1;
		
		PlayerPlaySound(kohde,1057,0.0,0.0,0.0);

		new string2[128];
		format(string2, sizeof(string2), "Zatvoren si! Razlog: %s", params[2]);
		GameTextForPlayer(playerid, string2, 10000, 6);
		SetPlayerPos(playerid, 1300.9757,1237.7192,19.3438);
		SendClientMessage(playerid, COLOR_GREEN, "Zatvoren si i zamrznut na neko vrijeme od admina, zbog krsenja /pravila !");

		new FilePath[128];
		format(FilePath, sizeof(FilePath), "JAdminScript/Users/%s.ini", PlayerName(playerid));

		dini_IntSet(FilePath,"Jailed",1);
		return 1;
	}
	return 1;
}

dcmd_unjail(playerid, params[])
{
	if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
	{
	  new tmp[256], tmp2[256], Index;
		tmp = strtok(params,Index), tmp2 = strtok(params,Index);

		if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Napisi: /unjail [ID]");

		new kohde;
		kohde = strval(tmp);

		if(PlayerInfo[kohde][Jailed] == 0) return SendClientMessage(playerid, COLOR_RED, "Igrac nije u zatvoru!");

		if(!IsPlayerConnected(kohde)) return SendClientMessage(playerid, COLOR_RED, "Netocan ID");

    TogglePlayerControllable(kohde, 1);
		new string[128];
		format(string, sizeof(string), "Pusten si %s iz zatvora i odmrznut sljedeci put nemoj krsiti /pravila !", PlayerName(kohde));
	  SendClientMessageToAll(COLOR_RED, string);

		PlayerInfo[kohde][Jailed] = 0;
		
		PlayerPlaySound(kohde,1057,0.0,0.0,0.0);

		new FilePath[128];
		format(FilePath, sizeof(FilePath), "JAdminScript/Users/%s.ini", PlayerName(playerid));

		dini_IntSet(FilePath,"Jailed",0);
		
		SetPlayerInterior(playerid,0);
 		SetPlayerPos(playerid, 1318.4937,1266.2261,10.8203);

		return 1;
	}
	return 1;
}
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
  if(PlayerInfo[playerid][Jailed] == 1) return 0;
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)