Jump to content


Photo

[Tutorial/SA:MP] Comenzi pentru GF


This topic has been archived. This means that you cannot reply to this topic.
21 replies to this topic

#1 Haligut

Haligut

    Official Gamer

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 965 posts
    • Time Online: 1d 18h 45m 17s

Posted 10 April 2010 - 08:14 PM

La new definim:

new gNewb[MAX_PLAYERS];

La OnPlayerConnect(playerid); definim:

gNewb[playerid] = 0;

Comanda - /newbie:

if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
		if(PlayerInfo[playerid][pLevel] > 4)
			{
				SendClientMessage(playerid, COLOR_GREY, "Level-ul tau este deja mare, nu mai esti un newbie.");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}

			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/n)ewbchat [text]");
				return 1;
			}

			if(gPlayerLogged[playerid] == 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
				return 1;
			}

			if(PlayerInfo[playerid][pMuted] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
				return 1;
			}

			if(gNewb[playerid] == 0)
			{	  
				if (PlayerInfo[playerid][pHelper] < 1)
							   {
									  format(string, sizeof(string), "(N) Newbie Level %d %s: %s", PlayerInfo[playerid][pLevel], sendername, result);
							   }
							  else
							  {
									 format(string, sizeof(string), "(N) Helper Level %d %s: %s", PlayerInfo[playerid][pHelper], sendername, result);
							  }
							  if (PlayerInfo[playerid][pAdmin] >= 1)
							  {
									 format(string, sizeof(string), "(N) Admin Level %d %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
							  }

				for(new i = 0; i < MAX_PLAYERS; i++)
				{
					if(IsPlayerConnected(i))
					{
						if(PlayerInfo[i][pLevel] <= 4 || PlayerInfo[i][pAdmin] > 0 || gNewb[i] == 0)
						{
							SendClientMessage(i, 0x629B37FF, string);
						}
					}
				}
				printf("%s", string);
				return 1;
			}
			  else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "   You must toggle that Channel to On! (/tognewb)");
				return 1;
			}
		}
		return 1;
	}

Comanda - /tognewb:

if(strcmp(cmd, "/tognewb", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			if (gNewb[playerid] == 0)
			{
				gNewb[playerid] = 1;
				SendClientMessage(playerid, COLOR_GRAD2, "  Newbie chat channel deactivated !");
			}
			else if (gNewb[playerid] == 1)
			{
				gNewb[playerid] = 0;
				SendClientMessage(playerid, COLOR_GRAD2, "  Newbie chat channel activated !");
			}
		}
		return 1;
	}
Am inlocuit cu comanda din tutorialul lui Danilicious, numai ca am modificat putin. Daca aveti probleme postati aici.

Edited by Haligut, 24 July 2010 - 10:15 PM.
Corectare


#2 MrPufy

MrPufy

    Joiner

  • Members
  • Pip
  • 20 posts
    • :

Posted 10 April 2010 - 09:29 PM

//----------------------------------[Newbie]-----------------------------------------------
	if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			if(gPlayerLogged[playerid] == 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "You haven't logged in yet!");
				return 1;
			}
			if(PlayerInfo[playerid][pLevel] < 4 || PlayerInfo[playerid][pAdmin] >=1 || PlayerInfo[playerid][pHelper] >= 1)
			{ }
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Nu mai esti newbie, level-ul tau e deja mare!");
				return 1;
			}
			if(PlayerInfo[playerid][pMuted] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "You have been silenced!");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			result[0] = toupper(result[0]);
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /n [text]");
				return 1;
			}
			if (PlayerInfo[playerid][pHelper] < 1)
			{
				format(string, sizeof(string), "(N) Newbie Level %d %s: %s", PlayerInfo[playerid][pLevel], sendername, result);
			}
			else
			{
				format(string, sizeof(string), "(N) Helper Level %d %s: %s", PlayerInfo[playerid][pHelper], sendername, result);
			}
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				format(string, sizeof(string), "(N) Admin %d %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
			}
			for (new n=0; n<MAX_PLAYERS; n++)
			{
				if (IsPlayerConnected(n) && (PlayerInfo[n][pLevel] < 3 || PlayerInfo[n][pHelper] > 0))
				{
					SendClientMessageToAll(COLOR_LIGHTGREEN, string);
				}
			}
			printf("%s", string);
		}
		return 1;
	}
