05.02.2013, 01:59
(
Последний раз редактировалось jakejohnsonusa; 05.02.2013 в 19:39.
)
I have a few problems with the following code, None of the ClientMessage's show for some reason, and the second problem is that ALL vehicles unlock (not just the nearest vehicle)... Whats wrong with my code, and how can I fix it or rewrite it?
Thanks: jakejohnsonusa
/breaklock Command Code:
Thanks: jakejohnsonusa
/breaklock Command Code:
pawn Код:
if (strcmp(cmd, "/breaklock", true) == 0)
{
new vehicle[24];
new nearest = GetNearestVehicle(playerid, 20.0);
GetVehicleName(nearest, vehicle, sizeof(vehicle));
if(IsPlayerConnected(playerid) & PlayerInfo[playerid][pJob] == 5)// Job 5 is Car Jacker Job
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(nearest, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 20.0, X, Y, Z))
{
//SendClientMessage(playerid, COLOR_GREY, "** You broke the cars lock. Now lets see if you can start it...");
CarInfo[nearest][cLock] = 0;
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(nearest, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(nearest, engine, lights, alarm, false, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_GREY, "** You broke the cars lock. Now lets see if you can start it...");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "** No vehicles in range to break into!");
}
}
return 1;
}