[pomoc] /adm /aodg

Započeo Woo, Januar 03, 2012, 23:13:15 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Woo

*

Skripta: Moja
Slike: //
Opis problema: Moze mi neko ubacit ako head admin odgovara na /adm da Giveplayeru (igracu kojem je poslana poruka) pise Head Admin %s kaze: %s  ... A ovo ako <=1337 admin odgovara da pise samo Admin %s kaze...

Dio skripte: 

Citatif(strcmp(cmd, "/adm", true) == 0 || strcmp(cmd, "/aodg", true) == 0) // By CuervO_NegrO
   {
       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));
                   PorukaAdminima(WHITE,string,1);
                  return 1;
               }
            }
            else
            {
                  format(string, sizeof(string), "   %d nije online.", giveplayerid);
                  SendClientMessage(playerid, COLOR_GRAD1, string);
            }
         }
         return 1;
      }
   }

if(strcmp(cmd, "/adm", true) == 0 || strcmp(cmd, "/aodg", true) == 0) // By CuervO_NegrO
   {
       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;
                  }
                  new aodg[64];
    if(PlayerInfo[playerid][pAdmin] == 1338) { aodg = "1338"; }
    else if(PlayerInfo[playerid][pAdmin] == 1337) { aodg = "1337"; }
    else if(PlayerInfo[playerid][pAdmin] == 4) { aodg = "4"; }
    else if(PlayerInfo[playerid][pAdmin] == 3) { aodg = "3"; }
    else if(PlayerInfo[playerid][pAdmin] == 2) { aodg = "2"; }
    else if(PlayerInfo[playerid][pAdmin] == 1) { aodg = "1]"; }
                   else { aodg = "Nepoznato"; }
                  GetPlayerName(playerid, sendername, sizeof(sendername));
                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                  format(string, sizeof(string), " [%s]Admin %s kaze: {FFFFFF}%s",aodg, sendername, (result));
                  SendClientMessage(giveplayerid, SVETLOPLAVA, string);
                  format(string, 256, "{DC143C}|A| %s | %s(%d): {FFFFFF}%s", sendername, giveplayer, giveplayerid, (result));
                   PorukaAdminima(WHITE,string,1);
                  return 1;
               }
            }
            else
            {
                  format(string, sizeof(string), "   %d nije online.", giveplayerid);
                  SendClientMessage(playerid, COLOR_GRAD1, string);
            }
         }
         return 1;
      }
   }


Ja sam ti stavio da izgleda npr ovako : "[1338]Admin Lusinjo kaze : Dobrodosao"

Woo

*

eee javi mi ove errore:

C:\Users\11\Downloads\Classic Life RolePlay\gamemodes\CLRP.pwn(46565) : warning 217: loose indentation
C:\Users\11\Downloads\Classic Life RolePlay\gamemodes\CLRP.pwn(46576) : warning 217: loose indentation
C:\Users\11\Downloads\Classic Life RolePlay\gamemodes\CLRP.pwn(46612) : warning 217: loose indentation
C:\Users\11\Downloads\Classic Life RolePlay\gamemodes\CLRP.pwn(46619) : warning 217: loose indentation
C:\Users\11\Downloads\Classic Life RolePlay\gamemodes\CLRP.pwn(46624) : warning 217: loose indentation
C:\Users\11\Downloads\Classic Life RolePlay\gamemodes\CLRP.pwn(46625) : warning 217: loose indentation
C:\Users\11\Downloads\Classic Life RolePlay\gamemodes\CLRP.pwn(46638) : warning 217: loose indentation
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase

Header size:          15760 bytes
Code size:          4259564 bytes
Data size:          3118256 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4487 cells (17948 bytes)
Total requirements: 7409964 bytes

7 Warnings.
Poslednja Izmena: Januar 03, 2012, 23:51:42 POSLE PODNE od Versace

Kao prvo to nisu errori to su warninzi , to ti se desi ako nemaš poravnane linije npr.

SendClientMessage(...
  printf("..

Točno

SendClientMessage(...
printf("..
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong

Woo

*

sory warninzi nemoj se ljutit odma :D


hvala :D