Pomoc oko Logiranja


Započeo mqrkelich, Mart 01, 2020, 16:17:10 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Ovako napravio sam komandu /lp i /pogledajodgovor i /pitaj, i sve je u pawnu dobro ali kada se loginujem na server pise poslao si pitanje administratoru, i ne zeli me prebaciti na spawn. Ove komadne sam uzeo sa Perfect Gaming moda i ubacio u UP, i nmg se loginat pa ako moze da se to nekako fixa. Ubacio sam samo plugin fdialog
Dio skripte:
////////////////////////////////////////////////////////////////////////////////////
	fDialog(1)
	{
		if(response)
		{
			SPD(playerid, 422, DIALOG_STYLE_INPUT, "Napisi pitanje:MORA BITI U VALIDNOM FORMATU I KONKTRETNO", "Pitanje:MORA BITI U VALIDNOM FORMATU I KONKTRETNO", "Uredu", "");
		}
		if(!response)
		{
			SPD(playerid, 423, DIALOG_STYLE_INPUT, "Napisi pitanje:MORA BITI U VALIDNOM FORMATU I KONKTRETNO", "Pitanje:MORA BITI U VALIDNOM FORMATU I KONKTRETNO", "Uredu", "");
		}
		return 1;
	}
	fDialog(2)
	{
		if(!response) return 1;
		if( response ) {
			new askQ = -1;

			for( new id = 1; id < MAX_ASKQS; id++ ) {
				if( adMaskqList[ id ][ askqSend ] == false ) {
					askQ = id;
					break;
				}
			}

		    if( askQ == -1 ) return SCM( playerid, -1, "Vec ima maksimalan broj poslatih pitanja." );

		    adMaskqList[ askQ ][ askqSend ] = true;
			adMaskqList[ askQ ][ askqID ] = playerid;

			askqInfo[ playerid ][ askqSended ] = true;
			askqInfo[ playerid ][ askqAnswered ] = false;

			strmid( adMaskqList[ askQ ][ askqOwner ], GetName( playerid ), 0, strlen( GetName( playerid ) ), 32 );
			strmid( adMaskqList[ askQ ][ askqQuestion ], inputtext, 0, strlen( inputtext ), 128 );

			SCM( playerid, -1, "Poslao si pitanje administratorima." );

			format( globalstring, sizeof( globalstring ), ""CRVENA"[Pitanje za ADMINA] %s je poslao pitanje.( /lp )", GetName( playerid ) );
			Adminp( -1, globalstring );
		}
		return 1;
	}
	fDialog(3)
	{
		if(!response) return 1;
		if( response ) {
			new askQ = -1;

			for( new id = 1; id < MAX_ASKQS; id++ ) {
				if( GMaskqList[ id ][ askqSendA ] == false ) {
					askQ = id;
					break;
				}
			}

		    if( askQ == -1 ) return SCM( playerid, -1, "Vec ima maksimalan broj poslatih pitanja." );

		    GMaskqList[ askQ ][ askqSendA ] = true;
			GMaskqList[ askQ ][ askqIDA ] = playerid;

			askqInfo[ playerid ][ askqSended ] = true;
			askqInfo[ playerid ][ askqAnswered ] = false;

			strmid( GMaskqList[ askQ ][ askqOwnerA ], GetName( playerid ), 0, strlen( GetName( playerid ) ), 32 );
			strmid( GMaskqList[ askQ ][ askqQuestionA ], inputtext, 0, strlen( inputtext ), 128 );

			SCM( playerid, -1, "Poslao si pitanje gamemasterima." );

			format( globalstring, sizeof( globalstring ), ""CRVENA"[Pitanje za GM] %s je poslao pitanje.( /lp )", GetName( playerid ) );
			AdminGameMaster( -1, globalstring );
		}
		return 1;
	}
	fDialog(4)
	{
		if( !response ) return true;
		if( response ) {
			    listitem++;
			    new string[ 256 ];
			    if( adMaskqList[ listitem ][ askqSend ] == false ) return SCM( playerid, -1, "U ovom slotu nema pitanja." );

	            IzabraniAskQ[ playerid ] = listitem;

				format( string, sizeof( string ), "Igrac %s je poslao pitanje.\n\nPitanje: %s", adMaskqList[ listitem ][ askqOwner ], adMaskqList[ listitem ][ askqQuestion ] );

			    SPD( playerid, 425, DSI, "Pitanje", string, "Odgovori", "Odustani" );
		}
		return 1;
	}
	fDialog(5)
	{
		if( !response ) return true;
		if( response ) {
				new text[ 128 ];
			    if( sscanf( inputtext, "s[128]", text ) ) return 1;

				new askid = IzabraniAskQ[ playerid ];

			    if( adMaskqList[ askid ][ askqSend ] == false ) return SCM( playerid, -1, "U ovom slotu nema pitanja." );

				adMaskqList[ askid ][ askqSend ] = false;

				new id = adMaskqList[ askid ][ askqID ];
				IzabraniAskQ[ playerid ] = -1;

				if( strcmp( GetName( id ), adMaskqList[ askid ][ askqOwner ], true ) == 0 ) {

					askqInfo[ id ][ askqAnswered ] = true;
					strmid( askqInfo[ id ][ askqAdmin ], GetName( playerid ), 0, strlen( GetName( playerid ) ), 32 );
		            strmid( askqInfo[ id ][ askqAnswer ], text, 0, strlen( text ), 128 );

		            SendClientMessageEx( playerid, -1, "Poslali ste odgovor igracu %s.", adMaskqList[ askid ][ askqOwner ] );
		            SendClientMessageEx( playerid, -1, "Vas odgovor glasi: %s.", text );

		            SendClientMessage( id, -1, "Admin/GameMaster je odgovorio na tvoje pitanje." );
		            SendClientMessage( id, -1, "Da pogledate odgovor ukucajte "SIVA"'/pogledajodgovor'." );

	                strmid( adMaskqList[ askid ][ askqOwner ], "None", 0, strlen( "None" ), 32 );
	                adMaskqList[ askid ][ askqID ] = -1;
				}
	            else {

	                if( id != IPI ) {
		                askqInfo[ id ][ askqSended ] = false;
		                askqInfo[ id ][ askqAnswered ] = false;
						strmid( askqInfo[ id ][ askqAdmin ], "None", 0, strlen( "None" ), 32 );
			            strmid( askqInfo[ id ][ askqAnswer ], "None", 0, strlen( "None" ), 128 );
	                }

	                strmid( adMaskqList[ askid ][ askqOwner ], "None", 0, strlen( "None" ), 32 );
	                adMaskqList[ askid ][ askqID ] = -1;
					SCM( playerid, -1, "Taj igrac nije online." );
					return 1;
				}
		}
		return 1;
	}
	fDialog(6)
	{
		if( !response ) return true;
		if( response ) {
			    listitem++;
			    new string[ 256 ];
			    if( GMaskqList[ listitem ][ askqSendA ] == false ) return SCM( playerid, -1, "U ovom slotu nema pitanja." );

	            IzabraniAskQ[ playerid ] = listitem;

				format( string, sizeof( string ), "Igrac %s je poslao pitanje.\n\nPitanje: %s", GMaskqList[ listitem ][ askqOwnerA ], GMaskqList[ listitem ][ askqQuestionA ] );

			    SPD( playerid, 8373, DSI, "Pitanje", string, "Odgovori", "Odustani" );
		}
		return 1;
	}
	fDialog(7)
	{
		if( !response ) return true;
		if( response ) {
				new text[ 128 ];
			    if( sscanf( inputtext, "s[128]", text ) ) return 1;

				new askid = IzabraniAskQ[ playerid ];

			    if( GMaskqList[ askid ][ askqSendA ] == false ) return SCM( playerid, -1, "U ovom slotu nema pitanja." );

				GMaskqList[ askid ][ askqSendA ] = false;

				new id = GMaskqList[ askid ][ askqIDA ];
				IzabraniAskQ[ playerid ] = -1;

				if( strcmp( GetName( id ), GMaskqList[ askid ][ askqOwnerA ], true ) == 0 ) {

					askqInfo[ id ][ askqAnswered ] = true;
					strmid( askqInfo[ id ][ askqAdmin ], GetName( playerid ), 0, strlen( GetName( playerid ) ), 32 );
		            strmid( askqInfo[ id ][ askqAnswer ], text, 0, strlen( text ), 128 );

		            SendClientMessageEx( playerid, -1, "Poslali ste odgovor igracu %s.", GMaskqList[ askid ][ askqOwnerA ] );
		            SendClientMessageEx( playerid, -1, "Vas odgovor glasi: %s.", text );

		            SendClientMessage( id, -1, "Admin/Supp je odgovorio na tvoje pitanje." );
		            SendClientMessage( id, -1, "Da pogledate odgovor ukucajte "SIVA"'/pogledajodgovor'." );

	                strmid( GMaskqList[ askid ][ askqOwnerA ], "None", 0, strlen( "None" ), 32 );
	                GMaskqList[ askid ][ askqIDA ] = -1;
				}
	            else {

	                if( id != IPI ) {
		                askqInfo[ id ][ askqSended ] = false;
		                askqInfo[ id ][ askqAnswered ] = false;
						strmid( askqInfo[ id ][ askqAdmin ], "None", 0, strlen( "None" ), 32 );
			            strmid( askqInfo[ id ][ askqAnswer ], "None", 0, strlen( "None" ), 128 );
	                }

	                strmid( GMaskqList[ askid ][ askqOwnerA ], "None", 0, strlen( "None" ), 32 );
	                GMaskqList[ askid ][ askqIDA ] = -1;
					SCM( playerid, -1, "Taj igrac nije online." );
					return 1;
				}
		}
		return 1;
	}
