[Pomoc] /adm

Započeo Woo, Decembar 20, 2011, 17:57:11 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Woo

*

Skripta koju koristim: Classic
Detaljan opis problema: Moze mi neko samo pokazat tj napravit ... kad Head Admin (1338) odgovara na /adm da pise Head Admin kaze:   .....   Unaprijed Hvala!
Dio skripte:
 
Citatif(strcmp(cmd, "/adm", true) == 0 || strcmp(cmd, "/aodg", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if (PlayerInfo[playerid][pAdmin] >= 1)
         {
              if(gPlayerLogged[playerid] == 0)
              {
                  SendClientMessage(playerid, COLOR_GREY, "   Moras se ulogirati!");
                  return 1;
              }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
               SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /adm [playerid/Dio Imena] [text]");
               return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {

                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  new h,mi,s;
                    new y,m,d;
                  gettime(h,mi,s);
                  getdate(y,m,d);
                  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: /apm [playerid/Dio Imena] [text]");
                     return 1;
                  }
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  format(string, sizeof(string), "Admin %s kaze: {FFFFFF}%s", sendername, (result));
                  SendClientMessage(giveplayerid, SVETLOPLAVA, string);
                  format(string, 256, "{DC143C}|A| %s | %s(%d): {FFFFFF}%s", sendername, giveplayer, giveplayerid, (result));
                   ABroadCast(COLOR_ODG,string,1);
                  return 1;
               }
            }
            else
            {
                  format(string, sizeof(string), "   %d nije online.", giveplayerid);
                  SendClientMessage(playerid, COLOR_GRAD1, string);
            }
         }
         return 1;
      }
   }
Poslednja Izmena: Decembar 20, 2011, 17:58:12 POSLE PODNE od Versace


if(strcmp(cmd, "/adm", true) == 0 || strcmp(cmd, "/aodg", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if (PlayerInfo[playerid][pAdmin] >= 1)
         {
              if(gPlayerLogged[playerid] == 0)
              {
                  SendClientMessage(playerid, COLOR_GREY, "   Moras se ulogirati!");
                  return 1;
              }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
               SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /adm [playerid/Dio Imena] [text]");
               return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {

                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  new h,mi,s;
                     new y,m,d;
                  gettime(h,mi,s);
                  getdate(y,m,d);
                  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: /apm [playerid/Dio Imena] [text]");
                     return 1;
                  }
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  format(string, sizeof(string), "Admin %s kaze: {FFFFFF}%s", sendername, (result));
                  SendClientMessage(giveplayerid, SVETLOPLAVA, string);
                  format(string, 256, "{DC143C}|A| %s | %s(%d): {FFFFFF}%s", sendername, giveplayer, giveplayerid, (result));
                   ABroadCast(COLOR_ODG,string,1);
                  }
                if(PlayerInfo[pAdmin] >= 1338)
                GetPlayerName(playerid, sendername, sizeof(sendername));
                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  format(string, sizeof(string), "Head Admin %s kaze: {FFFFFF}%s", sendername, (result));
                  SendClientMessage(giveplayerid, SVETLOPLAVA, string);
                  format(string, 256, "{DC143C}|HA| %s | %s(%d): {FFFFFF}%s", sendername, giveplayer, giveplayerid, (result));
                   ABroadCast(COLOR_ODG,string,1);
                  return 1;
               }
            }
            else
            {
                  format(string, sizeof(string), "   %d nije online.", giveplayerid);
                  SendClientMessage(playerid, COLOR_GRAD1, string);
            }
         }
         return 1;
      }
   }

Woo

*

stavio sam ovo sto si mi napiso i crasha mi pawno onda... daj provjeri zagrade i to..... jel moze jos netko pomoc?
Poslednja Izmena: Decembar 20, 2011, 18:44:13 POSLE PODNE od Versace

