SA-MP Forums Archive
Help here - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help here (/showthread.php?tid=350020)



Help here - N0FeaR - 10.06.2012

Код:
../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;
}



Re: Help here - blewert - 10.06.2012

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;
}



Re: Help here - San1 - 10.06.2012

Which one is line 3524


Re: Help here - N0FeaR - 10.06.2012

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


Re: Help here - N0FeaR - 10.06.2012

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.


Re: Help here - San1 - 10.06.2012

Код:
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