This Isnt Working :( help me
#1

PROBLEM SOLVED SEE LAST PAGE ABOUT THAT FIX

pawn Код:
#include <a_samp>
#include <F_Streamer>
#define FILTERSCRIPT

#define MAX_GATES 2

new basedoor[MAX_GATES],
    bool:Open[MAX_GATES char];


#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnFilterScriptInit()
{
    basedoor[0] = F_CreateObject(980,1242.091,-2573.087,5.638,0.0,0.0,-90.000);
    basedoor[1] = F_CreateObject(980,889.423,-2573.138,5.688,0.0,0.0,-90.000);
    return 1;
}

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if (PRESSED(KEY_CROUCH))
    {
        switch(Open{0})
        {
            case true:
            {
                F_MoveObject(basedoor[0], 1242.091,-2573.087,-5.25, 1.5);
                Open{0} == false; //----- [Line 355] -----
            }
            case false:
            {
                F_MoveObject(basedoor[0], 1242.091,-2573.087,5.638, 1.5);
                Open{0} == true; //----- [Line 360] -----
            }
        }
       
        switch(Open{1})
        {
            case true:
            {
                F_MoveObject(basedoor[1], 889.423,-2573.138,5.688, 1.5);
                Open{1} == false; //----- [Line 369] -----
            }
            case false:
            {
                F_MoveObject(basedoor[1], 889.423,-2573.138,5.688, 1.5);
                Open{1} == true; //----- [Line 374] -----
            }
        }
    }
    return 1;
}
WARNINGS
PHP код:
(374) : warning 215expression has no effect
(369) : warning 215expression has no effect
(360) : warning 215expression has no effect
(355) : warning 215expression has no effect 
Reply
#2

show us line: 374, 369, 360 and 355
Reply
#3

see i already mentioned them

EDIT: checkout script carefully
Reply
#4

eehm nopes... when i put them in a new pawn script there isnt a line above 54 XD pls show us the lines i mentioned(only THAT lines and not a whole piece of code pls)
Reply
#5

pawn Код:
Open{0}
you are using " } " (curly brackets) use " ] "
i guess
Reply
#6

pawn Код:
Open{0} == false; //----- [Line 355] -----
i have a huge script so its line 355 for me
Reply
#7

i think you had by accident CAPS ON XD try this

use this:
pawn Код:
#include <a_samp>
#include <F_Streamer>
#define FILTERSCRIPT

#define MAX_GATES 2

new basedoor[MAX_GATES],
    bool:Open[MAX_GATES char];


#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnFilterScriptInit()
{
    basedoor[0] = F_CreateObject(980,1242.091,-2573.087,5.638,0.0,0.0,-90.000);
    basedoor[1] = F_CreateObject(980,889.423,-2573.138,5.688,0.0,0.0,-90.000);
    return 1;
}

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if (PRESSED(KEY_CROUCH))
    {
        switch(Open[0])
        {
            case true:
            {
                F_MoveObject(basedoor[0], 1242.091,-2573.087,-5.25, 1.5);
                Open[0] == false; //----- [Line 355] -----
            }
            case false:
            {
                F_MoveObject(basedoor[0], 1242.091,-2573.087,5.638, 1.5);
                Open[0] == true; //----- [Line 360] -----
            }
        }

        switch(Open{1})
        {
            case true:
            {
                F_MoveObject(basedoor[1], 889.423,-2573.138,5.688, 1.5);
                Open[1] == false; //----- [Line 369] -----
            }
            case false:
            {
                F_MoveObject(basedoor[1], 889.423,-2573.138,5.688, 1.5);
                Open[1] == true; //----- [Line 374] -----
            }
        }
    }
    return 1;
}

give me REP+ if it worked 20 rep looks more then 19 XD
Reply
#8

pawn Код:
Open{1} == false;
Wrong!

pawn Код:
Open[1] = false;
Reply
#9

pawn Код:
Open[0] = 0
= is used to assign a value. == is used mostly with if statements to check a value.
Reply
#10

by replacing { to [
Error:
pawn Код:
(369) : error 032: array index out of bounds (variable "Open")
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)