Stupid "error"/warning problem ... >_<
#1

The error: (warning)
pawn Код:
C:\Users\Michael\Desktop\GTA\Eigen server\gamemodes\ShipDM.pwn(340) : warning 217: loose indentation
C:\Users\Michael\Desktop\GTA\Eigen server\gamemodes\ShipDM.pwn(353) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
So line 338 to 361:
pawn Код:
new cmd[128],idx,tmp[256];
    cmd = strtok(cmdtext, idx);
   if(IsPlayerAdmin(playerid)) //line 340
   {
        if(!strcmp(cmd, "/akill", true, 6))
        {
            new id;
            tmp = strtok(cmdtext, idx);
            id = strval(tmp);
            if(strlen(tmp) == 0) return false;
            else SetPlayerHealth(id, 0);
            SendClientMessageToAll(COLOR_RED, "Someone is been killed by the admin !");
        }
    }

    if (IsPlayerAdmin(playerid)) //line 353
    {
        if(strcmp("/money", cmdtext, true) == 0)
        {
            GivePlayerMoney(playerid, 10000);
            return 1;
        }
       
    }
SOLVED
Reply
#2

pawn Код:
new cmd[128],idx,tmp[256];
    cmd = strtok(cmdtext, idx);
    if(!strcmp(cmd, "/akill", true, 6))
    {
      if(IsPlayerAdmin(playerid))
      {
         new id;
         tmp = strtok(cmdtext, idx);
         id = strval(tmp);
         if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED,"Use: /akill ID");
         SetPlayerHealth(id, 0);
         SendClientMessageToAll(COLOR_RED, "Someone is been killed by the admin !");
      }
      return 1;
    }
    if(!strcmp(cmd, "/money", true, 6))
    {
      if(IsPlayerAdmin(playerid))
      {
         GivePlayerMoney(playerid, 10000);
      }
      return 1;
    }
Reply
#3

You can also add
pawn Код:
#pragma tabsize 0
at the top of your script but its no recomended
Reply
#4

Quote:
Originally Posted by tour15
Посмотреть сообщение
You can also add
pawn Код:
#pragma tabsize 0
at the top of your script but its no recomended
Better if he follow the identation as i wrote below in the command.
Reply
#5

Quote:
Originally Posted by tour15
Посмотреть сообщение
You can also add
pawn Код:
#pragma tabsize 0
at the top of your script but its no recomended
Quote:
Originally Posted by Alby Fire
Посмотреть сообщение
pawn Код:
new cmd[128],idx,tmp[256];
    cmd = strtok(cmdtext, idx);
    if(!strcmp(cmd, "/akill", true, 6))
    {
      if(IsPlayerAdmin(playerid))
      {
         new id;
         tmp = strtok(cmdtext, idx);
         id = strval(tmp);
         if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED,"Use: /akill ID");
         SetPlayerHealth(id, 0);
         SendClientMessageToAll(COLOR_RED, "Someone is been killed by the admin !");
      }
      return 1;
    }
    if(!strcmp(cmd, "/money", true, 6))
    {
      if(IsPlayerAdmin(playerid))
      {
         GivePlayerMoney(playerid, 10000);
      }
      return 1;
    }
Thanks guys ! It's solved ! (a) ^^
Reply
#6

Quote:
Originally Posted by Alby Fire
Посмотреть сообщение
Better if he follow the identation as i wrote below in the command.
Sure thats why i wrote "Its not recomended"
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)