Jump to content
  • 0

Ajutor


.shadoW

Question

Problema intalnita (descriere): Nu afiseaza nivelul de admin.
Ero(area / rile) / warning-(ul / urile): Nu am
Liniile de cod / sursa / script-ul: 

stock SendConnect(playerid)
{

	new string [228];
	//--------------------------------------------------------------------------
	format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][Level]);
	SendClientMessageToAll(COLOR_RED, string);
	return 1;
}

Imagini / Video (optional): nu
Ati incercat sa rezolvati singur?: Da.

 

logo.png

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

Buna seara.

Cu tot respectul fata de toti cei ce au incercat sa ajute acest domn cu problema, observ ca nivelul cunostintelor in domeniul Scripting-ului e prea jos la toti.

In codul prezentat observam up greseala importante, din cauza careia, autorul nu va avea afisat nivelul de Admin, conectat pe server si anume: Nu este pusa verificarea pe Admin si pe langa asta, nici nu este trecut in cod nici nivelul acestuia.

Codul corect al dumneavoastra ar fi urmatorul:

 

stock SendConnect(playerid)
{

    new string [228];
    //--------------------------------------------------------------------------
    format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][Level]);
    SendClientMessageToAll(COLOR_RED, string);
        if(AccInfo[playerid][pAdmin] > 0)
    {
        format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}][Admin Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][Level],AccInfo[playerid][pAdmin]);// Daca in loc de pAdmin in mod aveti o alta variabila ce defineste levelul de Admin, atunci o inlocuiti cu a dumneavoastra
            SendClientMessageToAll(COLOR_RED,string);
    }
    return 1;
}

Am pus variabila [Level] si tot nivel 0 arata.

 



 

Am rezolvat sigur problema, SendConnectet(playerid); trebuia sa o pun la OnPlayerSpawn, am intrebat dar mi s-a zis ca nu, eu am incercat si afiseaza nivelul. 

 



 

Puteti da Lock Topic. Multumesc pentru ajutor.

Edited by xStyle

 

logo.png

Link to comment
Share on other sites

  • 0
stock SendConnect(playerid)
{
    if(IsPlayerAdmin(playerid))
    {
	new string [228];
	//--------------------------------------------------------------------------
	format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][Level]);
	SendClientMessageToAll(COLOR_RED, string);
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendConnect(playerid);
    return 1;
}

242086.png

Link to comment
Share on other sites

  • 0

stock SendConnect(playerid)
{
    if(IsPlayerAdmin(playerid))
    {
	new string [228];
	//--------------------------------------------------------------------------
	format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][Level]);
	SendClientMessageToAll(COLOR_RED, string);
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendConnect(playerid);
    return 1;
}

Am acel SendConnect la OnPlayerConnect. Cand intru pe sv scrie x s-a conectat [Level : 0] asa arata chiar daca am admin 11

 

logo.png

Link to comment
Share on other sites

  • 0

Functia cu AccInfo[playerid][Level] sigur se refera la gradul de admin?

Eu asa cred pentru ca si la SendCommandToAdmins are AccInfo[playerid][Level]

format(string,256,"{FFFFFF}[Admin]: '{0066CC}%s{FFFFFF}' [{FFFF00}Level:{0066CC} %d{FFFFFF}] | {0066CC}Command: {FFFF00}%s", PlayerName2(playerid), AccInfo[playerid][Level], command);
    SaveIn("CMDaLOG", string);

 

logo.png

Link to comment
Share on other sites

  • 0

Ok,o alta intrebare,cand se conecteaza iti zice levelul tau din joc?

stock SendConnect(playerid)
{

    new string [228];
    //--------------------------------------------------------------------------
    format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][pAdmin]);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}

 

In loc de pAdmin inlocuieste cu ce variabila ai tu la admini... spre exemplu pAdministrator sau Admin sau Administrator,vezi la enum pInfo sau la enum pData ca ai acolo ceva cu Admin sau pAdmin..

 

 

Link to comment
Share on other sites

  • 0

Ok,o alta intrebare,cand se conecteaza iti zice levelul tau din joc?

stock SendConnect(playerid)
{

    new string [228];
    //--------------------------------------------------------------------------
    format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][pAdmin]);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}

In loc de pAdmin inlocuieste cu ce variabila ai tu la admini... spre exemplu pAdministrator sau Admin sau Administrator,vezi la enum pInfo sau la enum pData ca ai acolo ceva cu Admin sau pAdmin..

la enum PlayerData este Level, nu este Admin sau pAdmin, in schimb este pVip.

 


 

La conectare nu apare ce nivel am, dar daca scriu o comanda gen /god apare in acel mesaj pentru toti adminii ce comanda am folosit.

Edited by xStyle

 

logo.png

Link to comment
Share on other sites

  • 0

Atunci fa in felul urmator ca sa fie bine:))

Romani inventivi:

 

Dute la comanda /god si vezi ca scrie acolo X este on duty ca ...

Acolo mai jos ai ceva de genul SendAdminMessage,sau AbCoastMessage sau ceva gen acesta...Si copiaza acel mesaj exemplu SendAdminMessage si dute pana dai de un public in care o sa iti arate ceva de genul:

PlayerData[p..] >= 1;

Tu copiezi acel p..(unde p.. semnifica variabila adminilor) si o pui aici:

 

