Little Help
#1

// ON TOP
Код:
   new OfferAiuto[MAX_PLAYERS];
    new OfferAiutante[MAX_PLAYERS];
//ONPLAYERDISCONNECT

Код:
	OfferAiuto[playerid] = 999;
	OfferAiutante[playerid] = 999;
//OnPlayerCommandTExt

Код:
		if(strcmp(cmd, "/preputation", true) == 0 || strcmp(cmd, "/pr", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
		if(AltroServer[playerid] != 0) return 1;
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, GIALLO, "(Utilizzo):{FFFFFF} /pr [playerid/partofname]");
				return 1;
			}
			new plo;
			new string2[256];
			plo = ReturnUser(tmp);
			if(IsPlayerConnected(plo))
			{
				if(plo != INVALID_PLAYER_ID)
				{
					if(AdminDuty[playerid] && PlayerInfo[playerid][pAdmin] >= 1)
					{
						format(string, sizeof(string), "(Info:){FFFFFF} You have sent the request to :  %s", GetPlayerNameEx(plo));
						SendClientMessage(playerid, VERDE_CHIARO,string);
						//=============================//
						format(string2, sizeof(string2), "(Info:){FFFFFF}  The Administator %s asked you to evaluate his work", GetPlayerNameEx(playerid));
						SendClientMessage(plo, VERDE_CHIARO,string2);
						ShowPlayerDialog(plo, DIALOG_OPERATO, DIALOG_STYLE_INPUT, " {FF8200}Value", "\n How useful was the admin? Insert a value for his work.\n  A value from 1 to 10", "Ok", "");
                        OfferAiuto[plo] = plo;
                        OfferAiutante[playerid] = playerid;
					}
					else
					{
						SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} Non sei autorizzato a utilizzare questo comando o non sei AdminDuty.");
					}
				}
			}
			else
			{
				SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} ID/Nome invalido");
			}
		}
		return 1;
	}
Код:

//DIALOGRESPONSE


	if(dialogid == DIALOG_OPERATO)
	{
	if(response)
	{
 new string3[256];
	new input = strval(inputtext);
	if(input > 0 && input <= 10)
	{
	GetPlayerName(OfferAiutante[playerid], playerid, sizeof(playerid));
	format(string3, sizeof(string3), "(Admin Chat): %s has been valuted by {FFAF00} : %s with the vote %d/10",GetPlayerNameEx(OfferAiutante[playerid]),GetPlayerNameEx(OfferAiuto[playerid]),input);
    AdministratorMessage(0x00FF0000, string3,1);
    OfferAiuto[playerid] = 999;
    OfferAiutante[playerid] = 999;
    SetAdminLog(string3);
         	   }
         	   else
         	   {
         	   	ShowPlayerDialog(playerid, DIALOG_OPERATO, DIALOG_STYLE_INPUT, " {FF8200}Competence", "\n Insert the competence of the admin.\n  Insert a value from 1 to 10", "Ok", "");// This is a comment
         	 SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} A value from 1 to 10");
         	   return 1;
         	   }
         	}

	}
This is the problem:

Код:
format(string3, sizeof(string3), "(Admin Chat): %s has been valuted by {FFAF00} : %s with the vote %d/10",GetPlayerNameEx(OfferAiutante[playerid]),GetPlayerNameEx(OfferAiuto[playerid]),input);
In facts it doesn't output the message correctly like :

(Admin Chat)HERE NOTHING) has been valuted by : James_Ryan with the vote 2/10

Anyone can help me?
i have no errors /warnings
Reply
#2

Replace everything you have there with this:

Top
Код:
new OfferAiutante[MAX_PLAYERS];
This means you have to delete new OfferAiuto[MAX_PLAYERS]; and OfferAiuto anywhere.

OnPlayerDisconnect
Код:
OfferAiutante[playerid]=INVALID_PLAYER_ID;
Command
Код:
if(strcmp(cmd, "/preputation", true) == 0 || strcmp(cmd, "/pr", true) == 0)
{
	if(AltroServer[playerid] != 0) return 1;
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp)) return SendClientMessage(playerid, GIALLO, "(Utilizzo):{FFFFFF} /pr [playerid/partofname]");
	new plo;
	new string2[256];
	plo = ReturnUser(tmp);
	if(IsPlayerConnected(plo))
	{
		if(plo != playerid)
		{
			if(AdminDuty[playerid] && PlayerInfo[playerid][pAdmin] >= 1)
			{
				format(string, sizeof(string), "(Info:){FFFFFF} You have sent the request to :  %s", GetPlayerNameEx(plo));
				SendClientMessage(playerid, VERDE_CHIARO,string);
				//=============================//
				format(string2, sizeof(string2), "(Info:){FFFFFF}  The Administator %s asked you to evaluate his work", GetPlayerNameEx(playerid));
				SendClientMessage(plo, VERDE_CHIARO,string2);
				ShowPlayerDialog(plo, DIALOG_OPERATO, DIALOG_STYLE_INPUT, " {FF8200}Value", "\n How useful was the admin? Insert a value for his work.\n  A value from 1 to 10", "Ok", "");
				OfferAiutante[plo] = playerid;
			}
			else { SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} Non sei autorizzato a utilizzare questo comando o non sei AdminDuty."); }
		}
		else { SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} Cannot rate yourself!"); }
	}
	else { SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} ID/Nome invalido"); }
	return 1;
}
OnDialogResponse

Код:
if(dialogid == DIALOG_OPERATO)
{
    new string3[256];
	if(response)
	{
		new input = strval(inputtext);
		if(0 < input < 11)
		{
			format(string3, sizeof(string3), "(Admin Chat): %s has been valuted by {FFAF00} : %s with the vote %d/10",GetPlayerNameEx(OfferAiutante[playerid]),GetPlayerNameEx(playerid),input);
			AdministratorMessage(0x00FF0000, string3,1);
    		        OfferAiutante[playerid] = INVALID_PLAYER_ID;
    		        SetAdminLog(string3);
     	        }
      	        else
    	        {
      		        ShowPlayerDialog(playerid, DIALOG_OPERATO, DIALOG_STYLE_INPUT, " {FF8200}Competence", "\n Insert the competence of the admin.\n  Insert a value from 1 to 10", "Ok", "");// This is a comment
      		        SendClientMessage(playerid, ROSSO_CHIARO, "(Errore):{FFFFFF} A value from 1 to 10");
			return 1;
		}
	}
	else // There is a chance that the player might hit the ESC button in order to cancel the dialog, so you wanna have this too.
	{
	    format(string,sizeof(string)," %s has canceled your rate.",GetPlayerNameEx(playerid));
	    SendClientMessage(OfferAiutante[playerid],ROSSO_CHIARO,string);
	    OfferAiutante[playerid] = INVALID_PLAYER_ID;
	}
}
I'd suggest you move on zcmd and foreach by the way. It's way easier.
Reply
#3

Yes i know it was my choise using just onplayercommandtext

btw you are beast, thank you . ill rep ++
Reply
#4

Quote:
Originally Posted by Riccardomen
Посмотреть сообщение
Yes i know it was my choise using just onplayercommandtext

btw you are beast, thank you . ill rep ++
Have a good one bro!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)