Jump to content

Cerere tutorial AdminJail


Alexandr69

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.