Tot ce trebuie sa faceti este sa adaugati aceasta comanda in gamemode, eu am adaugat-o sub /shout, daca aveti helper pe server e ok, daca nu trebuie sa stergeti tot ce contine helper din aceasta comanda, in momentul in care folosesti /n, orice ai scrie va fi scris cu litera mare (initiala). Daca aveti probleme/erori postati-le, sper ca va este de folos.


Este bună comanda , dar pentru lideri tot Newbie va scrie ?
Era mai bine să adaugi :
if (PlayerInfo[playerid][pLeader] < 1)
			{
				format(string, sizeof(string), "(N) Leader %d %s: %s", PlayerInfo[playerid][pLevel], sendername, result);
			}

S-au să faci la fiecare facţiune cu numele ei însuşi
Exemplu:

if (PlayerInfo[playerid][pLeader] == 5)
			{
				format(string, sizeof(string), "(N) LaCosaNostra Leader %d %s: %s", PlayerInfo[playerid][pLevel], sendername, result);
			}

Dar totuşi e bine , felicitări.

#3 Haligut

Haligut

    Official Gamer

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 965 posts
    • Time Online: 1d 18h 45m 17s

Posted 10 April 2010 - 10:05 PM

Este bună comanda , dar pentru lideri tot Newbie va scrie ?
Era mai bine să adaugi :

if (PlayerInfo[playerid][pLeader] < 1)
			{
				format(string, sizeof(string), "(N) Leader %d %s: %s", PlayerInfo[playerid][pLevel], sendername, result);
			}

S-au să faci la fiecare facțiune cu numele ei însuși
Exemplu:

if (PlayerInfo[playerid][pLeader] == 5)
			{
				format(string, sizeof(string), "(N) LaCosaNostra Leader %d %s: %s", PlayerInfo[playerid][pLevel], sendername, result);
			}

Dar totuși e bine , felicitări.


E buna ideea, mersi ca mi-ai zis.

#4 XanTo

XanTo

    Retired(Former technical staff)

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 5315 posts
    • Time Online: 19d 16h 21m 11s

Posted 10 April 2010 - 10:12 PM

Vrei sa spui
if (PlayerInfo[playerid][pLeader] > 1)

Nu

if (PlayerInfo[playerid][pLeader] < 1)


#5 MrPufy

MrPufy

    Joiner

  • Members
  • Pip
  • 20 posts
    • :

Posted 11 April 2010 - 11:05 AM

Vrei sa spui

if (PlayerInfo[playerid][pLeader] > 1)

Nu

if (PlayerInfo[playerid][pLeader] < 1)



Da scuze :)), a rămas semnul aşa.

#6 Haligut

Haligut

    Official Gamer

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 965 posts
    • Time Online: 1d 18h 45m 17s

Posted 01 May 2010 - 10:28 AM

Este bună comanda , dar pentru lideri tot Newbie va scrie ?
Era mai bine să adaugi :

if (PlayerInfo[playerid][pLeader] < 1)
			{
				format(string, sizeof(string), "(N) Leader %d %s: %s", PlayerInfo[playerid][pLevel], sendername, result);
			}

S-au să faci la fiecare facțiune cu numele ei însuși
Exemplu:

if (PlayerInfo[playerid][pLeader] == 5)
			{
				format(string, sizeof(string), "(N) LaCosaNostra Leader %d %s: %s", PlayerInfo[playerid][pLevel], sendername, result);
			}

Dar totuși e bine , felicitări.


Dar daca serverul are helperi mi se pare aiurea sa mai pui si pentru leaderi, deoarece acei newbie vor intreba in continuu "recrutezi, recrutezi?".

#7 Haligut

Haligut

    Official Gamer

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 965 posts
    • Time Online: 1d 18h 45m 17s

Posted 10 May 2010 - 04:54 PM

