[pomoc] Admin report


Započeo |Xeptic| Führer, Maj 17, 2011, 20:41:05 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:LARP
Detaljan opis problema:Evo ovako zelio bih da npr . kad administrator je na duznosti da prima reportove a kad nije na duznosti da mu samo pise idk REPORT | Igrac. Al da nepise sto je igrac napisao.
Dio skripte:Neznam sto treba pa evo
|REPORT|
if(strcmp(cmd, "/report", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[128];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /report [text]");
				return 1;
			}
			format(string, sizeof(string), "[REPORT]: {%s} (%d)kaze: [ %s ]", sendername,playerid, (result));
			SendGameMasterAdminMessage(COLOR_YELLOW,string);
			SendClientMessage(playerid, COLOR_GREEN, "Tvoja Report poruka je uspijesno poslana !");
			SendClientMessage(playerid, COLOR_LIGHTRED, "__________________________________________________________________________");
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Administratori/GameMasteri ce ti brzo odgovoriti.Molimo sacekaj.");
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /report %s",d,m,y,h,mi,s,sendername, (result));
			CommandLog(string);
			ReportLog(string);
	    }
	    return 1;
	}


|Admin duznost|
if(!strcmp(cmdtext, "/adminduty", true))
	{
		if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   You need to login first !");
				return 1;
		    }
		    if(PlayerInfo[playerid][pAdmin] > 0)
		    {
		        if(AdminDuty[playerid] == 0)
		        {
		            AdminDuty[playerid] = 1;
		            SetPlayerArmour(playerid, 999);
					SetPlayerHealth(playerid, 999);
					SetPlayerColor(playerid,COLOR_GROVE);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "Administrator Duznost| Administrator %s je sad na duznosti,pa mozete koristiti komandu (( /report )) za pomoc. ", sendername, string);
					SendClientMessageToAll( COLOR_LIGHTBLUE, string );
					if(PlayerInfo[playerid][pAdmin] >= 1337)
					{
					    for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		        }
		        else if(AdminDuty[playerid] == 1)
		        {
		            AdminDuty[playerid] = 0;
		            SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerColor(playerid,TEAM_HIT_COLOR); // white
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "Administrator Duznost| Administrator %s vise nije na duznosti.Reportovi taj admin vise nece primati.", sendername, string);
					SendClientMessageToAll( COLOR_LIGHTRED, string );
					return 1;
		        }
		    }
		    else
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   Nisi clan Admin ili GameMaster tima !");
		        return 1;
		    }
		}
	    return 1;
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Maj 17, 2011, 20:44:57 POSLE PODNE od Apokalipsa

postavi uslov ako je onduty

if(strcmp(cmd, "/report", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
                        if(AdminDuty[playerid] = 1)
                        {
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[128];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /report [text]");
				return 1;
			}
			format(string, sizeof(string), "[REPORT]: {%s} (%d)kaze: [ %s ]", sendername,playerid, (result));
			SendGameMasterAdminMessage(COLOR_YELLOW,string);
			SendClientMessage(playerid, COLOR_GREEN, "Tvoja Report poruka je uspijesno poslana !");
			SendClientMessage(playerid, COLOR_LIGHTRED, "__________________________________________________________________________");
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Administratori/GameMasteri ce ti brzo odgovoriti.Molimo sacekaj.");
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /report %s",d,m,y,h,mi,s,sendername, (result));
			CommandLog(string);
			ReportLog(string);
}
	    }
	    return 1;
	}


nisam testirao jel sam na pc na koj nemam pawno pisi ako ima errore da resimo problem

(27465) : warning 211: possibly unintended assignment


Znam da je to samo warning al ga ne zelim pa to je ovo :

                        if(AdminDuty[playerid] = 1)

+ neradi

Citat: Apokalipsa poslato Maj 17, 2011, 20:52:14 POSLE PODNE
(27465) : warning 211: possibly unintended assignment


Znam da je to samo warning al ga ne zelim pa to je ovo :

                       if(AdminDuty[playerid] = 1)

+ neradi

