31.12.2011, 13:01
Right using your "stock" I made /lock command
But it doesn't work, It keeps coming up with Car Locked when you type it, It doesn' matter how far away from the car you are and if closest car is your car, it just comes up "Car Locked", any ideas?
pawn Код:
COMMAND:lock(playerid,params[])
{
new pName[MAX_PLAYER_NAME];GetPlayerName(playerid,pName,sizeof pName);
new vehicleid;
vehicleid = GetClosestVehicle(playerid, 5);
new veh = GetPlayerVehicleID(playerid);
if(IsVehiclePrivate(veh))
{
if(strcmp(pName,PrivateVehicles[ConvertVID(veh)][_owner]))
{
SendClientMessage(playerid,COLOR_WHITE,"Closest vehicle doesn't belong to you!");
return 1;
}
else
{
veh = ConvertVID(veh);
PrivateVehicles[veh][_locked] = 0;
SendClientMessage(playerid,COLOR_RED,"Car Locked!");
SetVehicleParamsEx(vehicleid,engine,lights,alarm,0,bonnet,boot,objective);
}
}
return 1;
}