Descriere: Este o simpla comanda, ea este echivalenta a mesajului transmis prin consola cu "Say ...". Deci in joc vom scrie /am [text] si va aparea "ADMIN: ..." cu albastru.
Cautam
public OnPlayerCommandText(playerid, cmdtext[])
si sub celelalte comenzi de admin, spre exemplu sub comanda /o, adaugam
//------------------------------------------[special admin command]--------------------------
if(strcmp(cmd,"/am",true)==0)
	{
		if (PlayerInfo[playerid][pAdmin] >= 1337)
		{

			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			result[0] = toupper(result[0]);
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/a)dmin(m)essage [message]");
				return 1;
			}
			format(string, sizeof(string), "ADMIN: %s", result);
			OOCOff(COLOR_LIGHTBLUE,string);
			printf("%s", string);
		}
		return 1;
	}

Acum, ca sa apara comanda si cand dam /ahelp, cautam comanda
/ahelp
si la
Admin Level 1337 Commands *
adaugam
/am
si va arata cam asa
Admin Level 1337 Commands * /am (si aici celelalte comenzi pe care le are admin-ul)
PS. Daca nu am fost destul de explicit sau daca primiti o eroare, doar spuneti-mi aici.

Edited by Haligut, 10 May 2010 - 04:54 PM.


#8 Haligut

Haligut

    Official Gamer

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 965 posts
    • Time Online: 1d 18h 45m 17s

Posted 10 May 2010 - 05:00 PM

Descriere: Este o simpla comanda, ca si /f, cu care pot discuta Leaderii intre ei.
La
public OnPlayerCommandText(playerid, cmdtext[])
, sub orice comanda, adaugam
///----------------------------------[LeaderChat]-----------------------------------------------
	if(strcmp(cmd, "/leaderchat", true) == 0 || strcmp(cmd, "/lc", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
					new leaders = PlayerInfo[playerid][pLeader];
			result[idx - offset] = EOS;
			result[0] = toupper(result[0]);
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/l)aders(c)hat [Chat of leaders]");
				return 1;
						}
			else if(leaders==1)
			{
				format(string, sizeof(string), "[LEADER]Police Departament %s: %s.", sendername, result);
			}
			else if(leaders==2)
			{
				format(string, sizeof(string), "[LEADER]FBI %s: %s.", sendername, result);
			}
			else if(leaders==3)
			{
				format(string, sizeof(string), "[LEADER]National Guard %s: %s.", sendername, result);
			}
			else if(leaders==4)
			{
				format(string, sizeof(string), "[LEADER]Medic %s: %s.", sendername, result);
			}
			else if(leaders==5)
			{
				format(string, sizeof(string), "[LEADER]LCN %s: %s.", sendername, result);
			}
			else if(leaders==6)
			{
				format(string, sizeof(string), "[LEADER]Yakuza %s: %s.", sendername, result);
			}
			else if(leaders==7)
			{
				format(string, sizeof(string), "[LEADER]Mayor %s: %s.", sendername, result);
			}
			else if(leaders==8)
			{
				format(string, sizeof(string), "[LEADER]Hitman %s: %s.", sendername, result);
			}
			else if(leaders==9)
			{
				format(string, sizeof(string), "[LEADER]News Reporter %s: %s.", sendername, result);
			}
			else if(leaders==10)
			{
				format(string, sizeof(string), "[LEADER]Taxi Company %s: %s.", sendername, result);
			}
			else if(leaders==11)
			{
				format(string, sizeof(string), "[LEADER]School Instructor %s: %s.", sendername, result);
			}
			else if(leaders==12)
			{
				format(string, sizeof(string), "[LEADER]Bloods %s: %s.", sendername, result);
			}
			else if(leaders==13)
			{
				format(string, sizeof(string), "[LEADER]Crips %s: %s.", sendername, result);
			}
			else if(leaders==14)
			{
				format(string, sizeof(string), "[LEADER]Nortenos %s: %s.", sendername, result);
			}
			else if(leaders==15)
			{
				format(string, sizeof(string), "[LEADER]Surenos %s: %s.", sendername, result);
			}
			if (PlayerInfo[playerid][pLeader] >= 1)
			{
				SendLeaderMessage(COLOR_1GREEN, string);
			}
			printf("Leader %s: %s", sendername, result);
		}
		return 1;
	}
