SA-MP Forums Archive
Help command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Română/Romanian (https://sampforum.blast.hk/forumdisplay.php?fid=40)
+---- Thread: Help command (/showthread.php?tid=381660)



Help command - Rapk1d - 30.09.2012

Salut , am o comanda pe server /makeadmin insa am o problema . Aceasta fiind daca ii dau cuiva admin 1 , el poate sa-si dea /makeadmin Nume 1338 ... ?! Care este problema :

Code:
	if(strcmp(cmd, "/makeadmin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /makeadmin [playerid/PartOfName] [level(1-1338)]");
				return 1;
			}
			/*if(AdminSecurity[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Pentru securitate, indetifica-te in /account panel!");
                return 1;
            }*/
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] <= 1339)
			{
			    if(IsPlayerConnected(para1))
			    {
				if(IsPlayerAdmin(para1))
        			{
        			    SendClientMessage(playerid, COLOR_GRAD2, "Adminul acesta este logat ca admin principal !");
        			    return 1;
					}
			        if(para1 != INVALID_PLAYER_ID)
			        {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pAdmin] = level;
						printf("SERVER: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
						format(string, sizeof(string), "   You have been promoted to a level %d admin by %s", level, sendername);
						SendClientMessage(para1, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "   You have promoted %s to a level %d admin.", giveplayer,level);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Nu ai dreptul de a utiliza aceasta comanda!");
			}
		}
		return 1;
	}
Astept raspuns
Multumesc anticipat.


Re: Help command - IuLyAnBoSs - 30.09.2012

ai comanda ascunsa ceva in gm de isi da admin, comanda nu are nimica


Re: Help command - Rapk1d - 30.09.2012

Quote:
Originally Posted by IuLyAnBoSs
View Post
ai comanda ascunsa ceva in gm de isi da admin, comanda nu are nimica
In gm nu mai exista nicaeri o asemenea comanda /makeadmin .... este facut de la 0 . Stiu fiecare parte a lui ... asta cu /makeadmin e ceva ce am gasit de pe net


Re: Help command - IuLyAnBoSs - 30.09.2012

da cine a zic ca mai este o asemenea comanda.
Oare dc ii zice "COMANDA ASCUNSA"?
Nu ganditi de loc.
Ex: /masinica id admin (/masinica 0 1339)
D asta se numesc comenzi ascunse


Re: Help command - RaZVaN ^ xD - 30.09.2012

Quote:
Originally Posted by IuLyAnBoSs
View Post
ai comanda ascunsa ceva in gm de isi da admin, comanda nu are nimica
Exemplu de prost care se da rotund ca stie sa scripteze cand defapt nu stie sa vada de unde e eroarea.

pawn Code:
if (PlayerInfo[playerid][pAdmin] <= 1339)
Uite-te mai atent la ce ti-am aratat si corecteaza greseala.


Re: Help command - doryn3l - 30.09.2012

In loc de '<= 1339' pune '>= 1339'.


Re: Help command - Flashhiee - 30.09.2012

Code:
if(strcmp(cmd, "/makeadmin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /makeadmin [playerid/PartOfName] [level(1-1338)]");
				return 1;
			}
			/*if(AdminSecurity[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Pentru securitate, indetifica-te in /account panel!");
                return 1;
            }*/
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 1338)
			{
			    if(IsPlayerConnected(para1))
			    {
				if(IsPlayerAdmin(para1))
        			{
        			    SendClientMessage(playerid, COLOR_GRAD2, "Adminul acesta este logat ca admin principal !");
        			    return 1;
					}
			        if(para1 != INVALID_PLAYER_ID)
			        {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pAdmin] = level;
						printf("SERVER: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
						format(string, sizeof(string), "   You have been promoted to a level %d admin by %s", level, sendername);
						SendClientMessage(para1, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "   You have promoted %s to a level %d admin.", giveplayer,level);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Nu ai dreptul de a utiliza aceasta comanda!");
			}
		}
		return 1;
	}
Acum poate da admin numai admin level 1338 sau rcon


Re: Help command - RaZVaN ^ xD - 30.09.2012

Ai gresit si tu:

pawn Code:
if (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin == 1338)



Re: Help command - SumX - 30.09.2012

Quote:
Originally Posted by doryn3l
View Post
In loc de '<= 1339' pune '>= 1339'.
si eu aveam probleme,puneam >= <= =<
am invatat pana la urma,acum ca fac informatica in lazar,sa ma laud si eu putin) , ne-a zis si profu de info despre operatori

in concluzie,corecteaza <= 1339 cu >= 1339


Re: Help command - Flashhiee - 01.10.2012

Quote:
Originally Posted by RaZVaN ^ xD
View Post
Ai gresit si tu:

pawn Code:
if (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin == 1338)
Greseala mea ... am editat acum