SA-MP Forums Archive
Some Errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Some Errors (/showthread.php?tid=249969)



Some Errors - TheKid - 21.04.2011

Код:
if(strcmp(cmd, "/factionspawn", true) == 0)
   {
      if(IsPlayerConnected(playerid))
      {
         new x_nr[256];
         x_nr = strtok(cmdtext, idx);
         if(!strlen(x_nr)) {
             SendClientMessage(playerid, COLOR_WHITE, "Type: /factionspawn (primary ; secondary)");
            return 1;
       }
         if(SpawnChange[playerid])
         {
             if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
             {
                  if(strcmp(x_nr,"primary",true) == 0)
                  {
                        if(LcnSpawn[playerid] == 0)
                        {
                            LcnSpawn[playerid] = 1;
                            return 1;
                        }
                           else if(strcmp(x_nr,"secondary",true) == 0)
                        {
                             if(LcnSpawn[playerid] == 1)
                             {
                                  LcnSpawn[playerid] = 0;
                                  return 1;
                             }
                       }
                  }
             }
		 }
	 }
       return 1;
   }
Код:
C:\Documents and Settings\MARIUS\Desktop\Server\gamemodes\rp.pwn(5770) : warning 215: expression has no effect
C:\Documents and Settings\MARIUS\Desktop\Server\gamemodes\rp.pwn(29909) : error 028: invalid subscript (not an array or too many subscripts): "LcnSpawn"
C:\Documents and Settings\MARIUS\Desktop\Server\gamemodes\rp.pwn(29909) : warning 215: expression has no effect
C:\Documents and Settings\MARIUS\Desktop\Server\gamemodes\rp.pwn(29909) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\MARIUS\Desktop\Server\gamemodes\rp.pwn(29909) : error 029: invalid expression, assumed zero
C:\Documents and Settings\MARIUS\Desktop\Server\gamemodes\rp.pwn(29909) : fatal error 107: too many error messages on one line

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


4 Errors.
Could you tell me what is wrong?
Thanks.


Re: Some Errors - Sascha - 21.04.2011

how did you define "LcnSpawn"?

(it should be new LcnSpawn[MAX_PLAYERS]


Re: Some Errors - TheKid - 21.04.2011

Quote:
Originally Posted by Sascha
Посмотреть сообщение
how did you define "LcnSpawn"?

(it should be new LcnSpawn[MAX_PLAYERS]
I added new LcnSpawn[MAX_PLAYERS] 0 errors , but in game the command doesn't works.

/imageshack/img839/8506/samp029qv.png