// =============================== Komanda pitaj i to ============================= //
////////////////////////////////////////////////////////////
YCMD:pitaj(playerid, params[],help)
{
	if(ServerInfo[isPitanja] == 1) return SCM(playerid,-1,"(LK) "CRVENA"Pitanja su trenutno iskljucena, pokusajte kasnije!");
    if(PlayerInfo[playerid][pMutiran] != 0) return SCM(playerid,-1, "(LK) "SIVA"Mutirani ste ne mozete koristiti chat!");
	if(GetTimeEx() < hPomoc[playerid]) return SCM(playerid, -1, ""SIVA"Ovu komandu mozete koristiti svakih 120 sekundi!");
    if(PlayerInfo[playerid][pZatvor] != 0) return SCM(playerid,-1,"(LK) | "SPLAVA"Ne mozete koristiti ovu komandu jer ste zatvoreni!");
	new adm = 0;
	foreach(Player, i) { if(PlayerInfo[i][pGM] > 0 || PlayerInfo[i][pAdmin] > 0) adm++; }
	if(adm == 0) return SCM(playerid, -1, ""CRVENA"(LK) "SIVA"Nema Admina & GameMastera Online pa ne mozete slati pitanje!");
	SPD(playerid,3131, DIALOG_STYLE_MSGBOX, ""BELA"Lista admina/gm", "Odaberite kome zelite postaviti pitanje:", "Admin", "GameMaster");
	return 1;
}
YCMD:lp(playerid, params[], help)
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		strdel(DialogStrgEx, 0, sizeof(DialogStrgEx));
		for(new i = 1; i < MAX_ASKQS; i++)
		{
			format(DialogStrgEx, sizeof(DialogStrgEx), "%sPitanje %d - %s(%d)\n", DialogStrgEx, i, adMaskqList[i][askqOwner], adMaskqList[i][askqID]);
		}
		SPD(playerid, 424, DSL, "Lista pitanja", DialogStrgEx, "Odaberi", "Odustani");
	}
	else if(PlayerInfo[playerid][pGM] >= 1)
	{
	    strdel(DialogStrgEx, 0, sizeof(DialogStrgEx));
		for(new i = 1; i < MAX_ASKQS; i++)
		{
			format(DialogStrgEx, sizeof(DialogStrgEx), "%sPitanje %d - %s(%d)\n", DialogStrgEx, i, GMaskqList[i][askqOwnerA], GMaskqList[i][askqIDA]);
		}
		SPD(playerid, 8372, DSL, "Lista pitanja", DialogStrgEx, "Odaberi", "Odustani");
	}
	else return SCM(playerid, -1, "Niste u mogucnosti koristiti ovu komandu.");
    return 1;
}
YCMD:pogledajodgovor(playerid, params[], help)
{
	if(askqInfo[playerid][askqSended] == false) return SCM(playerid, -1, "Nisi poslao pitanje.");
    if(askqInfo[playerid][askqAnswered] == false) return SCM(playerid, -1, "Nije odgovoreno na tvoje pitanje.");
	new string[256];
	format(string, sizeof(string), "Admin/GM %s je odgovorio na tvoje pitanje.\n\nOdgovor: %s", askqInfo[ playerid ][ askqAdmin ], askqInfo[ playerid ][ askqAnswer ] );
	SPD(playerid, 0, DSB, "Odgovor", string, "Ok", "");
	askqInfo[playerid][askqSended] = false;
	askqInfo[playerid][askqAnswered] = false;
	strmid(askqInfo[playerid][askqAdmin], "None", 0, strlen("None"), 32);
	strmid(askqInfo[playerid][askqAnswer], "None", 0, strlen("None"), 128);
	return 1;
}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
//