, acum depinde si cum aveti voi structurate factiunile, daca le aveti altfel, pur si simplu schimbati id-ul si numele factiunii.
Sper sa va fie de folos.
PS. Daca nu am fost destul de explicit sau daca apar erori, spuneti-mi aici.

Edited by Haligut, 10 May 2010 - 05:01 PM.


#9 Haligut

Haligut

    Official Gamer

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 965 posts
    • Time Online: 1d 18h 45m 17s

Posted 10 May 2010 - 05:52 PM

Descriere: Ca si pe eGaming, este o comanda care "respawneaza" un player.
Cautam
public OnPlayerCommandText(playerid, cmdtext[])
si sub orice comanda de admin, adaugam
if(strcmp(cmd, "/respawn", true) == 0) 
	{
		if(IsPlayerConnected(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /respawn [playerid/PartOfName]");
				return 1;
			}
			new playa;
			  playa = ReturnUser(tmp);
			  if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerConnected(playa))
				{
					if(playa != INVALID_PLAYER_ID)
					{
						  //if(SpawnChange[playerid])
						{
							GetPlayerName(playa, giveplayer, sizeof(giveplayer));
							SpawnPlayer(playa);
							GetPlayerName(playerid, sendername, sizeof(sendername));
							format(string, sizeof(string), "* You have respawned player %s.", giveplayer);
							SendClientMessage(playerid, COLOR_LIGHTRED, string);
	 						format(string, sizeof(string), "* You have been respawned by Admin %s.", sendername);
							SendClientMessage(playa, COLOR_LIGHTRED, string);
							format(string, 256, "News: %s has respawned the player %s (/respawn).", sendername, giveplayer);
							ABroadCast(COLOR_YELLOW,string,1);
							return 1;
						}
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, " Nu ai voie sa folosesti aceasta comanda!");
			}
		}
		return 1;
	}
Acum cautam
/ahelp
si la
Admin Level 1 *
adaugam
/respawn
si va arata cam asa:
Admin Level 1 * /respawn (si celelalte comenzi pe care le are admin-ul)
PS. Daca nu am fost destul de explicit sau aveti erori, spuneti aici.

Edited by Haligut, 10 May 2010 - 05:53 PM.


#10 Haligut

Haligut

    Official Gamer

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 965 posts
    • Time Online: 1d 18h 45m 17s

Posted 10 May 2010 - 06:00 PM

