Command Errors
#1

when i put commands /ooc (/o) and /getcar i have 7 errors

cmds:
Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(gPlayerLogged[playerid] == 0)
           {
               SendClientMessage(playerid, COLOR_GREY, "   Nisi se jos logirao !");
               return 1;
           }
         if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
         {
            SendClientMessage(playerid, COLOR_GRAD2, "   The OOC channel has been disabled by an Admin !");
            return 1;
         }
         if(PlayerInfo[playerid][pMuted] == 1)
         {
            SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
            return 1;
         }
         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_GRAD2, "USAGE: (/o)oc [ooc chat]");
            return 1;
         }
         format(string, sizeof(string), "(( %s: %s ))", sendername, result);
         OOCOff(COLOR_OOC,string);
         printf("%s", string);
      }
      return 1;
   }
   if(strcmp(cmd, "/getcar", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, COLOR_GRAD2, "Koristite: /getcar [carid]");
            return 1;
         }
         new Float:plocx,Float:plocy,Float:plocz;
         new plo;
         plo = strval(tmp);
         if (PlayerInfo[playerid][pAdmin] >= 3)
         {
            GetPlayerPos(playerid, plocx, plocy, plocz);
            SetVehiclePos(plo,plocx,plocy+4, plocz);
         }
         else
         {
            SendClientMessage(playerid, COLOR_GRAD1, "  [{F81414}CroAS{C3C3C3}] Admini samo!!!");
         }
      }
      return 1;
   }
errors:
Код:
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1755) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1764) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1764) : error 017: undefined symbol "noooc"
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1769) : error 017: undefined symbol "pMuted"
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1771) : error 017: undefined symbol "TEAM_CYAN_COLOR"
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : error 017: undefined symbol "sendername"
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Reply
#2

You need new [name]; at the beggining of your script -.-
Reply
#3

can you explain me better?
Reply
#4

any help

plz help me
Reply
#5

#define undefined errors
Reply
#6

when i define that all i have new 6 errors:

Код:
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1758) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1767) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1767) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1772) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : warning 215: expression has no effect
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1774) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
all are in this command:
Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
           if(gPlayerLogged[playerid] == 0)
           {
               SendClientMessage(playerid, COLOR_GREY, "   Nisi se jos logirao !");
               return 1;
           }
         if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
         {
            SendClientMessage(playerid, COLOR_GRAD2, "   The OOC channel has been disabled by an Admin !");
            return 1;
         }
         if(PlayerInfo[playerid][pMuted] == 1)
         {
            SendClientMessage(playerid, TEAM_CYAN_COLOR, "You can't speak, you have been silenced !");
            return 1;
         }
         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_GRAD2, "USAGE: (/o)oc [ooc chat]");
            return 1;
         }
         format(string, sizeof(string), "(( %s: %s ))", sendername, result);
         OOCOff(COLOR_OOC,string);
         printf("%s", string);
      }
      return 1;
   }
Reply
#7

You need these:
pawn Код:
new noooc = 0;
//For pMuted make sure that the system your using really uses and needs this if not just delete but if so add this under you pInfo enum:
pMuted
#define TEAM_CYAN_COLOR 0xFF8282AA
Under OnPlayerCommandText:
new sendername[MAX_PLAYER_NAME];
Reply
#8

Quote:
Originally Posted by s0nic
Посмотреть сообщение
You need these:
pawn Код:
new noooc = 0;
//For pMuted make sure that the system your using really uses and needs this if not just delete but if so add this under you pInfo enum:
pMuted
#define TEAM_CYAN_COLOR 0xFF8282AA
Under OnPlayerCommandText:
new sendername[MAX_PLAYER_NAME];
That should help
Reply
#9

new errors :(

Код:
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(393) : error 020: invalid symbol name ""
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(442) : error 001: expected token: "-identifier-", but found ","
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1761) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1770) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1770) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1775) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1800) : error 017: undefined symbol "OOCOff"
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1803) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1805) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1828) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(1830) : warning 217: loose indentation
C:\Documents and Settings\Toni Bedy\Desktop\lecevica 2\gamemodes\crp.pwn(16831) : warning 203: symbol is never used: ""
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#10

BUMP!!
help plz
Reply
#11

1. Do not copy-paste scripts that you do not understand. Especially from the godfather script
2. Add pMuted to your PlayerInfo enum (assuming you have one in the first place)
3. If you don't know what i mean with 'enum', then you should not be editing gamemodes.
Reply
#12

new OOCOff;
Reply
#13

Nah OOCOff is a function...
pawn Код:
forward OOCOff(color,const string[]);
But i agree with Vince..
And if your copying snippets from the gm and getting errors use your brain and go look at the things in the gm your copying from and get them in your script and attempt to learn something yourself from the errors and whatnot.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)