SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 29/01/2019, 08:12 AM   #1
NoorMustafa123
Big Clucker
 
NoorMustafa123's Avatar
 
Join Date: May 2017
Location: somewhere in Earth
Posts: 63
Reputation: 6
Default afew errors...

error 021: symbol already defined: "ishex"

PHP Code:
stock ishex(str[])
{
    
//P:3("ishex called: \"%s\"", str);
    
new
        
i,
        
cur;
    if (
str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) 2;
    while (
str[i])
    {
        
cur str[i++];
        if (!((
'0' <= cur <= '9') || ('A' <= cur <= 'F') || ('a' <= cur <= 'f'))) return 0;
        
//if ((cur < '0') || ('9' < cur < 'A') || ('F' < cur < 'a') || (cur > 'f')) return 0;
    
}
    return 
1;

error 021: symbol already defined: "OnObjectMoved"
PHP Code:
public OnObjectMoved(objectid)
{
    for (new 
0MAX_BOOTHS++) if (g_BoothUsed[i] && g_BoothObject[i] == objectid) {
        
DestroyObject(g_BoothObject[i]);

        return 
SetTimerEx("UpdateBooth"3000false"dd"Booth_GetPlayer(i), i);
    }
    if (
objectid == A51NorthernGate)
    {
        
// Check if the northern gate was closing
        
if (NorthernGateStatus == GATES_CLOSING)
        {
            
// Set status flag for northern gates
            
NorthernGateStatus GATES_CLOSED;
        }
        else
        {
            
// Set status flag for northern gates
            
NorthernGateStatus GATES_OPEN;
        }
    }
    
// Check if the object that moved was the eastern gate
    
else if (objectid == A51EasternGate)
    {
        
// Check if the eastern gate was closing
        
if (EasternGateStatus == GATES_CLOSING)
        {
            
// Set status flag for eastern gate
            
EasternGateStatus GATES_CLOSED;
        }
        else
        {
            
// Set status flag for eastern gate
            
EasternGateStatus GATES_OPEN;
        }
    }

    foreach(new 
iPlayer)
    {
        if(
objectid == gRocketObj[i])
        {
            new 
Float:xFloat:yFloat:z;
            
GetObjectPos(gRocketObj[i], xyz);
            
CreateExplosion(xyz113.0);
            
DestroyObject(gRocketObj[i]);
        }
    }
    return 
1;

and many errors in this one
PHP Code:
forward OnPlayerPressButton(playeridbuttonid)
{
    
// New SASD interior.
    
for(new 0sizeof(DocButton); i++) {
        if (
buttonid == DocButton[i]) {
            if(
IsLawEnforcement(playerid)) {
                
OpenDocAreaDoors(i1);
                
SetTimerEx("OpenDocAreaDoors"5000false"ii"i0);

            }
            else {
                
SendClientMessageEx(playeridCOLOR_GREY"Access denied");
                break;
            }
        }
    }
    if(
buttonid == DocCPButton[0] || buttonid == DocCPButton[1])
    {
        if(!
IsLawEnforcement(playerid)) return SendClientMessageEx(playeridCOLOR_GREY"Access denied");
        
ShowDocPrisonControls(playerid0);
    }
    return 
false;

NoorMustafa123 is offline   Reply With Quote
Old 29/01/2019, 08:17 AM   #2
Gforcez
Gangsta
 
Gforcez's Avatar
 
Join Date: Jul 2010
Location: The Netherlands.
Posts: 777
Reputation: 449
Default Re: afew errors...

Look at the error message, what do you think it means?
__________________

Gforcez is offline   Reply With Quote
Old 29/01/2019, 08:21 AM   #3
NoorMustafa123
Big Clucker
 
NoorMustafa123's Avatar
 
Join Date: May 2017
Location: somewhere in Earth
Posts: 63
Reputation: 6
Default Re: afew errors...

that its defined two times....
NoorMustafa123 is offline   Reply With Quote
Old 29/01/2019, 09:00 AM   #4
NoorMustafa123
Big Clucker
 
NoorMustafa123's Avatar
 
Join Date: May 2017
Location: somewhere in Earth
Posts: 63
Reputation: 6
Default Re: afew errors...

so what to do to fix that, also about the 3rd code
NoorMustafa123 is offline   Reply With Quote
Old 29/01/2019, 10:27 AM   #5
Nyzenic
Big Clucker
 
Nyzenic's Avatar
 
Join Date: Sep 2017
Location: house
Posts: 86
Reputation: 51
Default Re: afew errors...

You already have ishex & OnObjectMoved funcs/callbacks in your script. Find their duplicates and remove them.

Regarding the 3rd code, posting the error messages would help us find what's wrong faster.
__________________
discord: nize#5841
[FS/INC] Custom Player Nametags

not really into samp right now
Nyzenic is offline   Reply With Quote
Old 29/01/2019, 10:31 AM   #6
fiki574
Gangsta
 
fiki574's Avatar
 
Join Date: Mar 2011
Location: Croatia
Posts: 857
Reputation: 169
Default Re: afew errors...

For 1st and 2nd, check all of your includes and other filterscripts, there is a possibility that there are functions with same name already defined or not forwarded properly.

As for the 3rd error, replace "forward" with "public" and it should work.
__________________
fiki574 is offline   Reply With Quote
Old 29/01/2019, 01:45 PM   #7
NoorMustafa123
Big Clucker
 
NoorMustafa123's Avatar
 
Join Date: May 2017
Location: somewhere in Earth
Posts: 63
Reputation: 6
Default Re: afew errors...

fixed anyway
NoorMustafa123 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
Pawn Compiling errors, Errors and Line are inside [ +REP ] EgyptForLife Scripting Help 8 19/07/2014 08:26 PM
[S-HELP] Compiling errors, Errors and Lines inside. EgyptForLife Scripting Help 3 16/07/2014 07:56 PM
Class Errors: loose indentation (2 Errors) DerickClark Scripting Help 18 22/02/2014 08:01 PM
[ERRORS] Errors appear after adding a Gang System. ••• ĤÁĶÁM ••• Help Archive 17 27/10/2010 05:19 PM
Common compiling errors - READ BEFORE POSTING ERRORS Streetplaya Help Archive 0 23/01/2010 11:20 AM


All times are GMT. The time now is 09:50 PM.


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