Help here
#1

Код:
../gamemodes/OnPlayerCommandZCMD.pwn(3524) : error 029: invalid expression, assumed zero






pawn Код:
}
CMD:pd(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 1)
    {
        if(pddoor1 == 0)
        {
            new string[128];
            MoveDynamicObject(policedoor1, 239.6388, 120.0999, 1002.2000, 3.0000);
            MoveDynamicObject(policedoor2, 239.5851, 115.0705, 1002.2000, 3.0000);
            SendClientMessage(playerid, COLOR_LSPD,"PD is Open, Please Close it!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            pddoor1 = 1;
        }
        else
        {
            new string[128];
            MoveDynamicObject(policedoor1, 239.6707, 119.0157, 1002.2000, 1.7500);
            MoveDynamicObject(policedoor2, 239.6916, 116.0104, 1002.2000, 1.7500);
            SendClientMessage(playerid, COLOR_LSPD,"PD is Closed, Thank You!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            pddoor1 = 0;
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
        }
    }
    return 1;
}
Reply
#2

Two elses. Remove one.

Edit: actually you missed a brace after second else:

pawn Код:
CMD:pd(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 1)
    {
        if(pddoor1 == 0)
        {
            new string[128];
            MoveDynamicObject(policedoor1, 239.6388, 120.0999, 1002.2000, 3.0000);
            MoveDynamicObject(policedoor2, 239.5851, 115.0705, 1002.2000, 3.0000);
            SendClientMessage(playerid, COLOR_LSPD,"PD is Open, Please Close it!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            pddoor1 = 1;
        }
        else
        {
            new string[128];
            MoveDynamicObject(policedoor1, 239.6707, 119.0157, 1002.2000, 1.7500);
            MoveDynamicObject(policedoor2, 239.6916, 116.0104, 1002.2000, 1.7500);
            SendClientMessage(playerid, COLOR_LSPD,"PD is Closed, Thank You!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            pddoor1 = 0;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
    }
 
    return 1;
}
Reply
#3

Which one is line 3524
Reply
#4

Quote:
Originally Posted by San1
Посмотреть сообщение
Which one is line 3524
the last else.
Reply
#5

Quote:
Originally Posted by blewert
Посмотреть сообщение
Two elses. Remove one.

Edit: actually you missed a brace after second else:

pawn Код:
CMD:pd(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 1)
    {
        if(pddoor1 == 0)
        {
            new string[128];
            MoveDynamicObject(policedoor1, 239.6388, 120.0999, 1002.2000, 3.0000);
            MoveDynamicObject(policedoor2, 239.5851, 115.0705, 1002.2000, 3.0000);
            SendClientMessage(playerid, COLOR_LSPD,"PD is Open, Please Close it!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            pddoor1 = 1;
        }
        else
        {
            new string[128];
            MoveDynamicObject(policedoor1, 239.6707, 119.0157, 1002.2000, 1.7500);
            MoveDynamicObject(policedoor2, 239.6916, 116.0104, 1002.2000, 1.7500);
            SendClientMessage(playerid, COLOR_LSPD,"PD is Closed, Thank You!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            pddoor1 = 0;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
    }
 
    return 1;
}
Thanks buddy.
Reply
#6

Код:
CMD:pd(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 1)
    {
        if(pddoor1 == 0)
        {
            new string[128];
            MoveDynamicObject(policedoor1, 239.6388, 120.0999, 1002.2000, 3.0000);
            MoveDynamicObject(policedoor2, 239.5851, 115.0705, 1002.2000, 3.0000);
            SendClientMessage(playerid, COLOR_LSPD,"PD is Open, Please Close it!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            pddoor1 = 1;
        }
        else
        {
            new string[128];
            MoveDynamicObject(policedoor1, 239.6707, 119.0157, 1002.2000, 1.7500);
            MoveDynamicObject(policedoor2, 239.6916, 116.0104, 1002.2000, 1.7500);
            SendClientMessage(playerid, COLOR_LSPD,"PD is Closed, Thank You!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            pddoor1 = 0;
        }
   else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
    }
 
    return 1;
}
try this if not work idk then
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)