Descriere: Este o simpla comanda cu care un admin poate da licente.
Cautam
//---------public OnPlayerCommandText(playerid, cmdtext[])
si sub o oarecare comanda de admin adaugam
---------------------------------------[Admin Give License]-------------------------------------
	if(strcmp(cmd, "/agivelicense", true) == 0 || strcmp(cmd, "/agl", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			if (PlayerInfo[playerid][pAdmin] >= 3)
			{
				new x_nr[256];
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr)) {
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /agivelicense [name] [playerid/PartOfName]");
					SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving, Pilots, Sailing, Fishing, Weapon.");
					return 1;
				}
				if(strcmp(x_nr,"driving",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "USAGE: /agivelicense driverslicense [playerid/PartOfName]");
						return 1;
					}
					giveplayerid = ReturnUser(tmp);
					if(IsPlayerConnected(giveplayerid))
					{
						if(giveplayerid != INVALID_PLAYER_ID)
						{
							GetPlayerName(playerid, sendername, sizeof(sendername));
							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "* You've given a Drivers License to %s.",giveplayer);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* Admin %s has given you a Drivers License.",sendername);
							SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
							PlayerInfo[giveplayerid][pCarLic] = 1;
							return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "   That player is Offline!");
						return 1;
					}
				}
				else if(strcmp(x_nr,"Pilots",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "USAGE: /agivelicense Pilotslicense [playerid/PartOfName]");
						return 1;
					}
					giveplayerid = ReturnUser(tmp);
					if(IsPlayerConnected(giveplayerid))
					{
						if(giveplayerid != INVALID_PLAYER_ID)
						{
							GetPlayerName(playerid, sendername, sizeof(sendername));
							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "* You've given a Pilots License to %s.",giveplayer);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* Admin %s has given you a Pilots License.",sendername);
							SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
							PlayerInfo[giveplayerid][pFlyLic] = 1;
							return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "   That player is Offline!");
						return 1;
					}
				}
				else if(strcmp(x_nr,"sailing",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "USAGE: /agivelicense sailinglicense [playerid/PartOfName]");
						return 1;
					}
					giveplayerid = ReturnUser(tmp);
					if(IsPlayerConnected(giveplayerid))
					{
						if(giveplayerid != INVALID_PLAYER_ID)
						{
							GetPlayerName(playerid, sendername, sizeof(sendername));
							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "* You've given a Sailing License to %s.",giveplayer);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* Admin %s has given you a Sailing License.",sendername);
							SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
							PlayerInfo[giveplayerid][pBoatLic] = 1;
							return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "   That player is Offline!");
						return 1;
					}
				}
				else if(strcmp(x_nr,"fishing",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "USAGE: /agivelicense fishinglicense [playerid/PartOfName]");
						return 1;
					}
					giveplayerid = ReturnUser(tmp);
					if(IsPlayerConnected(giveplayerid))
					{
						if(giveplayerid != INVALID_PLAYER_ID)
						{
							GetPlayerName(playerid, sendername, sizeof(sendername));
							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "* You've given a Fishing License to %s.",giveplayer);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* Admin %s has given you a Fishing License.",sendername);
							SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
							PlayerInfo[giveplayerid][pFishLic] = 1;
							return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "   That player is Offline!");
						return 1;
					}
				}
				else if(strcmp(x_nr,"weapon",true) == 0)
				{
					tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_WHITE, "USAGE: /agivelicense weaponlicense [playerid/PartOfName]");
						return 1;
					}
					giveplayerid = ReturnUser(tmp);
					if(IsPlayerConnected(giveplayerid))
					{
						if(giveplayerid != INVALID_PLAYER_ID)
						{
							GetPlayerName(playerid, sendername, sizeof(sendername));
							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "* You've given a Weapon License to %s.",giveplayer);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* Admin %s has given you a Weapon License.",sendername);
							SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
							PlayerInfo[giveplayerid][pGunLic] = 1;
							return 1;
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "   That player is Offline!");
						return 1;
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "   You are not authorised to use this command!");
				return 1;
			}
		}
		return 1;
 	}
Acum cautam
/ahelp
si la
Admin Level 3 *
adaugam
/agl
si va arata cam asa
Admin Level 3 * /agl (si celelalte comenzi pe care le are admin-ul)
PS. Daca nu am fost destul de explicit sau aveti erori spuneti aici.

Edited by Haligut, 10 May 2010 - 06:01 PM.


#11 Overlord

Overlord

    Support eGaming

  • Hall Of Fame
  • 1042 posts
    • Time Online: 32m 47s

Posted 20 May 2010 - 01:43 PM

Ti-am unit toate topicurile in care ai postat cate o comanda, intr-unul singur.

Aprobat in mare parte, dar din punctul meu de vedere sunt niste simple comenzi si nu constituie chiar un tutorial, mai ales ca sunt in general pentru modul GF / RP.

Pe viitor incearca sa renunti la a mai posta comenzi, si rezuma-te la un tutorial in adevaratul sens al cuvantului.
Exemplu: modalitati prin care ai putea face un lucru anume prin intermediul unei secvente de cod, vezi sectiunea cu tutorialele samp.

#12 TwO

TwO

    Sind rassistische

  • Members
  • PipPipPipPipPip
  • 474 posts
    • :

Posted 05 June 2010 - 07:03 PM

Folositor tutorial desi cred ca foarte multi au aceste comenzi.

#13 Lik3ZooM

Lik3ZooM

    Member in Charge

  • Members
  • PipPipPipPip
  • 332 posts
    • Time Online: 6d 1h 31m 48s

Posted 04 July 2010 - 03:28 PM

