Objects and Errors
#1

This is my script (Short): http://pastebin.com/7LZSv36R

and these are the errors:
Код:
SkyEle.pwn(26) : error 017: undefined symbol "ELEVATE"
SkyEle.pwn(26) : warning 215: expression has no effect
SkyEle.pwn(26) : error 001: expected token: ";", but found "]"
SkyEle.pwn(26) : error 029: invalid expression, assumed zero
SkyEle.pwn(26) : fatal error 107: too many error messages on one line
I just don't get it. If I erase line 26. the next line would be the error.

Please fix it for me!
Reply
#2

pawn Код:
ELEVATORS[0] = CreateObject(18755, -897.09472, 357.890258, 1067.30468, 0.000000, 0.500000, -180.000000);
ELEVATORS[1] = CreateObject(18755, -892.85931, 1103.51538, 1067.47033, 0.000000, -3.500000, 90.500000);
ELEVATORS[2] = CreateObject(18755, -147.20968, 1099.57031, 1067.64135, 0.000000, 0.000000, 0.000000);
ELEVATORS[3] = CreateObject(18755, -151.16056, 354.454223, 1067.18774, 0.000000, 0.000000, -91.000000);
Reply
#3

doesn't work
Reply
#4

Quote:
Originally Posted by megamind2067
Посмотреть сообщение
This is my script (Short): http://pastebin.com/7LZSv36R

and these are the errors:
Код:
SkyEle.pwn(26) : error 017: undefined symbol "ELEVATE"
SkyEle.pwn(26) : warning 215: expression has no effect
SkyEle.pwn(26) : error 001: expected token: ";", but found "]"
SkyEle.pwn(26) : error 029: invalid expression, assumed zero
SkyEle.pwn(26) : fatal error 107: too many error messages on one line
I just don't get it. If I erase line 26. the next line would be the error.

Please fix it for me!
PHP код:
new ELEVATE[4];
new 
bool:gate_status[4 char];
forward Elevate();
forward Elevate1();
forward Elevate2();
forward Elevate3();
public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" ..::Sky Elevator by iNinja::..");
    print(
"--------------------------------------\n");
    
ELEVATE[0] = CreateObject(18755, -897.09472357.8902581067.304680.0000000.500000, -180.000000);
    
ELEVATE[1] = CreateObject(18755, -892.859311103.515381067.470330.000000, -3.50000090.500000);
    
ELEVATE[2] = CreateObject(18755, -147.209681099.570311067.641350.0000000.0000000.000000);
    
ELEVATE[3] = CreateObject(18755, -151.16056354.4542231067.187740.0000000.000000, -91.000000);
    
SetTimer("Elevate",1000,true);
    return 
1;
}
public 
Elevate()
{
    for(new 
i;i<MAX_PLAYERS;i++)
    {
        if(!
IsPlayerConnected(i)) continue;
        if(
IsPlayerInRangeOfPoint(i,2.0,150.9113355.62071066.3877))gate_status{0}=true;
        else if(
IsPlayerInRangeOfPoint(i,6.0,1590.30, -1637.9814.69))gate_status{1}=true;
        else if(
IsPlayerInRangeOfPoint(i,5.0,1543.35, -1627.7314.67))gate_status{2}=true;
        else if(
IsPlayerInRangeOfPoint(i,2.0,1543.32, -1620.9013.63))gate_status{3}=true;
    }
    if(
gate_status{1}){
       
MoveObject(ELEVATE[0], 413.7591,2536.1660,19.14842.0);
       
gate_status{1}=false;
    }
    else if(
gate_status{1} == false)MoveObject(ELEVATE[0], -897.09472357.8902581067.304682.0);
    if(
gate_status{2}){
        
MoveObject(ELEVATE[1], 1598.02, -1637.9814.692.0);
        
gate_status{1}=false;
    }
    else if(
gate_status{2} == false)MoveObject(ELEVATE[1], 1590.30, -1637.9814.692.0);
    if(
gate_status{2}){
        
MoveObject(ELEVATE[2], 1543.35, -1627.739.592.0);
        
gate_status{2} = false;
    }
    else if(
gate_status{2} == false)MoveObject(ELEVATE[2], 1543.35, -1627.7314.672.0);
    if(
gate_status{3}){
       
MoveObject(ELEVATE[3], 1543.32, -1622.4413.632.0);
       
gate_status{3}=false;
    }
    else if(
gate_status{3} == false)MoveObject(ELEVATE[3], 1543.32, -1620.9013.632.0);

first its's better to use only one timer for something like that and char arrays are very good for bool values
or values which are not about 250
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)