stock SendConnect(playerid)
{

    new string [228];
    //--------------------------------------------------------------------------
    format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, PlayerData[playerid][p..]);//In loc de p...Inlocuiesti cu variabila ce ai gasito..
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}

 

 

Link to comment
Share on other sites

  • 0

 

Atunci fa in felul urmator ca sa fie bine:))

Romani inventivi:

 

Dute la comanda /god si vezi ca scrie acolo X este on duty ca ...

Acolo mai jos ai ceva de genul SendAdminMessage,sau AbCoastMessage sau ceva gen acesta...Si copiaza acel mesaj exemplu SendAdminMessage si dute pana dai de un public in care o sa iti arate ceva de genul:

PlayerData[p..] >= 1;

Tu copiezi acel p..(unde p.. semnifica variabila adminilor) si o pui aici:


stock SendConnect(playerid)
{

    new string [228];
    //--------------------------------------------------------------------------
    format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, PlayerData[playerid][p..]);//In loc de p...Inlocuiesti cu variabila ce ai gasito..
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}

Da eroare :)


D:seby xDsl v1.0.1SLv1.6filterscriptsLuxAdmin.pwn(8884) : error 028: invalid subscript (not an array or too many subscripts): "PlayerData"
D:seby xDsl v1.0.1SLv1.6filterscriptsLuxAdmin.pwn(8884) : warning 215: expression has no effect
D:seby xDsl v1.0.1SLv1.6filterscriptsLuxAdmin.pwn(8884) : error 001: expected token: ";", but found "]"
D:seby xDsl v1.0.1SLv1.6filterscriptsLuxAdmin.pwn(8884) : error 029: invalid expression, assumed zero
D:seby xDsl v1.0.1SLv1.6filterscriptsLuxAdmin.pwn(8884) : fatal error 107: too many error messages on one line

 

logo.png

Link to comment
Share on other sites

  • 0

Ooooooof :)) posteaza comanda /god aici.

 

 

CMD:god(playerid,params[])
{
	if(AccInfo[playerid][Level] >= 6 || IsPlayerAdmin(playerid))
	{
    	if(AccInfo[playerid][God] == 0)
		{
   	    	AccInfo[playerid][God] = 1;
    	    SetPlayerHealth(playerid,100000);
           	SendClientMessage(playerid,green,"|- GodMode ON -|");
			SendCommandToAdmins(playerid,"God");
		}
		else
		{
   	        AccInfo[playerid][God] = 0;
       	    SendClientMessage(playerid,red,"|- GodMode OFF -|");
        	SetPlayerHealth(playerid, 100);
		}
		return 1;
	}
	else return ErrorMessages(playerid, 6);
}
Edited by xStyle

 

logo.png

Link to comment
Share on other sites

  • 0

Adauga inaine de string

new adminlevel = AccInfo[playerid][Level];

Apoi la mesaj in loc de AccInfo bla bla pune adminlevel.

format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, adminlevel);

Sper ca ai inteles.

Edited by NoNamed
Link to comment
Share on other sites

  • 0

Dupa variabile mi-am dat seama ca folosesti RSE V4.

 

stock SendConnect(playerid)
{

    new string [228];
    //--------------------------------------------------------------------------
    format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][Level]);
    SendClientMessageToAll(COLOR_RED, string);
    return 1;
}

Codul asta daca vrei sa-ti mearga trebuie pus in filterscripts, pentru ca acolo este variabila de admin.

Link to comment
Share on other sites

  • 0

Adauga inaine de string

new adminlevel = AccInfo[playerid][Level];

Apoi la mesaj in loc de AccInfo bla bla pune adminlevel.

format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, adminlevel);

Sper ca ai inteles.

Da am inteles dar tot nu merge :)


Pune sa trimita mesajul dupa ce ii da load la statistici...

Sa il pun la OnPlayerSpawn?

 

logo.png

Link to comment
Share on other sites

  • 0

Buna seara.

Cu tot respectul fata de toti cei ce au incercat sa ajute acest domn cu problema, observ ca nivelul cunostintelor in domeniul Scripting-ului e prea jos la toti.

In codul prezentat observam up greseala importante, din cauza careia, autorul nu va avea afisat nivelul de Admin, conectat pe server si anume: Nu este pusa verificarea pe Admin si pe langa asta, nici nu este trecut in cod nici nivelul acestuia.

Codul corect al dumneavoastra ar fi urmatorul:

 

stock SendConnect(playerid)
{

    new string [228];
    //--------------------------------------------------------------------------
    format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][Level]);
    SendClientMessageToAll(COLOR_RED, string);
        if(AccInfo[playerid][pAdmin] > 0)
    {
        format(string, 228, "{0066CC}%s{FFFF00}[{FFFFFF}id:%d{FFFF00}]{FFFFFF} s-a conectat{FF0000}[Level: {0066CC}%d{FF0000}][Admin Level: {0066CC}%d{FF0000}].", PlayerName2(playerid), playerid, AccInfo[playerid][Level],AccInfo[playerid][pAdmin]);// Daca in loc de pAdmin in mod aveti o alta variabila ce defineste levelul de Admin, atunci o inlocuiti cu a dumneavoastra
            SendClientMessageToAll(COLOR_RED,string);
    }
    return 1;
}

ep41yhufqpagka5wfoornw1wjfjie.png

HTjr_G.png
12975.png
 
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.