help please
#1

I get these errors

pawn Код:
error 036: empty statement
in this line

pawn Код:
if(id < 0 || id > MAX_DOORS);
the code:
pawn Код:
CMD:createdoor(playerid, params[])
{
    if(!(PlayerInfo[playerid][pAdmin] >= 9999)) return SCM(playerid, COLOR_GREY,"No autorized!.");
    new input[32],id,value;
    if(id < 0 || id > MAX_DOORS);
    {
    GetPlayerPosData(playerid);
    DoorInfo[id][ddExteriorX] = GFFP[playerid][0];
    DoorInfo[id][ddExteriorY] = GFFP[playerid][1];
    DoorInfo[id][ddExteriorZ] = GFFP[playerid][2];
    DoorInfo[id][ddExteriorA] = GFFP[playerid][3];
    DoorInfo[id][ddExtVw] = GIFP[playerid][1];
    DoorInfo[id][ddExtInt] = GIFP[playerid][0];
    SaveDoors();
    LoadDoors();
    }
    return 1;
}
Reply
#2

pawn Код:
if(id < 0 || id > MAX_DOORS)
It's a if, don't need to use ';'

Example, with jcmd...
pawn Код:
newCmd:createdoor(playerid, params[])
{
    new input[32],id,value;
   
    if(!(PlayerInfo[playerid][pAdmin] >= 9999))
        return SendClientMessage(playerid, COLOR_GREY,"No autorized!");
       
    if(id < 0 || id > MAX_DOORS)
    {
        GetPlayerPosData(playerid);
        DoorInfo[id][ddExteriorX] = GFFP[playerid][0];
        DoorInfo[id][ddExteriorY] = GFFP[playerid][1];
        DoorInfo[id][ddExteriorZ] = GFFP[playerid][2];
        DoorInfo[id][ddExteriorA] = GFFP[playerid][3];
        DoorInfo[id][ddExtVw] = GIFP[playerid][1];
        DoorInfo[id][ddExtInt] = GIFP[playerid][0];
        SaveDoors();
        LoadDoors();
    }
    return 1;
}
Reply
#3

in the game the command does nothing
Reply
#4

id < 0 || id > MAX_DOORS

what value MAX_DOORS have ?

EXP.

id = 1;
MAX_DOORS = 3;

id < 0 || id > MAX_DOORS

1 < 0 || 1 > 3

false || false

My English is not good but i think you will understand.
Reply
#5

in the original command is this
but I only want to change the id of the door

pawn Код:
if(sscanf(params,"s[32]dD",input,id,value))
        {
                SCM(playerid,"USAGE: /door [name] [doorID] [(optional)value]");
                SCM(playerid,"/doorname to edit the text");
                return SCM(playerid,"Available names : [NON _ CASE SENSITIVE] Exterior, Color, Interior, Delete, Lock, PickupType, Level, VehicleAble, Admin");
        }
        if(id < 0 || id > MAX_DOORS) return SCM(playerid,"ID Must be from 0 till 1000");
Reply
#6

Yeah, i think you don't make this with the correct way, using params with sscanf... Try this:
pawn Код:
CMD:createdoor(playerid, params[])
{
    new id;

    if(PlayerInfo[playerid][pAdmin] < 1)
        return SendClientMessage(playerid, COLOR_GREY,"No autorized!");

    if(sscanf(params, "d", id)) return false;
   
    if(id < 0 || id > MAX_DOORS)
    {
        GetPlayerPosData(playerid);
        DoorInfo[id][ddExteriorX] = GFFP[playerid][0];
        DoorInfo[id][ddExteriorY] = GFFP[playerid][1];
        DoorInfo[id][ddExteriorZ] = GFFP[playerid][2];
        DoorInfo[id][ddExteriorA] = GFFP[playerid][3];
        DoorInfo[id][ddExtVw] = GIFP[playerid][1];
        DoorInfo[id][ddExtInt] = GIFP[playerid][0];
        SaveDoors();
        LoadDoors();
    }
    return 1;
}
Reply
#7

the door does not create anything just creates the id 0 but no other

sorry I only speak Spanish

if I could help create a dynamic system of doors
Reply
#8

this is you problem
this:
if(id < 0 || id > MAX_DOORS)
Replace with :
if(id < 0 || id < MAX_DOORS)
And try.
Reply
#9

bro nothing when I think the id 0 not replaced
Reply
#10

Did you add you new door in MAX_DOORS when you create new one ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)