02.08.2014, 04:46
ok so i managed to shorten it down a bit.
Line 722, this is under OnPlayerConnect:
Line 1145:
This is the code:
Код:
House.pwn(722) : error 032: array index out of bounds (variable "HasPlayerUserGarageCommand") House.pwn(1145) : error 002: only a single statement (or expression) can follow each "case" House.pwn(1145) : error 017: undefined symbol "string" House.pwn(1145) : warning 215: expression has no effect House.pwn(1145) : error 001: expected token: ";", but found "]" House.pwn(1145) : fatal error 107: too many error messages on one line
Код:
HasPlayerUserGarageCommand[MAX_PLAYERS] = 0;
Код:
new string[128];
Код:
CMD:garage(playerid, params[]) { new Float: x, Float: y, Float: z; GetDynamicObjectPos(H148Gate, x, y, z); if(IsPlayerInRangeOfPoint(playerid, 30, x, y, z)) { if(HasPlayerUserGarageCommand[playerid] == 0) { HasPlayerUserGarageCommand[playerid] = 1; SetTimerEx("GarageCommandCooldown", 2500, false, "i", playerid); { switch(H148GarageOpen) { case 0: H148GarageOpen = 1; new string[128]; format(string, sizeof(string), "* %s uses their remote to open the garage.", GetName(playerid)); NearByMessage(playerid, 0x9A2EFEFF, string); MoveDynamicObject(H148Garage, 1656.53455, 2575.88188, 12.24580, 0.5, 0.00000, -90.00000, 90.00000); MoveDynamicObject(H148GarageCol1, 1657.35132, 2576.01870, 12.25530, 0.5, 0.00000, -90.00000, 90.00000); MoveDynamicObject(H148GarageCol2, 1655.71033, 2576.01870, 12.25530, 0.5, 0.00000, -90.00000, 90.00000); H148GarageSound1(playerid); } case 1: { H148GarageOpen = 0; new string[128]; format(string, sizeof(string), "* %s uses their remote to close the garage.", GetName(playerid)); NearByMessage(playerid, 0x9A2EFEFF, string); MoveDynamicObject(H148Garage, 1656.53455, 2576.24587, 11.12580, 0.5, 0.00000, 0.00000, 90.00000); MoveDynamicObject(H148GarageCol1, 1657.35132, 2576.29858, 11.61530, 0.5, 0.00000, 0.00000, 90.00000); MoveDynamicObject(H148GarageCol2, 1655.71033, 2576.29858, 11.61530, 0.5, 0.00000, 0.00000, 90.00000); H148GarageSound1(playerid); } } } } else return SendClientMessage(playerid, -1, "The garage is already moving. Wait to open/close it again."); } return 1; } forward GarageCommandCooldown(playerid); public GarageCommandCooldown(playerid) { HasPlayerUserGarageCommand[playerid] = 0; return 1; }