Salut , am si eu o problema la comanda /newbie cand scriu /n si textul imi scrie de doua sau de cinci ori :omg: , spuneti-mi si mie cum sa il fac :3-41: , sau macar bagati altul bun

#14 quZt

quZt

    I wanna touch the sky!

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 2696 posts
    • Time Online: 35d 9h 2m 52s

Posted 04 July 2010 - 05:09 PM

Comanda este buna am incercat-o si eu dupa spusele tele.Atentie sa nu o mai ai vrodata in gf(desi sunt slabe sanse) ,sau daca nu folosesti functia helpers,sterge din comanda toate functile 'pHelper'.

#15 Lik3ZooM

Lik3ZooM

    Member in Charge

  • Members
  • PipPipPipPip
  • 332 posts
    • Time Online: 6d 1h 31m 48s

Posted 04 July 2010 - 05:24 PM

Nu o mai am deloc , am cerut ajutor lui Haligut care a pus aceasta comanda si a zis ca si lui ii apare la fel ca mie , de aceea v-am cerut ajutorul , am helperi pe server , si se vede ba de 2 ori ba de 5 ori .. nu stiu ce are

#16 quZt

quZt

    I wanna touch the sky!

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 2696 posts
    • Time Online: 35d 9h 2m 52s

Posted 04 July 2010 - 05:48 PM

Acum m-am lamurit putin.Incearca sa creezi un centru al functiei.
Defineste
new gNewbie[MAX_PLAYERS];
La OnPlayerConnect definesti si aici 'gNewbie[playerid] = 0;'.
si adaugi la comanda centrul.
if(gNewb[playerid] == 0)
			{
				if (PlayerInfo[playerid][pAdmin] > 0)
				format(string, sizeof(string), "Admin %s [%d]: %s ", sendername, playerid ,result);
				else if (PlayerInfo[playerid][pAdmin] == 0)
				format(string, sizeof(string), "Newbie %s [%d]: %s", sendername, playerid , result);
				else if (PlayerInfo[playerid][pHelper] == 1)
				format(string, sizeof(string), "Helper %s [%d]: %s ", sendername, playerid , result);
Completeaza si
for (new n=0; n<MAX_PLAYERS; n++)
			{
				if (IsPlayerConnected(n) && (PlayerInfo[n][pLevel] < 3 || PlayerInfo[n][pHelper] > 0 || gNewb[n] == 0))
				{


Daca nu iti merge nici asa ,incearca sa faci pe acesta : http://forum.egaming...ewb-t52329.html
este mult mai complex si ajuta mai mult.

#17 Lik3ZooM

Lik3ZooM

    Member in Charge

  • Members
  • PipPipPipPip
  • 332 posts
    • Time Online: 6d 1h 31m 48s

Posted 04 July 2010 - 09:33 PM

Da am reusit , multumesc mult , frumos ar fi sa ii editati si lui tutorialul ca na , nu stiu sa faca incepatori dastea ca mine :))

#18 Seven

Seven

    Ignorance, yet knowledge.

  • Hall Of Fame
  • 3369 posts
    • Time Online: 13h 31m 34s

Posted 05 July 2010 - 10:51 PM

Descriere: Este o simpla comanda, ca si /f, cu care pot discuta Leaderii intre ei.
La

public OnPlayerCommandText(playerid, cmdtext[])
, sub orice comanda, adaugam
///----------------------------------[LeaderChat]-----------------------------------------------
	if(strcmp(cmd, "/leaderchat", true) == 0 || strcmp(cmd, "/lc", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
					new leaders = PlayerInfo[playerid][pLeader];
			result[idx - offset] = EOS;
			result[0] = toupper(result[0]);
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/l)aders(c)hat [Chat of leaders]");
				return 1;
						}
			else if(leaders==1)
			{
				format(string, sizeof(string), "[LEADER]Police Departament %s: %s.", sendername, result);
			}
			else if(leaders==2)
			{
				format(string, sizeof(string), "[LEADER]FBI %s: %s.", sendername, result);
			}
			else if(leaders==3)
			{
				format(string, sizeof(string), "[LEADER]National Guard %s: %s.", sendername, result);
			}
			else if(leaders==4)
			{
				format(string, sizeof(string), "[LEADER]Medic %s: %s.", sendername, result);
			}
			else if(leaders==5)
			{
				format(string, sizeof(string), "[LEADER]LCN %s: %s.", sendername, result);
			}
			else if(leaders==6)
			{
				format(string, sizeof(string), "[LEADER]Yakuza %s: %s.", sendername, result);
			}
			else if(leaders==7)
			{
				format(string, sizeof(string), "[LEADER]Mayor %s: %s.", sendername, result);
			}
			else if(leaders==8)
			{
				format(string, sizeof(string), "[LEADER]Hitman %s: %s.", sendername, result);
			}
			else if(leaders==9)
			{
				format(string, sizeof(string), "[LEADER]News Reporter %s: %s.", sendername, result);
			}
			else if(leaders==10)
			{
				format(string, sizeof(string), "[LEADER]Taxi Company %s: %s.", sendername, result);
			}
			else if(leaders==11)
			{
				format(string, sizeof(string), "[LEADER]School Instructor %s: %s.", sendername, result);
			}
			else if(leaders==12)
			{
				format(string, sizeof(string), "[LEADER]Bloods %s: %s.", sendername, result);
			}
			else if(leaders==13)
			{
				format(string, sizeof(string), "[LEADER]Crips %s: %s.", sendername, result);
			}
			else if(leaders==14)
			{
				format(string, sizeof(string), "[LEADER]Nortenos %s: %s.", sendername, result);
			}
			else if(leaders==15)
			{
				format(string, sizeof(string), "[LEADER]Surenos %s: %s.", sendername, result);
			}
			if (PlayerInfo[playerid][pLeader] >= 1)
			{
				SendLeaderMessage(COLOR_1GREEN, string);
			}
			printf("Leader %s: %s", sendername, result);
		}
		return 1;
	}
