Why does this do this ?
#1

How comes all my timers do this ?

When ever i hotwire a car it makes everyone wait 10 seconds before they can hotwire a car aging even if they have not done it in hours.. It sends a message to everyone saying you can not hot wire a car again

Please Help

pawn Код:
command(hotwire, playerid, params[])
{
    new engine, lights, alarm, doors, bonnet, boot, objective, string[128];
    new veh = GetPlayerVehicleID(playerid);
    new rand = random(10);
    if(IsPlayerInVehicle(playerid, veh))
    {
        if(AbleToHotWire == 0)
        {
            if(engine == 0)
            {
                switch(rand)
                    {
                        case 1,2,4,7,9:
                        {
                            GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(veh, 1, lights, alarm, doors, bonnet, boot, 0);
                            format(string, sizeof(string), "%s has successfuly hotwired the vehicle", GetNameNoUnderScore(playerid));
                            AbleToHotWire = 1;
                            IsPlayerInHotWiredCar = 1;
                            SetTimer("ResetHotWireTime", 10000, false);
                            NearByMessage(playerid, PURPLE, string);
                        }
                        case 3,5,6,8,10:
                        {
                            format(string, sizeof(string), "%s has failed at hotwiring the vehicle", GetNameNoUnderScore(playerid));
                            NearByMessage(playerid, PURPLE, string);
                            AbleToHotWire = 1;
                            SetTimer("ResetHotWireTime", 10000, false);
                        }
                    }
            }
            if(engine == 1)
            {
                SendClientMessage(playerid, WHITE, "The vehicles engine is on no need to hotwire");
            }
        }
        else
        {
            SendClientMessage(playerid, WHITE, "You can not hotwire a car yet");
        }
    }
}
pawn Код:
forward ResetHotWireTime(playerid);
pawn Код:
public ResetHotWireTime(playerid)
{
    AbleToHotWire = 0;
    SendClientMessage(playerid, WHITE, "You can now hotwire a car again");
}
If you need any more code just ask

Thank You

Please Help
Reply


Messages In This Thread
Why does this do this ? - by Geniuss - 11.06.2012, 20:24
Re: Why does this do this ? - by Makaveli93 - 11.06.2012, 20:27
Re: Why does this do this ? - by JaTochNietDan - 11.06.2012, 20:38

Forum Jump:


Users browsing this thread: 1 Guest(s)