Help command
#1

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.
Reply
#2

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

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
Reply
#4

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
Reply
#5

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.
Reply
#6

In loc de '<= 1339' pune '>= 1339'.
Reply
#7

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
Reply
#8

Ai gresit si tu:

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

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)