Doubt - 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: Doubt (
/showthread.php?tid=657880)
Doubt -
KinderClans - 16.08.2018
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.
Re: Doubt -
Dignity - 16.08.2018
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);
}
}
}
Re: Doubt -
KinderClans - 16.08.2018
Perfect. P.S I saw your M:RP screens, awesome maps and features.