, acum depinde si cum aveti voi structurate factiunile, daca le aveti altfel, pur si simplu schimbati id-ul si numele factiunii.
Sper sa va fie de folos.
PS. Daca nu am fost destul de explicit sau daca apar erori, spuneti-mi aici.



Nu prea ma pricep la scripting, insa m-am uitat peste cod ca simplu cunoscator de limbaj de programare, si voiam sa te intreb, n-ar fi mai util sa folosesti un "for" la comanda de mai sus, si in functie de valoarea lui "leaders" sa se modifice?

Cam asa ceva ar iesi in c++ dupa mine.
Un fel de
v[1]=[Leader]Police Departament
v[2]=[Leader]FBI
v[3]=[Leader]National Guard
v[4]=[Leader]Medic
v[5]=[Leader]La Cosa Nostra
v[6]=[Leader]Yakuza
v[7]=[Leader]Mayor
v[8]=[Leader]Hitman
v[9]=[Leader]News Reporter
v[10]=[Leader]Taxi Company
v[11]=[Leader]School Instructor
v[12]=[Leader]Bloods
v[13]=[Leader]Crips
v[14]=[Leader]Nortenos
v[15]=[Leader]Surenos

for (i=1,i<=leaders,i++)
 {
	if(leaders==i)
	 {
	  format(string, sizeof(string), v[i]" %s: %s.", sendername, result);
	 }
	else i++;
 }

Mie mi se pare ca executa mai putine comenzi, desi retine mai multe date.
Asta, daca se poate lucra cu vectori care sa retina caractere :O
PS: I'm newbie :ceuameni:

#19 Haligut

Haligut

    Official Gamer

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 965 posts
    • Time Online: 1d 18h 45m 17s

Posted 05 July 2010 - 10:56 PM

S-ar putea sa merga, chiar n-am incercat, eu l-am facut ca sa intelega acesti newbie, ca daca bag ce ai facut tu acolo, ii bag in ceata cu totul :O.

#20 Seven

Seven

    Ignorance, yet knowledge.

  • Hall Of Fame
  • 3369 posts
    • Time Online: 13h 31m 34s

Posted 05 July 2010 - 10:59 PM

Pai incearca ceva in genul ideii mele, ca sa ma simt si eu bine! :O