How to stop the sendclientmessage being used more than once
#1

how to make it so it says ur vehicle is broke use /assist once instead of a few times

pawn Код:
public VehEngBrokeCheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            new Float:vhp;
            new vid = GetPlayerVehicleID(i);
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
            GetVehicleHealth(vid, vhp);
            if(vhp < 275)
            {
                TogglePlayerControllable(i, false);
                SendClientMessage(i, COLOR_GREY, "{FF0000}Your Vehicle is Broke Call {00FF00}/Assist {ff0000}to get it repaired");
               
                engveh[i] = 0;
                SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                TogglePlayerControllable(i, true);
            }
        }
    }
    return 1;
}
Reply
#2

pawn Код:
public VehEngBrokeCheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            new Float:vhp;
            new vid = GetPlayerVehicleID(i);
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
            GetVehicleHealth(vid, vhp);
            if(vhp < 275 && engine == 1) // Wont appear if the engine is already off (broken)
            {
                TogglePlayerControllable(i, false);
                SendClientMessage(i, COLOR_GREY, "{FF0000}Your Vehicle is Broke Call {00FF00}/Assist {ff0000}to get it repaired");
               
                engveh[i] = 0;
                SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                TogglePlayerControllable(i, true);
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)