Jump to content

[Sistema] Concurs pentru jucatori


khain.dev

Recommended Posts

 

Buna,astazi vreau sa va prezint un sistem care prevedorganizarea unor concursuri de catre admistratori, vorbind de cod,este foarte optimizat si ca sa va fie mai convinabil,pentru cei ce doresc ca filterscript,va las mai jos fisierul.

// scurtari
#define 	SPD 			ShowPlayerDialog
#define 	SCM 			SendClientMessage
#define 	SCMTA 			SendClientMessageToAll
  
//culori
#define 	COLOR_RED 		(0xFF6347AA)
#define 	COLOR_YELLOW 	(0xFFFF00FF)

  
//variabile
new mp_status, // statusul daca concursul este deschis/inchis
	Float:mp_x, // coordonate unde se petrece concursul
 	Float:mp_y, // coordonate unde se petrece concursul
 	Float:mp_z, // coordonate unde se petrece concursul
    mp_virt, // lumea virtuala
	mp_int; // interior 
//////////////////////////////////
public OnPlayerConnect(playerid) {
	pInfo[playerid][pMP] = 0; // verificam daca jucatorul este la concurs
	return 1;
}

public OnPlayerDisconnect(playerid, reason) {
	pInfo[playerid][pMP] = 0; // verificam daca jucatorul este la concurs
	return 1;
}

