#1

I wanna show 2 different messages to cops and player, so i made in this way:

pawn Код:
if (IsDoorVehicle(vehicleid) && Player[playerid][VehicleLicense] == 0)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "* Commited a crime: (Driving without a valid driving license) - Your wanted level has been increased.");
            SetPlayerWantedLevelEx(playerid, GetPlayerWantedLevel(playerid)+1);
           
            format(string,sizeof(string),"* [Law Enforcement Radio]: Vehicle theft without license (%s) by %s (%d) - Zone:",  ReturnVehicleName(vehicleid), ReturnPlayerName(playerid), playerid);
            SendMessageToCops(string);
        }
        else if (IsDoorVehicle(vehicleid) && Player[playerid][VehicleLicense] == 1)
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "* Commited a crime: (Vehicle Theft) - Your wanted level has been increased.");
            SetPlayerWantedLevelEx(playerid, GetPlayerWantedLevel(playerid)+1);

            format(string,sizeof(string),"* [Law Enforcement Radio]: Vehicle theft (%s) by %s (%d) - Zone:",  ReturnVehicleName(vehicleid), ReturnPlayerName(playerid), playerid);
            SendMessageToCops(string);
        }
1st if you don't have vehicle license, 2nd if you have a license but you still rob the car.

But i'm sure there is a better way to do this, can you help me? Thanks.
Reply
#2

pawn Код:
if (IsDoorVehicle(vehicleid)) {

        switch ( Player[playerid][VehicleLicense] ) {

            case 0: {

                SendClientMessage(playerid, COLOR_LIGHTRED, "* Commited a crime: (Driving without a valid driving license) - Your wanted level has been increased.");
                SetPlayerWantedLevelEx(playerid, GetPlayerWantedLevel(playerid)+1);
               
                format(string,sizeof(string),"* [Law Enforcement Radio]: Vehicle theft without license (%s) by %s (%d) - Zone:",  ReturnVehicleName(vehicleid), ReturnPlayerName(playerid), playerid);
                SendMessageToCops(string);
            }

            case 1: {

                SendClientMessage(playerid, COLOR_LIGHTRED, "* Commited a crime: (Vehicle Theft) - Your wanted level has been increased.");
                SetPlayerWantedLevelEx(playerid, GetPlayerWantedLevel(playerid)+1);

                format(string,sizeof(string),"* [Law Enforcement Radio]: Vehicle theft (%s) by %s (%d) - Zone:",  ReturnVehicleName(vehicleid), ReturnPlayerName(playerid), playerid);
                SendMessageToCops(string);
            }
        }
    }
Reply
#3

Perfect. P.S I saw your M:RP screens, awesome maps and features.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)