AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Compile error (https://forums.alliedmods.net/showthread.php?t=155586)

ProIcons 04-24-2011 06:51

Compile error
 
PHP Code:

public requestip(P) {
    new 
cmd[300];
    
format(cmd,299,"IP %s",P)
    
socket_send(bothost,cmd,512)
}
/*
\
\
\
*/

        
new test get_player_id(killername); //120 Line
        
new test2 get_player_name(test); //121 Line
/*
\
\
\
*/

for( new 0iNumPlayersi++ )
{
                 
strtokbotcmdszPlayerNames], charsmaxszPlayerNames[ ] ), botcmdcharsmaxbotcmd ), ' ');
                 
player] = szPlayerNames]
                 
requestip(player[i+1],1); //585 Line
}
/*
\
\
\
*/
if (equali(arg1,"IP"))
 {
      new 
useID arg2//614
             
new useIP[32];
             
format(useIP,31,"%s",arg3)
             
format(ips[useID],31,"%s",useIP)
 }
/*
\
\
\
*/
get_player_id(p_r[]) {
   new 
get[32];
   
format(get,31,"%s",p_r);
   for ( new 
1<= iNumPlayers subsi++ )
   {
      if (
equali(player[i],get))
      {
          return 
i;
      }
   }
   return 
0;
}
/*
\
\
\
*/
get_player_name(p_i) {
   new 
num=p_i;
   if (
strlen(player[num]) > 0) {
       return 
player[num];
   }
   return 
0//640 Line


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Argument type mismatch (argument 1) on line 120
Error: Array must be indexed (variable "-unknown-") on line 121
Error: Argument type mismatch (argument 1) on line 585
Error: Array must be indexed (variable "-unknown-") on line 614
Error: Inconsistent return types (array & non-array) on line 640

ConnorMcLeod 04-24-2011 06:53

Re: Compile error
 
And we should guess lines numbers ?
Compiler gives you lines numbers where error occurs, if you don't paste the whole code, please highlight (pawn or small tag + @@ in front of line) those lines.

[Edit] Ok, you just did it :)

get_player_id(p_r) {
->
get_player_id(p_r[]) {

ProIcons 04-24-2011 06:56

Re: Compile error
 
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Array must be indexed (variable "-unknown-") on line 121
Error: Argument type mismatch (argument 1) on line 585
Error: Array must be indexed (variable "-unknown-") on line 614
Error: Inconsistent return types (array & non-array) on line 640

ConnorMcLeod 04-24-2011 07:05

Re: Compile error
 
Attach the whole plugin.

ProIcons 04-24-2011 07:09

Re: Compile error
 
it is private plugin, ... Tell me what part you want to paste it here...

ProIcons 04-24-2011 07:12

Re: Compile error
 
PHP Code:

new arg1[128]
copyc(arg1,128,botcmd,32


vato loco [GE-S] 04-24-2011 07:14

Re: Compile error
 
Quote:

Originally Posted by ConnorMcLeod (Post 1456581)
Attach the whole plugin.

Quote:

Originally Posted by ProIcons (Post 1456586)
PHP Code:

new arg1[128]
copyc(arg1,128,botcmd,32


lol :up:

ProIcons 04-24-2011 07:15

Re: Compile error
 
vato, i just said that is a private plugin, and i can paste some code but not whole...
i paste these two lines because an error in the compiler is here...

new useID = arg2; //614

vato loco [GE-S] 04-24-2011 07:50

Re: Compile error
 
i have seen it that it is private
but you came to scripthelp and ask for help...
if you want to get help you have to provide more code...
otherwise it will be difficult to help you .....

post the whole functions where you get errors
and not only pieces of it...
no one here can clairvoyance...

ProIcons 04-24-2011 09:29

Re: Compile error
 
PHP Code:

public somecode() {
   new 
arg1[128]
   
copyc(arg1,128,botcmd,32)
   if (
equali(arg1,"IP"))
   {
       new 
useID arg2;  //615
       
new useIP[32];
       
format(useIP,31,"%s",arg3)
       
format(ips[useID],31,"%s",useIP)
   }
   return 
PLUGIN_HANDLED;


Error: Array must be indexed (variable "-unknown-") on line 615


All times are GMT -4. The time now is 20:06.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.