Slika/video ingame problema(obavezno ako je ingame problem): https://imgur.com/a/rH5gIfn izadje mi dialog za login sve radi i ukucam sifru i pise ovo...
markelich.pwn

Pa vjerovatno ti je isti ID dialoga kao i kod logina,to provjeri  :)
#M24

Citat: Don_Marquez poslato Mart 01, 2020, 17:28:18 POSLE PODNE
Pa vjerovatno ti je isti ID dialoga kao i kod logina,to provjeri  :)
Promenio sam, ali sada kada ukucam sifru vise ne pise ono ali se nista ne desava?
markelich.pwn

Ejs

*

Vidi tamo gdje ti je provjera jel igrac registriran ili prijavljen, jel imas SpawnPlayer i SetSpawnInfo

Citat: Ejs poslato Mart 01, 2020, 18:41:21 POSLE PODNE
Vidi tamo gdje ti je provjera jel igrac registriran ili prijavljen, jel imas SpawnPlayer i SetSpawnInfo
da ali nista ne vidim da ima grsksa
markelich.pwn

Ejs

*

Citat: mathias.pwn poslato Mart 01, 2020, 18:44:47 POSLE PODNE
da ali nista ne vidim da ima grsksa
Ako ti je login na OnPlayerRequestClass, vidi tamo gdje ti je ShowPlayerDialog(playerid, IDDIALOGA .................................) provjeri jel ti taj iddialoga ispravan.