SA-MP Forums Archive
How to stop the sendclientmessage being used more than once - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to stop the sendclientmessage being used more than once (/showthread.php?tid=327999)



How to stop the sendclientmessage being used more than once - [LHT]Bally - 23.03.2012

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;
}



Re: How to stop the sendclientmessage being used more than once - Daddy Yankee - 23.03.2012

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;
}