SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/08/2015, 12:45 PM   #1
Pagle
Little Clucker
 
Join Date: Aug 2011
Posts: 35
Reputation: 8
Post MetalDetectors Error

Welcome, if you help me.

new MetalDetectors[MAX_METAL_DETECTORS];

enum detectorData
{
detectorID,
detectorExists,
Float:detectorPos[4],
detectorInterior,
detectorWorld,
detectorObject[2]
};

SCRIPT:
HTML Code:
stock Detector_Delete(id)
{
    if (id != -1 && MetalDetectors[id][detectorExists])
	{
	    new query[64];
	    DestroyDynamicObject(MetalDetectors[id][detectorObject][0]);
	    DestroyDynamicObject(MetalDetectors[id][detectorObject][1]);
		format(query, sizeof(query), "DELETE FROM `detectors` WHERE `detectorID` = '%d'", MetalDetectors[id][detectorID]);
		mysql_tquery(g_iHandle, query);
		MetalDetectors[id][detectorID] = 0;
		MetalDetectors[id][detectorExists] = 0;
	}
	return 1;
}
ERROR:
HTML Code:
if (id != -1 && MetalDetectors[id][detectorExists])
HTML Code:
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3921) : error 001: expected token: ")", but found "["
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3921) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3921) : warning 215: expression has no effect
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3921) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3921) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
__________________
Pagle is offline   Reply With Quote
Old 03/08/2015, 12:49 PM   #2
J0sh...
Banned
 
Join Date: Aug 2014
Location: Hamburger
Posts: 1,276
Reputation: 461
Default Re: MetalDetectors Error

PHP Code:
new MetalDetectors[MAX_METAL_DETECTORS][dectectorData]; 
J0sh... is offline   Reply With Quote
Old 03/08/2015, 01:34 PM   #3
Pagle
Little Clucker
 
Join Date: Aug 2011
Posts: 35
Reputation: 8
Default Re: MetalDetectors Error

Quote:
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(1574) : error 017: undefined symbol "dectectorData"
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(1574) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3924) : error 001: expected token: ",", but found "["
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3924) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3924) : warning 215: expression has no effect
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3924) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3924) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
// 1574
new MetalDetectors[MAX_METAL_DETECTORS][dectectorData];
//

//3924

Quote:
stock Detector_Delete(id)
{
if (id != -1 && MetalDetectors[id][detectorExists])
{
new query[64];
DestroyDynamicObject(MetalDetectors[id][detectorObject][0]);
DestroyDynamicObject(MetalDetectors[id][detectorObject][1]);
format(query, sizeof(query), "DELETE FROM `detectors` WHERE `detectorID` = '%d'", MetalDetectors[id][detectorID]);
mysql_tquery(g_iHandle, query);
MetalDetectors[id][detectorID] = 0;
MetalDetectors[id][detectorExists] = 0;
}
return 1;
}
__________________
Pagle is offline   Reply With Quote
Old 03/08/2015, 01:35 PM   #4
Zonoya
Gangsta
 
Zonoya's Avatar
 
Join Date: Jul 2011
Location: Am I in Rio de Janeiro or the Amazon, you tell me?
Posts: 664
Reputation: 19
Default Re: MetalDetectors Error

Change:

new MetalDectors[MAX_METAL_DETECTORS][dectectorData];

To:

new MetalDectors[MAX_METAL_DETECTORS][detectorData];
__________________
Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
Zonoya is offline   Reply With Quote
Old 03/08/2015, 02:00 PM   #5
Pagle
Little Clucker
 
Join Date: Aug 2011
Posts: 35
Reputation: 8
Post Re: MetalDetectors Error

C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(74) : error 017: undefined symbol "detectorData"
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(74) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : error 001: expected token: ",", but found "["
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : warning 215: expression has no effect
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.


//------74
HTML Code:
new MetalDectors[MAX_METAL_DETECTORS][detectorData]; //
//-----3922 code
HTML Code:
DestroyDynamicObject(MetalDectors[id][detectorObject][0]);
HTML Code:
stock Detector_Delete(id)
{
    if (id != -1 && MetalDectors[id][detectorExists])
	{
	    new query[64];
	    DestroyDynamicObject(MetalDectors[id][detectorObject][0]);
	    DestroyDynamicObject(MetalDectors[id][detectorObject][1]);
		format(query, sizeof(query), "DELETE FROM `detectors` WHERE `detectorID` = '%d'", MetalDectors[id][detectorID]);
		mysql_tquery(g_iHandle, query);
		MetalDectors[id][detectorID] = 0;
		MetalDectors[id][detectorExists] = 0;
	}
	return 1;
}
__________________
Pagle is offline   Reply With Quote
Old 03/08/2015, 03:47 PM   #6
Zonoya
Gangsta
 
Zonoya's Avatar
 
Join Date: Jul 2011
Location: Am I in Rio de Janeiro or the Amazon, you tell me?
Posts: 664
Reputation: 19
Flowers Re: MetalDetectors Error

First off, if you haven't already, move:

new MetalDectors[MAX_METAL_DETECTORS][detectorData];

So that this is how your code part should look:

Code:
enum detectorData
{
    detectorID,
    detectorExists,
    Float:detectorPos[4],
    detectorInterior,
    detectorWorld,
    detectorObject[2]
};

new MetalDectors[MAX_METAL_DETECTORS][detectorData]
And then, reformat:

DestroyDynamicObject(MetalDectors[id][detectorObject][0]);

And

DestroyDynamicObject(MetalDectors[id][detectorObject][1]);

So that they look like this:

Code:
DestroyDynamicObject(MetalDectors[id][detectorObject[0]]);
DestroyDynamicObject(MetalDectors[id][detectorObject[1]]);
__________________
Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
Zonoya is offline   Reply With Quote
Old 03/08/2015, 04:08 PM   #7
Pagle
Little Clucker
 
Join Date: Aug 2011
Posts: 35
Reputation: 8
Default Re: MetalDetectors Error

C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : error 028: invalid subscript (not an array or too many subscripts): "detectorObject"
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : warning 215: expression has no effect
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\SLS-RP\gamemodes\LSL-RP.pwn(3922) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

//eror code 3922
Quote:
DestroyDynamicObject(MetalDectors[id][detectorObject[0]]);
__________________
Pagle is offline   Reply With Quote
Old 03/08/2015, 04:25 PM   #8
Zonoya
Gangsta
 
Zonoya's Avatar
 
Join Date: Jul 2011
Location: Am I in Rio de Janeiro or the Amazon, you tell me?
Posts: 664
Reputation: 19
Default Re: MetalDetectors Error

My apologies, that line is fine the way you had it, I got it wrong, the way it should look is:

Code:
DestroyDynamicObject(MetalDectors[id][detectorObject][0]);
DestroyDynamicObject(MetalDectors[id][detectorObject][1]);
__________________
Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
Zonoya is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error 017: undefined symbol,fatal error 107: too many error messages on one line Slicebook Scripting Help 11 04/05/2014 08:30 PM
An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds.... rati555 Scripting Help 1 14/09/2012 07:45 PM
Registered plate stock error 'error 076: syntax error in the expression, or invalid function call' Deal-or-die Scripting Help 2 25/06/2012 03:12 PM
I get tagmismatch error, But i cant find any error error Swiftz Help Archive 1 16/04/2011 04:31 AM


All times are GMT. The time now is 12:58 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.