../gamemodes/OnPlayerCommandZCMD.pwn(3524) : error 029: invalid expression, assumed zero
}
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;
}
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;
}
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; }