Cooldown Timer for Garage CMD
#7

ok so i managed to shorten it down a bit.
Код:
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
Line 722, this is under OnPlayerConnect:
Код:
HasPlayerUserGarageCommand[MAX_PLAYERS] = 0;
Line 1145:
Код:
new string[128];
This is the code:
Код:
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;
}
Reply


Messages In This Thread
Cooldown Timer for Garage CMD - by Robert515 - 02.08.2014, 01:47
Re: Cooldown Timer for Garage CMD - by [NWA]Hannes - 02.08.2014, 01:54
Re: Cooldown Timer for Garage CMD - by Robert515 - 02.08.2014, 02:05
Re: Cooldown Timer for Garage CMD - by [NWA]Hannes - 02.08.2014, 02:27
Re: Cooldown Timer for Garage CMD - by Robert515 - 02.08.2014, 02:42
Re: Cooldown Timer for Garage CMD - by [NWA]Hannes - 02.08.2014, 04:32
Re: Cooldown Timer for Garage CMD - by Robert515 - 02.08.2014, 04:46
Re: Cooldown Timer for Garage CMD - by IceBilizard - 02.08.2014, 04:50
Re: Cooldown Timer for Garage CMD - by Robert515 - 02.08.2014, 04:52
Re: Cooldown Timer for Garage CMD - by IceBilizard - 02.08.2014, 04:53

Forum Jump:


Users browsing this thread: 2 Guest(s)