Jump to content

Recommended Posts

Posted (edited)

As dori va rog un tutorial unde pot sa folosesc in ZCMD comanda CMD:ajail    ,  avand timer, iar la finalul timerului sa respawneze jucatorul fara setarea HP-ului pe 0.    Pe tot parcursul adminjail, sa-i indice pe mijlocul ecranului cu galben, mare, (gen /cnn)  timpul ramas in secunde / minute .   Jucatorul sa fie trimis pe virtualworld-uri random (de la 2 pana la infinit) si sa fie in inchisoarea sectiei de politie.

Si sa pot seta /ajail pe 0 minute, si sa-l scoata din jail.

 

As avea nevoie de :  ID jucator, ID admin, Timp,  motiv. 

 

Multumesc

Edited by Alexandr69
Posted (edited)
CMD:ajail(playerid, params[])
{
  new targetid, time, reason[64], randomnr;
  if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: Nu ai nivelul de administrator necesar!");
  if(sscanf(params, "uis[64]", targetid, time, reason)) return SendClientMessage(playerid, -1, "USAGE: /ajail <playerid> <time> <reason>");
  if(time == 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Minimul de timp este 1!");
  randomnr = rand(2, 100);
  SetPlayerPos(targetid, AjailX, AjailY, AjailZ);
  SetPlayerVirtualWorld(targetid, randomnr);
  SetPlayerInterior(targetid,AjailInterior);
  pInfo[targetid][pJailTime] = time;
  new string[128], adminname[64], targetname[64];
  format(string, sizeof(string), "Administrator %s ajailed %s, reason: %s", GetPlayerName(playerid, adminname, sizeof(adminname)), GetPlayerName(playerid, targetname, sizeof(targetname)), reason);
  SendClientMessageToAll(COLOR_RED, string);
  AjailCount(targetid);
  return 1;
}
     
CMD:unajail(playerid, params[])
{
  if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: Nu ai nivelul de administrator necesar!");
  if(sscanf(params, "u", targetid) return SendClientMessage(playerid, -1, "USAGE: /unajail <playerid>");
  if(pInfo[targetid][pJailTime] == 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Jucatorul nu este in jail momentan!");  
  new randSpawn = random(sizeof(randomSpawns_DayZSA_Part1));
  SetPlayerPos_Allow(playerid,randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2]);
  pInfo[playerid][pJailTime] = 0;
  return 1;
}

public AjailCount(playerid)
{
	if(pInfo[playerid][pJailTime] == 1)
	{
		new randSpawn = random(sizeof(randomSpawns_DayZSA_Part1));
      	SetPlayerPos_Allow(playerid,randomSpawns_DayZSA_Part1[randSpawn][0],randomSpawns_DayZSA_Part1[randSpawn][1],randomSpawns_DayZSA_Part1[randSpawn][2]);
		pInfo[playerid][pJailTime] = 0;
	}
	else if(pInfo[playerid][pJailTime] => 2) 
	{
		
		SetTimerEx(AjailCount(playerid),60000,false,"u",playerid);
		pInfo[playerid][pJailTime] -= 1;
	}
	return 1;
}

 

Edited by ImpulsE
  • Upvote 1

Gh38gEQ.gif

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.