public OnPlayerSpawn(playerid) {
	pInfo[playerid][pMP] = 0; // verificam daca jucatorul este la concurs
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason) {
	pInfo[playerid][pMP] = 0; // verificam daca jucatorul este la concurs
	return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
		case 10000:
		{
			if(!response) return 1;
			else if((1 <= listitem <= 6) && !mp_status) return SCM(playerid, COLOR_RED, !"Concursul nu a fost creat!");
			switch(listitem)
			{
				case 0:
				{
					if(mp_status) SCMTA(COLOR_RED, !"Teleportul la concurs este inchis!");
					else
					{
						SCMTA(COLOR_YELLOW, !"Este deschit teleportul la concurs!");
						SCMTA(COLOR_YELLOW, !"Scrie /concurs pentru a participa la concurs!");
						new Float:X, Float:Y, Float:Z;
						GetPlayerPos(playerid, X, Y, Z);
						mp_x = X;
						mp_y = Y;
						mp_z = Z;
						mp_virt = GetPlayerVirtualWorld(playerid);
						mp_int = GetPlayerInterior(playerid);
					}
					mp_status = !mp_status;
				}
				case 1: SPD(playerid, 10001, DIALOG_STYLE_INPUT, !"{696969}-{FFFAFA} Sanatate", !"Alege distanta, pentru a da viata jucatorilor.\n\nExemplu: \"10,100\"", !"DA", !"NU");
				case 2: SPD(playerid, 10002, DIALOG_STYLE_INPUT, !"{696969}-{FFFAFA} Arma", !"Alege distanta, pentru a da arma jucatorilor\n{696969}-{FFFAFA} Distanta (metri)\n{696969}-{FFFAFA} ID arma\n{696969}-{FFFAFA} Patroane\n.\n\nExemplu: \"10,24,500\"", !"DA", !"NU");
				case 3: SPD(playerid, 10003, DIALOG_STYLE_INPUT, !"{696969}-{FFFAFA} Armour", !"Alege distanta, pentru a da armour jucatorilor:", !"DA", !"NU");
				case 4: SPD(playerid, 10004, DIALOG_STYLE_INPUT, !"{696969}-{FFFAFA} Elimina armour", !"Alege distanta, pentru a lua armourul jucatorilor:", !"DA", !"NU");
				case 5: SPD(playerid, 10005, DIALOG_STYLE_INPUT, !"{696969}-{FFFAFA} Elimina arma", !"Alege distanta, pentru a lua arma jucatorilor:", !"DA", !"NU");
				case 6: SPD(playerid, 10006, DIALOG_STYLE_INPUT, !"{696969}-{FFFAFA} Spawnare", !"Alege distanta, pentru a spawna jucatorii:", !"DA", !"NU");
			}
		}
		case 10001:
		{
			if(!response) return cmd_cpanel(playerid);
			new radius, hp;
			if(sscanf(inputtext, !"p<,>ii", radius, hp)) return SPD(playerid, 10001, DIALOG_STYLE_INPUT, !"{696969}Viata", !"Alege distanta, pentru a da viata jucatorilor\n\nExemplu: \"10,100\"", !"Далее", !"Отмена");
			else if(!(0 <= hp <= 100)) return SPD(playerid, 10001, DIALOG_STYLE_INPUT, !"{696969}Viata", !"Alege distanta, pentru a da viata jucatorilor\n\nExemplu: \"10,100\"", !"DA", !"NU");
			new Float:X, Float:Y, Float:Z;
			GetPlayerPos(playerid, X, Y, Z);
			foreach(new i: Player)
			{
				if(i != playerid && pInfo[i][pMP] && IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
				{
					SCM(i, COLOR_YELLOW, !"{696969}-{FFFAFA} Organizatorul concursului a dat viata jucatorilor de la concurs");
					SetPlayerHealth(i, hp);
				}
			}
			SCM(playerid, COLOR_YELLOW, !"{696969}-{FFFAFA} Ai dat viata jucatorilor de la concurs");
		}
		case 10002:
		{
			if(!response) return cmd_cpanel(playerid);
			new radius, id, ammo;
			if(sscanf(inputtext, !"p<,>iii", radius, id, ammo)) return SPD(playerid, 10002, DIALOG_STYLE_INPUT, !"{696969}Arma", !"Alege distanta, pentru a da arma jucatorilor\n{696969}-{FFFAFA} Distanta (metri)\n{696969}-{FFFAFA} ID arma\n{696969}-{FFFAFA} Patroane\n.\n\nExemplu: \"10,24,500\"", !"DA", !"NU");
			else if(!(1 <= id <= 47)) return SPD(playerid, 10002, DIALOG_STYLE_INPUT, !"{696969}Arma", !"Alege distanta, pentru a da arma jucatorilor\n{696969}-{FFFAFA} Distanta (metri)\n{696969}-{FFFAFA} ID arma\n{696969}-{FFFAFA} Patroane\n.\n\nExemplu: \"10,24,500\"", !"DA", !"NU");
			new Float:X, Float:Y, Float:Z;
			GetPlayerPos(playerid, X, Y, Z);
			foreach(new i: Player)
			{
				if(i != playerid && pInfo[i][pMP] && IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
				{
					SCM(i, COLOR_YELLOW, !"{696969}-{FFFAFA} Organizatorul a dat arma jucatorilor de la concurs");
					GivePlayerWeapon(i, id, ammo);
				}
			}
			SCM(playerid, COLOR_YELLOW, !"{696969}-{FFFAFA} Ai dat arma jucatorilor de la concurs");
		}
		case 10003:
		{
			if(!response) return cmd_cpanel(playerid);
			new radius;
			if(sscanf(inputtext, !"i", radius)) return SPD(playerid, 10003, DIALOG_STYLE_INPUT, !"{696969}Armour", !"Alege distanta, pentru a da jucatorilor armour:", !"DA", !"NU");
			new Float:X, Float:Y, Float:Z;
			GetPlayerPos(playerid, X, Y, Z);
			foreach(new i: Player)
			{
				if(i != playerid && pInfo[i][pMP] && IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
				{
					SCM(i, COLOR_YELLOW, !"{696969}-{FFFAFA} Organizatorul concursului a dat armour jucatorilor la concurs");
					SetPlayerArmour(i, 100);
				}
			}
			SCM(playerid, COLOR_YELLOW, !"{696969}-{FFFAFA} Ai dat armour jucatorilor la concurs");
		}
		case 10004:
		{
			if(!response) return cmd_cpanel(playerid);
			new radius;
			if(sscanf(inputtext, !"i", radius)) return SPD(playerid, 10004, DIALOG_STYLE_INPUT, !"{696969}Armour", !"Alege distanta, pentru a confisca armourul:", !"DA", !"NU");
			new Float:X, Float:Y, Float:Z;
			GetPlayerPos(playerid, X, Y, Z);
			foreach(new i: Player)
			{
				if(i != playerid && pInfo[i][pMP] && IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
				{
					SCM(i, COLOR_YELLOW, !"{696969}-{FFFAFA} Organizatorul concursului a confiscat armourul tau");
					SetPlayerArmour(i, 0);
				}
			}
			SCM(playerid, COLOR_YELLOW, !"{696969}-{FFFAFA} Ai confiscat armourul la toti jucatorii");
		}
		case 10005:
		{
			if(!response) return cmd_cpanel(playerid);
			new radius;
			if(sscanf(inputtext, !"i", radius)) return SPD(playerid, 10005, DIALOG_STYLE_INPUT, !"{696969}Arma", !"Alege distanta, pentru a confisca arma:", !"DA", !"NU");
			new Float:X, Float:Y, Float:Z;
			GetPlayerPos(playerid, X, Y, Z);
			foreach(new i: Player)
			{
				if(i != playerid && pInfo[i][pMP] && IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
				{
					SCM(i, COLOR_YELLOW, !"{696969}-{FFFAFA} Organizatorul concursului a confiscat arma jucatorilor");
					ResetPlayerWeapons(i);
				}
			}
			SCM(playerid, COLOR_YELLOW, !"{696969}-{FFFAFA} Ai confiscat arma jucatorilor");
		}
		case 10006:
		{
			if(!response) return cmd_cpanel(playerid);
			new radius;
			if(sscanf(inputtext, !"i", radius)) return SPD(playerid, 10006, DIALOG_STYLE_INPUT, !"{696969}Spawnare", !"Alege distanta, unde jucatorii vor fi spawnnati:", !"DA", !"NU");
			new Float:X, Float:Y, Float:Z;
			GetPlayerPos(playerid, X, Y, Z);
			foreach(new i: Player)
			{
				if(i != playerid && pInfo[i][pMP] && IsPlayerInRangeOfPoint(i, radius, X, Y, Z))
				{
					SCM(i, COLOR_YELLOW, !"{696969}[-]{FFFAFA} Organizatorul concursului a spawnat toti jucatorii");
					SpawnPlayer(i);
				}
			}
			SCM(playerid, COLOR_YELLOW, !"{696969}[-]{FFFAFA} Ai spawnat jucatorii la aceasta distanta");
		}
	}
	return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[]) {
CMD:cpanel(playerid) {
	if(mp_status) SPD(playerid, 10000, DIALOG_STYLE_LIST, !"{696969}Concurs Panel", !"{696969}-{FFFAFA} Anuleaza concursul\n{696969}-{FFFAFA} Sanatate la distanta\n{696969}-{FFFAFA} Arma la distanta\n{696969}-{FFFAFA} Armour la distanta\n{696969}-{FFFAFA} Confiscare arma\n{696969}-{FFFAFA} Confiscare armour\n{696969}-{FFFAFA} Spawnare jucatori", !"DA", !"NU");
  	else SPD(playerid, 10000, DIALOG_STYLE_LIST, !"Concurs Panel", !"{696969}-{FFFAFA} Deschide concursul\n{696969}-{FFFAFA} Sanatate la distanta\n{696969}-{FFFAFA} Arma la distanta\n{696969}-{FFFAFA} Armour la distanta\n{696969}-{FFFAFA} Confiscare arma\n{696969}-{FFFAFA} Confiscare armour\n{696969}-{FFFAFA} Spawnare jucatori", !"DA", !"NU");
	return 1;
}

CMD:concurs(playerid) {
	if(!mp_status) return SCM(playerid, COLOR_RED, !"Concursul nu a fost creat!");
	else if(pInfo[playerid][pMP]) return SCM(playerid, COLOR_RED, !"Tu deja participi la concurs!");
    SetPlayerPos(playerid, mp_x, mp_y, mp_z);
	SetPlayerVirtualWorld(playerid, mp_virt);
	SetPlayerInterior(playerid, mp_int);
    pInfo[playerid][pMP] = 1;
	SCM(playerid, COLOR_YELLOW, !"Tu ai fost teleportat la concurs!");
	return 1;
}
    return 1;
}

 

sa-mp-345.png

system.amx

Edited by </Khain>
  • Like 1
  • Thanks 1
  • Upvote 2
Link to comment
Share on other sites

16 hours ago, </Khain> said:

Scopul a fost de a realiza o idee de la cei rusi,deoarece,comunitatea romana este slab dezvoltata in diferite sisteme complicate,mersi de +

Noroc in tine ca ai venit pe aici sa ne dezvolti comunitatea romana cu sistemele rusesti! :))

Ai nevoie de ajutor in scripting si nu ai bani? Te pot ajuta cu mare drag. Dar asta nu inseamna sa iti lucrez un Sistem de joc complet, daca ai nevoie de ajutor ma poti contacta pe Discord.ezgif-2-3a38433e2465.gif.9283810e304f5e405309769455e5e14b.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.