[POMOC] Komanda

Započeo [nV]Zuba_Willson, April 01, 2011, 16:26:06 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Jel mi moze neko dati komandu /report ali ne onu kada ti neko posalje report da ti moras kucati /trashreport nego neku obicnu samo da procitam report?
Ja sam bio vec probao uzeti sa Cybera ali nece nesto ima 4 erora :/

makelele

Bolje prepravi post onako kako treba pa ti se mozda i stavi ta komanda

CMD:report( playerid, params[ ] )
{
   new reported, reason[105];
   if(sscanf(params, "us", reported, reason)) return SendClientMessage(playerid, LIGHTBLUE2, "USAGE: /report [id] [reason]");
   if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID)
    {
      if(GetPVarInt( playerid, "Level" ) == ServerInfo[MaxAdminLevel] && GetPVarInt( playerid, "Level" ) != ServerInfo[MaxAdminLevel])
      return SendClientMessage(playerid, red,"Error: You cannot use this command on this admin");
      if(playerid == reported)
      return SendClientMessage(playerid,red,"ERROR: You Cannot report Yourself");
      new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str[128];
      new hour,minute,second;
      gettime(hour,minute,second);
      GetPlayerName(reported, reportedname, sizeof(reportedname));
      GetPlayerName(playerid, reporter, sizeof(reporter));
      format(str, sizeof(str), "REPORT: %s(Id:%d) Reported %s(Id:%d) Reason: %s |Time: %d:%d:%d|", reporter,playerid, reportedname, reported, reason, hour,minute,second);
      MessageToAdmins(COLOR_WHITE,str);
      format(str, sizeof(str), "(%d:%d:%d): %s(Id:%d) Reported %s(Id:%d) Reason: %s", hour,minute,second, reporter,playerid, reportedname, reported, reason);
      for(new i = 1; i < MAX_REPORTS-1; i++) Reports = Reports[i+1];
      Reports[MAX_REPORTS-1] = str;
      SendClientMessage(playerid,yellow, "Your report has been sent to Online Administrators and saved in File!");
   }
   else return SendClientMessage(playerid,yellow, "Player is not connected or is yourself");
   return 1;
}


evo probaj ako moze pomoci
Poslednja Izmena: April 01, 2011, 16:30:18 POSLE PODNE od fixman|AND1|

Hvala ali nije uspjelo :(
Ovo je moja komanda i ona mi netreba

   if(strcmp(cmd, "/report", true) == 0 || strcmp(cmd, "/re", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(JustReported[playerid] == 1)
           {
               SendClientMessage(playerid, COLOR_GREY, "   Morate da sacekate 2 minuta da bi ste poslali opet prijavu ! ");
               return 1;
           }
           GetPlayerName(playerid, sendername, sizeof(sendername));
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koristite: (/re)port [playerid/PartOfName] [text]");
            return 1;
         }
         giveplayerid = strval(tmp);
         if(IsPlayerConnected(giveplayerid))
         {
             if(giveplayerid != INVALID_PLAYER_ID)
             {
                 new length = strlen(cmdtext);
               while ((idx < length) && (cmdtext[idx] <= ' '))
               {
                  idx++;
               }
               new offset = idx;
               new result[64];
               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, "Koristite: (/re)port [playerid/PartOfName] [text]");
                  return 1;
               }
               GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                 format(string, sizeof(string), "Prijava od: [ID:%d]%s, Osoba: [ID:%d]%s", playerid, sendername, giveplayerid, giveplayer);
               ABroadCast(0xE19898AA,string,1);
               format(string, sizeof(string), "Tekst prijave: %s", (result));
               ABroadCast(0xE19898AA,string,1);
               ABroadCast(0xA04C4CAA,"Ukucaj '/acceptreport [reporter id]' ili '/trashreport [reporter id]'",1);
               SendClientMessage(playerid, 0x96C184AA, "  Vas report je poslan svim Balkan-Ultimat3  online Adminima.");
               JustReported[playerid] = 1;
               PlayerNeedsHelp[playerid] = 1;
               SetTimerEx("ReportReset", 120000, false, "i", playerid);
             }
         }
       }
       return 1;
   }