if(strcmp(cmd, "/odg", true) == 0)
   {
       if(IsPlayerConnected(playerid))
        {
           if (PlayerInfo[playerid][pAdmin] >= 1)
         {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Kucaj: /odg [Igracev ID/Deo imena] [Odgovor]");
            return 1;
         }
         giveplayerid = ReturnUser(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, "Kucaj: /odg [Igracev ID/Deo imena] [Odgovor]");
                  return 1;
               }
               GetPlayerName(playerid, sendername, sizeof(sendername));
               GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
               format(string, sizeof(string), "Admin/GameMaster %s: %s",  sendername, (result));
               SendClientMessage(giveplayerid, COLOR_WHITE, string);
               format(string, 256, "Admin %s je odgovorio igracu %s: %s ", sendername, giveplayer, (result));
               ABroadCast(COLOR_YELLOW,string,1);
               return 1;
            }
         }
         else
         {
               format(string, sizeof(string), "%d nije aktivan igrac.", giveplayerid);
               SendClientMessage(playerid, COLOR_GRAD1, string);
         }
            }
            return 1;
        }
   }

Woo

*

lukas gledaj o cemu ja pricam -.-

Imaš to tamo već, pogledaj u svojoj komandi:

format(string, sizeof(string), "Head Admin %s kaze: {FFFFFF}%s", sendername, (result));

Edit: nisam te skontao da hoćeš da ne piše ime admina head admina....


Skloni "sendername"
Poslednja Izmena: Decembar 20, 2011, 22:51:49 POSLE PODNE od Talavander
Kada muškarac priča ženi bezobrazne stvari, to je seksualno uznemiravanje…
A kada žena to radi muškarcu to je 2 eura+PDV po minuti. :D

Woo

*

Omg...  PA treba bi samo da mi neko doda u taj /adm (tu komandu) ubaci kad 1338 admin pise na /adm pise Head admin %s kaze: a ne Admin kaze:

dodaÅ¡ if(PlayerInfo[playerid][pAdmin] == 1338) {  format(string, sizeof(string), "Head Admin %s kaze: {FFFFFF}%s", sendername, (result)); }

i ispod toga else if(PlayerInfo[playerid][pAdmin] < 1338) {  format(string, sizeof(string), "Admin %s kaze: {FFFFFF}%s", sendername, (result)); }
Poslednja Izmena: Decembar 20, 2011, 23:23:24 POSLE PODNE od 20 Dollar Nosebleed
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

Woo

*


if(strcmp(cmd, "/adm", true) == 0 || strcmp(cmd, "/aodg", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if (PlayerInfo[playerid][pAdmin] >= 1)
         {
              if(gPlayerLogged[playerid] == 0)
              {
                  SendClientMessage(playerid, COLOR_GREY, "   Moras se ulogirati!");
                  return 1;
              }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
               SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /adm [playerid/Dio Imena] [text]");
               return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {

                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  new h,mi,s;
                     new y,m,d;
                  gettime(h,mi,s);
                  getdate(y,m,d);
                  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: /apm [playerid/Dio Imena] [text]");
                     return 1;
                  }
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  if(PlayerInfo[playerid][pAdmin] == 1338) { format(string, sizeof(string), "Head Admin %s kaze: {FFFFFF}%s", sendername, (result));
                  SendClientMessage(giveplayerid, SVETLOPLAVA, string); }
                  else if(PlayerInfo[playerid][pAdmin] < 1338) { format(string, sizeof(string), "Head Admin %s kaze: {FFFFFF}%s", sendername, (result));
                  SendClientMessage(giveplayerid, SVETLOPLAVA, string); }
                  format(string, 256, "{DC143C}|A| %s | %s(%d): {FFFFFF}%s", sendername, giveplayer, giveplayerid, (result));
                   ABroadCast(COLOR_ODG,string,1);
                  return 1;
               }
            }
            else
            {
                  format(string, sizeof(string), "   %d nije online.", giveplayerid);
                  SendClientMessage(playerid, COLOR_GRAD1, string);
            }
         }
         return 1;
      }
   }
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

Woo

*

Hvala na trudu.... ali izbacuje mi errore... :S

Popravio sam ti errore pošto sam ja Milan Tarot.
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

Woo

*