if(strcmp(cmd, "/report", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
                        if(AdminDuty[playerid] == 1)
                        {
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[128];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /report [text]");
				return 1;
			}
			format(string, sizeof(string), "[REPORT]: {%s} (%d)kaze: [ %s ]", sendername,playerid, (result));
			SendGameMasterAdminMessage(COLOR_YELLOW,string);
			SendClientMessage(playerid, COLOR_GREEN, "Tvoja Report poruka je uspijesno poslana !");
			SendClientMessage(playerid, COLOR_LIGHTRED, "__________________________________________________________________________");
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "Administratori/GameMasteri ce ti brzo odgovoriti.Molimo sacekaj.");
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /report %s",d,m,y,h,mi,s,sendername, (result));
			CommandLog(string);
			ReportLog(string);
}
	    }
	    return 1;
	}


jel sada radi ?



edit: sada sam skontao gde gresim
daj mi kod stocka od ReportLog
Poslednja Izmena: Maj 17, 2011, 20:56:04 POSLE PODNE od Mario Velickovski



Cek nekuzim te brate jel to folder neki + sad radi kad sam na duznosti ali kad nisam na duznosti nista nevidim i pogledaj u ReportLog doso je report kad nisam bio na duznosti.

Sad mi samo treba kad admin nije na duznosti da pise REPORT | Igrac %s (bez sto je napiso)


edit :
stavio si da samo admin moze koristiti /report xD
Poslednja Izmena: Maj 17, 2011, 21:08:24 POSLE PODNE od Apokalipsa

Citat: Apokalipsa poslato Maj 17, 2011, 21:00:31 POSLE PODNE
Cek nekuzim te brate jel to folder neki + sad radi kad sam na duznosti ali kad nisam na duznosti nista nevidim i pogledaj u ReportLog doso je report kad nisam bio na duznosti.

Sad mi samo treba kad admin nije na duznosti da pise REPORT | Igrac %s (bez sto je napiso)


edit :
stavio si da samo admin moze koristiti /report xD


da znaci komanda report ce ti ostane ista, samo sada postaj ovde

stock SendGameMasterAdminMessage i smenimo :D

OK aj napravi tut xD nekuzim te jos jbt stock koji stock xD

Mislis ReportLog ili sto>


Reci tocno sto treba napravit nemoj mi spomenit rijec stock jer neznam sto je to xD

Citat: Apokalipsa poslato Maj 17, 2011, 21:15:04 POSLE PODNE
OK aj napravi tut xD nekuzim te jos jbt stock koji stock xD

Mislis ReportLog ili sto>


Reci tocno sto treba napravit nemoj mi spomenit rijec stock jer neznam sto je to xD


nadzi ovo u skriptu

stock SendGameMasterAdminMessage

i kopiraj ovde ! sta nije jasno ?

if(strcmp(cmd, "/report", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         new length = strlen(cmdtext);
         while ((idx < length) && (cmdtext[idx] <= ' '))
         {
            idx++;
         }
         new offset = idx;
         new result[128];
         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
         {
            result[idx - offset] = cmdtext[idx];
            idx++;
         }
         result[idx - offset] = EOS;
         if(!strlen(result))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /report [text]");
            return 1;
         }
                                       
         format(string, sizeof(string), "[REPORT]: {%s} (%d)kaze: [ %s ]", sendername,playerid, (result));
                                          for( new j=0;j<MAX_PLAYERS;j++)
                                           {
                                            if(PlayerInfo[j][AdminOnDuty] == 1)
                                             {
         SendGameMasterAdminMessage(COLOR_YELLOW,string);
                                              }
                                                else if(PlayerInfo[j][AdminOnDuty == 0) return SendClientMessage(j,COLOR_YELLOW,"Report : %s ");
                                           }

         SendClientMessage(playerid, COLOR_GREEN, "Tvoja Report poruka je uspijesno poslana !");
         SendClientMessage(playerid, COLOR_LIGHTRED, "__________________________________________________________________________");
         SendClientMessage(playerid, COLOR_LIGHTBLUE, "Administratori/GameMasteri ce ti brzo odgovoriti.Molimo sacekaj.");
         new y, m, d;
         new h,mi,s;
         getdate(y,m,d);
         gettime(h,mi,s);
         format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /report %s",d,m,y,h,mi,s,sendername, (result));
         CommandLog(string);
         ReportLog(string);
       }
       return 1;
   }


Napomena : Editirao sam komandu direktno u post .. nisam je copy u pawno jer nekoristim GF .. ako imas neke errore posalji ih resicemo.