Jump to content
    Bine ai venit pe comunitatea 1TAP ROMANIA!

Citeste regulamentul comunitatii pentru a evita toate incidentele neplacute!

REGULAMENT

Te plictisesti? Te invitam pe serverele noastre!

SERVERE COMUNITARE

Acceptam servere de orice tip!

CERERE DNS

Linkuri utile

FreakHosting
FreakHosting
FreakHosting
FreakHosting
FreakHosting
Sign in to follow this  
Impulsive.

[Tutorial] Concurs pentru jucatori

Recommended Posts

Buna,astazi vreau sa va prezint un sistem care prevede organizarea 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.amx33 kB

Share this post


Link to post
Share on other sites

Multumim . T/C

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  



Theme made by CodeBite & raduly for 1TAP COMMUNITY!

Comunitatea 1TAP Romania

Comunitatea 1TAP ROMANIA a fost infiintata cu scopul de a atrage jucatorii de Counter Strike:Global Offensive si nu numai, pentru a le oferi un mediu mai bun si placut unde sa isi petreaca timpul liber alaturi de prietenii lor!

Ne-am facut recunoscuti prima data prin serverul nostru LOCUL 1 in Romania, "ARENA.1TAP.RO", si odata cu timpul ne-am extins si cu serverul de FiveM, ajungand locul 1 si el!


Copyright 2020 © FREAK Powered by Invision Community

×
×
  • Create New...