a ovo je sa Cybera i ona mi treba

if(strcmp(cmd, "/report", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           GetPlayerName(playerid, sendername, sizeof(sendername));
         new length = strlen(cmdtext);
         while ((idx < length) && (cmdtext[idx] <= ' '))
         {
            idx++;
         }
         new offset = idx;
         new result[64];
         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
         {
            result[idx - offset] = cmdtext[idx];
            idx++;
         }
         result[idx - offset] = EOS;
         if(!strlen(result))
         {
            SendClientMessage(playerid, COLOR_RED, "Komanda: /report [tekst]");
            return 1;
         }
         format(string, sizeof(string), "| Report Poruka od: [%s]:  %s. |", sendername, (result));
         PorukaAdminima(COLOR_YELLOW,string,1);
         GMporuke(COLOR_YELLOW,string,1);
         SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Vasa poruka je poslana Online Adminima*");
       }
       return 1;
   }

a ovo su problemi

C:\Users\zuba\Desktop\Street_Stories\gamemodes\streetstories.pwn(17294) : error 017: undefined symbol "PorukaAdminima"
C:\Users\zuba\Desktop\Street_Stories\gamemodes\streetstories.pwn(17295) : error 017: undefined symbol "GMporuke"

poznaticovik

Pa nemaš definirane te simbole _-

pa mozes li mi ti definirati simbole pa mi postavi ovdje???

poznaticovik

Mogao si i sam uzeti iz CYBER GM-a ali eto kad ste svi lijeni

Dodaj ovo di su ti svi forwardi

forward PorukaAdminima(color,const string[],level);
forward GMporuke(color,const string[],gmlevel);


I ovo na kraj moda

public PorukaAdminima(color,const string[],level)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerInfo[i][Admin] >= level)
{
SendClientMessage(i, color, string);
printf("%s", string);
}
}
}
return 1;
}

public GMporuke(color,const string[],gmlevel)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerInfo[i][pGameMaster] >= gmlevel)
{
SendClientMessage(i, color, string);
printf("%s", string);
}
}
}
return 1;
}


Obriši ovo na kraju pored zadnje zagrade samo se stvara.
Poslednja Izmena: April 01, 2011, 17:06:24 POSLE PODNE od Matt♦

Citat: Matt♦ poslato April 01, 2011, 17:03:44 POSLE PODNE
Mogao si i sam uzeti iz CYBER GM-a ali eto kad ste svi lijeni

Dodaj ovo di su ti svi forwardi

forward PorukaAdminima(color,const string[],level);
forward GMporuke(color,const string[],gmlevel);


I ovo na kraj moda

public PorukaAdminima(color,const string[],level)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerInfo[i][Admin] >= level)
{
SendClientMessage(i, color, string);
printf("%s", string);
}
}
}
return 1;
}

public GMporuke(color,const string[],gmlevel)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerInfo[i][pGameMaster] >= gmlevel)
{
SendClientMessage(i, color, string);
printf("%s", string);
}
}
}
return 1;
}


Obriši ovo na kraju pored zadnje zagrade samo se stvara.

E hvala ti sada je sve uredu valjda idem sada probati al u svakom slucaju hvala :)

poznaticovik

Citat: [BURyder_Crips]E hvala ti sada je sve uredu valjda idem sada probati al u svakom slucaju hvala :)

Ništa , drago mi je da mogu pomoći (valjda XD)

jel mi moze iko da stavi ono da se nemoze slati svaki 1 minut da mi samo posalje kod?
Poslednja Izmena: April 01, 2011, 17:35:57 POSLE PODNE od [BU]Ryder_Crips